- Long-term context - a persistent cloud index of durable knowledge and account facts
(FAQs, policies, profile). You load it once at the start of the call with
load_index(). - Short-term context - a session holding the current
conversation, which you build up with
add_docs()as turns arrive.
A single agent turn
How it works
Load the long-term index
load_index("support-faqs") loads the persistent knowledge index into memory for querying.Open a session for the call
client.session(call_id) returns a local SessionIndex.
If an index with that name already exists in the cloud it is loaded; otherwise the session starts empty.Query both indexes per turn
Query the loaded knowledge index and the session, and pass both result sets to the model.
Example
Two kinds of context
| Short-term context | Long-term context | |
|---|---|---|
| What | The current conversation: working notes, live transcript | Durable knowledge and account facts: FAQs, policies, profile, history |
| Where | A local session, built turn by turn | A persistent cloud index, loaded once |
| Lifetime | The current interaction (optionally persisted at the end) | Across interactions |
Data hydration and sync
At call start the long-term index and the session are loaded from the cloud (no re-embedding); during the call the long-term index can stay current withauto_refresh; and
session.push_index() writes the session back. See
Data hydration & sync for the load/refresh model and
refresh-interval tuning.
Related
Sessions
The session lifecycle and API.
Real-time local indexing
How local sessions work.