LangGraph Integration
AegisLangGraphMemory gives a LangGraph graph long-term, semantic memory backed by
Aegis Memory. It provides the two primitives every stateful graph needs:
- retrieve relevant memories into state before a node reasons, and
- remember what a node produced after it runs.
dict / TypedDict, the adapter operates on plain
state dicts and imports no langgraph package — it works with any graph shape and adds
no hard dependency.
This is a memory helper, not a checkpointer.
AegisLangGraphMemory does not
implement LangGraph’s BaseCheckpointSaver and does not save or restore graph
execution state / thread history. Use LangGraph’s own checkpointer for execution
persistence; use this adapter for durable, security-scanned semantic memory.Installation
Basic Usage
API
retrieve(query, ...)
Returns a list of memory dicts relevant to
query. Pass agent_id for
cross-agent, scope-aware access control.remember(content, ...)
Stores new memory. Content is security-scanned, embedded and (optionally)
integrity-hashed by the server. Returns the memory ID.
load_into_state(state, query, ...)
Retrieves and writes results into
state[key] (default aegis_memories),
returning the mutated state — ideal as a node’s first line.persist_from_state(state, content_key, ...)
Persists a value already in
state (e.g. a node’s output). No-ops when the
key is missing or empty.Async graphs
For async LangGraph nodes, useAsyncAegisClient directly — it keeps API parity for
add/query/vote/session/feature workflows while staying event-loop friendly:
Runnable example
A complete, server-free example (local mode, no API key) lives atexamples/langgraph_basic.py.
Next Steps
ACE Patterns
Self-improvement patterns for multi-agent memory
Security
How content is scanned before it enters memory