Graph-powered memory for AI agents.
NER entity extraction + co-occurrence graph + Personalized PageRank.
Multi-hop retrieval in 1.9ms. No API keys needed.
Inspired by SPRIG, built for production.
CPU-only entity extraction via spaCy + domain dictionaries. Supports English & Chinese. Custom dictionaries for finance, crypto, and AI terms. No LLM calls, no API keys.
Personalized PageRank walks the co-occurrence graph to find entities N hops away. Search "BTC" → find "Freqtrade" (2 hops). With explainable path traces.
Fuses vector similarity (ChromaDB + sentence-transformers) with graph PPR scores. 28% higher multi-hop recall than vector-only. Tunable α blend factor.
pip install memgraph-agent
python -m spacy download en_core_web_sm
from memgraph_agent import MemoryGraph
mg = MemoryGraph()
result = mg.build()
# → 102 nodes, 728 edges, 8 communities
# Hybrid search (vector + graph PPR)
results = mg.search("BTC trading strategy")
# Pure graph search (PPR only, ~1.9ms)
results = mg.ppr_search("BTC")
# Add new memories
mg.ingest("CrewAI v0.80 released with async support")
# Interactive HTML visualization (pyvis)
mg.visualize()
# Detect entity communities (Louvain)
communities = mg.communities()
# Export for external tools
mg.export() # → GraphML format
| System | Monthly Cost | Latency | Multi-hop | CPU-only |
|---|---|---|---|---|
| GPT-4 extraction | ~$450 | 2-5s | Prompt-dependent | ✗ |
| Mem0 | ~$200-500 | 1-3s | Limited | ✗ |
| GraphRAG | ~$100-300 | Minutes | ✓ | ✗ |
| memgraph-agent | $0 | <2ms | ✓ PPR | ✓ |