Ingest is the write path. You send conversation messages; the server runs LLM-based extraction to pull out facts (and, when relevant, artifacts and episodes), embeds each one, and stores them in your org’s vector index.Documentation Index
Fetch the complete documentation index at: https://docs.mem.xtrace.ai/llms.txt
Use this file to discover all available pages before exploring further.
The mental model
Ingest is asynchronous by default. Extraction is LLM-bound — typically 3–10 seconds — so the API returns a job immediately and does the work in the background. Your code polls or opts into sync mode.Required fields
Every ingest needs:messages— array of{ role, content }. Empty array → 400.user_id— keys the per-user session namespaceconv_id— anchors every extracted memory to a conversation (for replay, export, bulk retract)
agent_id, app_id, metadata (arbitrary key/value, becomes filterable on search), extract_artifacts: true (opts into the more expensive artifact-extraction stage).
Async ingest (default)
Sync ingest (wait: true)
Useful for demos, one-shot scripts, or any code where you want the result inline:
succeeded or failed). If the budget elapses, you get a pending/running job back and have to poll — same as async mode.
What gets extracted
You pass messages; you don’t pre-decide what’s a fact vs an artifact vs an episode. The server’s extraction pipeline decides:| Type | Triggered when |
|---|---|
| Fact | The default. A semantic claim in a turn (“User likes X”, “User works at Y”). |
| Artifact | The conversation references a structured object — a doc, code snippet, summary — that’s worth storing standalone. Requires extract_artifacts: true on ingest. |
| Episode | A stretch of turns gets summarized into a session-level memory. Server-driven; no client knob. |
result.memories_created array tells you what landed; each entry is a thin reference ({id, type, text}). For the full row, call client.memories.get(id).
What’s in metadata
Anything you put in metadata is stored verbatim on every memory extracted from this ingest, and each key becomes an indexed payload field filterable on search:
tag1–tag5, kb_type, org_id, etc.) are stripped silently.
Failure modes
Extraction can fail for various reasons — upstream LLM hiccup, content that doesn’t yield extractable facts, rate limits. The job lands instatus: "failed" with an error.code and error.message. Retry by submitting the same body again; we don’t auto-retry server-side.
Common failure codes:
| Code | Meaning |
|---|---|
ingest_failed | Generic extraction error; check error.message |
rate_limit_exceeded | Org quota hit; wait and retry |
See also
- Searching memories — query what you just ingested
- API Reference → Memories → Ingest — full request/response schemas