Agents

Cross-Session Entity Linking

When a new session starts, Open Astra searches the knowledge graph for entities mentioned in the first message and reinforces their confidence score. This warm-start step ensures frequently referenced entities surface higher in future memory retrievals.

How It Works

  • Triggered only on new sessions where the opening message is longer than 20 characters
  • Runs a graph search (depth 3) against the first user message
  • Entities with a similarity score above 0.7 are reinforced by +0.05
  • Runs asynchronously — it does not delay the first agent response

Implementation Detail

typescript
// Fires on new session start, non-blocking
graphSearch(uid, userMessage, 3)
  .then((results) => {
    for (const r of results) {
      if (r.score > 0.7) {
        reinforceEntity(r.entity.id, 0.05)
      }
    }
  })

Parameters

ParameterValueDescription
Search depth3Number of graph results checked
Score threshold0.7Minimum similarity to trigger reinforcement
Boost amount+0.05Confidence delta applied to matching entities
Min message length20 charsShort greetings are skipped
Cross-session entity linking complements Graph Hints. Linking reinforces entity confidence over time; graph hints surface those entities turn-by-turn.