| Memory types |
fact, preference, episodic, instruction, summary, semantic, goal, procedure, skill, strategy, decision, working, entity, relation, parametric (and index for the layer's own bookkeeping). Each has a typed manager; see memory types. Any other string works too. |
| Scope |
user_id and an optional agent_id. agent_id=None shares a user's memories across agents. session_id records where a memory came from; search never filters by it. Without a session_id, each user gets their own default:<user_id> session, so users never share history. |
| Slot keys |
e.g. profile.location, opinion:hiking. Writing a new value to the same key updates the memory and keeps the old value in metadata["history"]. |
| Resolution |
Similarity compares only against memories without a slot key, so a keyed write never merges into a different slot. Cosine ≥ dedup_threshold (0.9) reinforces the existing memory, and cosine ≥ contradiction_threshold (0.8) with opposite polarity supersedes it. ttl_seconds follows the latest write. |
| Context |
memory.context(query, user_id=...) / memory.recall(...) return up to fifteen sections: instructions, profile, goals and pinned memories (the stable, cacheable part), the session's working memory, relevant facts and episodes, knowledge, graph relations, procedures, skills, lessons, decisions, how these memories connect (links), the session summary and recent turns. budget_tokens= keeps the most important items that fit. str(ctx) is the prompt block. |
| Short-term memory |
record_turn, add_message, get_history, summarize_session (writes one summary memory per session). |
| Ranking |
HybridRanker scores vector similarity, keyword (IDF-weighted term coverage), recency (half-life decay) and importance. Results carry the per-signal breakdown. |
| Events |
memory.subscribe(callback) receives memory.added/updated/deduplicated/dropped/deleted/searched/extracted/managed/pinned/unpinned/consolidated, context.built, session.summarized and history.appended. Stores that support it persist them, which is what the console and /v1/events read. |
| Async |
aadd, asearch, acontext, abuild_context, alearn, arecord_turn, arecall, aconsolidate, amanage, amaintain. |