Skip to main content
After each turn of a conversation, your app tells EDN what was said. EDN decides what to remember and labels every record with its source.

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

Call memory/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: saved is true and record_id is set.
  • Pass the sip so 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, saved is false and reason says why:

2. If the result is AI_GENERATED, save it with memory/generated

Response
Neither 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, call memory/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.