Which calls to make
For documents, see the guide Grounding answers in documents. Corrections are
handled by
memory/ingest; see Corrections.
The examples use the EDN_API_KEY and EDN_SESSION_ID environment variables
from the Quickstart.
Save each turn
Callmemory/ingest with the user’s message and your model’s reply:
Response
Keep track of AI answers (optional)
Your model’s answers are never used as context on their own. But if you record them, a user can later confirm one, and it becomes a trusted fact. Two calls do this.1. Classify the reply with memory/infer
Pass the sip you got from sip/build earlier in the turn.
Response
- If the reply answers the user’s factual question and passes EDN’s check, EDN
saves it as
AI_INFERRED:savedistrueandrecord_idis set. - Pass the
sipso EDN can check the reply against the memory the model was given. Without it, replies that state specific figures, or say who holds a role, are not saved. - When nothing is saved,
savedisfalseandreasonsays why:
2. If the result is AI_GENERATED, save it with memory/generated
Response
AI_INFERRED nor AI_GENERATED records are used as context until a
user confirms them with memory/confirm.
Importing past conversations
To load conversation history, callmemory/ingest once per past turn, with
timestamp set to when it happened. EDN dates each record by that time instead
of the moment you import it.
Next steps
Building context
Read memory back with a SIP.
Corrections
How changed facts are handled.
Memory records
What these calls create.
