Add Context
Three write paths, one pool. Pick by what the input is — not by habit.
add | remember | drop | |
|---|---|---|---|
| Input | a string you want stored as-is | prose to learn facts from | files |
| LLM cost | none | extraction + relation calls | none (Whisper/vision for media only) |
| Result | 1 memory, verbatim | N atomic facts that evolve | chunked, searchable, original downloadable |
| Latency | instant | async (202 + job id) | async for big batches |
add — store verbatim#
mem.add("Deploy checklist: run migrations before code",
collection="ops", importance=0.9, metadata={"source": "runbook"})
await mem.add("Deploy checklist: run migrations before code",
{ collection: "ops", importance: 0.9, metadata: { source: "runbook" } });
curl -s https://longmem.dev/v1/memory/collections/ops/memories \
-H "Authorization: Bearer $LONGMEM_API_KEY" -H "Content-Type: application/json" \
-d '{"text": "Deploy checklist: run migrations before code", "importance": 0.9}'
remember — extract facts#
POST /v1/memory/collections/people/remember
{"content": "Met Dana — she leads data at Acme and prefers async standups."}
→ 202 {"job_id": "…", "status": "queued", "mode": "async"}
GET /v1/memory/extract/job/{job_id}
→ {"state": "done", "facts": 2, "complete": true}
Add ?sync=true to wait and get the extracted facts inline. See
Graph Memory for what extraction does.
Drop — files#
Use the drop zone or the API; audio/video are transcribed, documents parsed, images captioned. See Drop & Direct Upload.
Rule of thumb: documents → drop. Anything a user says that should shape future behaviour →remember. Structured strings you control →add.