Graph Memory
AgentRecall builds a Neo4j-powered knowledge graph from your memories, automatically extracting entities and relationships.
How It Works
When you store a memory, the AI processing pipeline extracts:
- Entities — People, places, concepts, objects mentioned in the text
- Relationships — How entities connect to each other (e.g., "works_at", "prefers", "is_allergic_to")
- Properties — Attributes of each entity (e.g., name, type, value)
These are stored as nodes and edges in Neo4j, forming a rich graph structure.
Example Graph
[User] --prefers--> [Dark Mode]
[User] --allergic_to--> [Peanuts]
[User] --works_at--> [Acme Corp]
[Acme Corp] --located_in--> [San Francisco]
[User] --uses--> [Python] --is_a--> [Programming Language]Traversal Queries
Use traverse() to walk the graph and find connections between entities.
Python
# Find all entities connected to a node
connections = memory.traverse(
entity="User",
depth=2,
agent_id="my-agent"
)
for node in connections:
print(f"{node.entity} --{node.relationship}--> {node.target}")Node.js
const connections = await memory.traverse({
entity: "User",
depth: 2,
agentId: "my-agent",
});
connections.forEach(node => {
console.log(`${node.entity} --${node.relationship}--> ${node.target}`);
});Finding Hidden Connections
Graph traversal can discover non-obvious links between concepts. For example:
# "What connects the user to San Francisco?"
paths = memory.traverse(
source="User",
target="San Francisco",
agent_id="my-agent"
)
# Result: User -> works_at -> Acme Corp -> located_in -> San FranciscoGraph via Cloud API
# POST /v1/traverse
curl -X POST https://api.agentrecall.cloud/v1/traverse \
-H "Authorization: Bearer *** \
-H "Content-Type: application/json" \
-d '{
"entity": "User",
"depth": 3,
"agent_id": "my-agent"
}'