Skip to main content
Before each model call, your app asks EDN for the memory relevant to the user’s message. This guide shows the common cases. For what each response field means, see The SIP. The examples use the EDN_API_KEY and EDN_SESSION_ID environment variables from the Quickstart, and this setup:

Get context for a turn

Build a SIP with the user’s latest message, then put sip in your model’s system prompt:
If sip is empty, there is no relevant memory, so call your model without it.

Get context from a project

To answer from one project’s memory and documents, add project_id. Add include_global: true if general memory should be included too:
Project builds number their sources, so ask your model to cite them:
Use citations to show each number’s source to your user. See Citations.

Help with follow-up questions

Short follow-ups like “and who approves it?” have little to search on. Save each message to the session as the conversation goes:
If a question on its own finds no relevant facts, EDN retries once using the user’s recent saved messages.

Search memory directly

To look up memory without building a SIP, for example for a search box in your app, use GET /api/v1/retrieval/search:
Response (shortened)
  • Results are ordered by similarity; higher means a closer match.
  • limit defaults to 10. Values above 50 are treated as 50.
  • Search covers general memory only, not project memory, and only records that can be used as context.

Next steps

The SIP

Every response field explained.

Writing memory

Save each turn after the model replies.

Quickstart

The full loop in five minutes.