TOOL WIKI · MEMORY & STATE
FalkorDB
Provides a graph storage and query layer for connected data.
Jump to a section 10 sections
EXAMPLE USE CASE
Read a preference from a tenant-qualified graph node
A returning user’s preference or an unfinished run needs an explicit owner, storage lifetime and recall rule.
- Input
- A scratch graph, tenant a, user u1 and format=bullets.
- Expected output
- The stored preference from a scoped read query.
- Success check: The stored preference can be recalled for the intended user. Inspect the record and its source rather than only the generated answer.
- Try a failure: Reuse the user ID under a different tenant and ensure it does not match this node.
Example scope: Actual graph write/read; extraction, history and retention are application policies.
Separate working conversation state from candidate long-term facts.
candidateTo 02 · Write policyRetain only permitted information and preserve where it came from.
retainTo 03 · FalkorDBBuilding relationship-based context or a graph-backed memory service. Validate the graph model and the operations required by your memory framework.
recordsTo 05 · Context builderUse verified tenant and subject identifiers when retrieving memory.
Choose useful records within the current context budget.
contextBack to 01 · InteractionApply corrections and deletion to records, derived indexes, and caches.
maintainBack to 03 · FalkorDB
Building relationship-based context or a graph-backed memory service. Validate the graph model and the operations required by your memory framework.
When to consider it
- Building relationship-based context or a graph-backed memory service.
A design decision to make
- Validate the graph model and the operations required by your memory framework.
Prerequisites and setup
- Docker and a separate scratch graph. The demo port differs from the Redis example.
docker run --name asg-falkor -d -p 127.0.0.1:6381:6379 falkordb/falkordb
python3 -m venv .venv
source .venv/bin/activate
pip install FalkorDBTry a small integration
memory.py
from falkordb import FalkorDB
graph = FalkorDB(host="localhost",port=6381).select_graph("asg_demo")
graph.query("MERGE (u:User {tenant:$tenant,id:$id}) SET u.format=$format",
params={"tenant":"a","id":"u1","format":"bullets"})
result = graph.ro_query("MATCH (u:User {tenant:$tenant,id:$id}) RETURN u.format",
params={"tenant":"a","id":"u1"})
print(result.result_set)Run and check the result
python memory.py- The stored preference can be recalled for the intended user. Inspect the record and its source rather than only the generated answer.
- A different user must not inherit this preference.
Common failures
- Extraction acceptance does not establish immediate query visibility; inspect job/index state when results are empty.
- Do not silently copy memory across users after a failed lookup.
Production decisions
- Define allowed memory types, evidence/provenance, correction, expiry and user deletion before accepting automatic writes.
- Derive user and tenant scope from authenticated application state. Test cross-user recall, expired facts and deletion from every derived index.
- Separate graph namespaces or enforce resource filters consistently; a graph name supplied by the model is not an authorization decision.
Keep exploring
Explore the same layer
Compare candidates on your own workload. This entry describes a product’s role; it is not a claim that products in the category are interchangeable.