remember().
Use raw control.ingest only when you need explicit async ingest behavior, job polling, or bulk payload control. For normal agent memory writes, the helper path is simpler and stays aligned with the current SDK contract.
Recommended write contract
- Keep one stable
session_id/run_idper workflow, claim, ticket, or task. - Use
remember()for facts, traces, lessons, rules, handoffs, feedback, and tool artifacts. - Use raw
control.ingestwhen you need explicit async ingestion lifecycle control. - Stamp
agent_id,intent, and metadata so later diagnose, reflect, and context assembly stay useful.
Helper-first write examples
- Python
- Node / TS
- Rust
add_data_helper.py
When raw ingest is still the right choice
Use rawclient.control.ingest when you need one of these explicitly:
- async job polling through
get_ingest_job - controlled batch writes through
/v2/control/ingestor/v2/control/batch_insert - wire-level debugging of serialized payloads
- compatibility with systems that already generate ingest payload JSON directly
Failure modes and troubleshooting
| Symptom | Root cause | Fix |
|---|---|---|
| Important memory never shows up later | intent or metadata missing | Tag writes with intent, agent_id, and useful metadata |
| Helper writes feel too implicit | You need job-level control | Switch that path to raw control.ingest |
| Cross-task contamination | session_id changes per request | Keep one deterministic task/session mapping |
Next steps
- Read with Retrieve data.
- Use the helper catalog at SDK methods.