
Graphmemory
Build and query embedded GraphRAG databases with DuckDB vector search
What You Can Do
Store entities and relationships in a persistent, embedded graph database. Run vector, full-text, and hybrid semantic searches across your graph structure. Extract entities and relations from unstructured text using DSPy, deduplicate nodes and edges intelligently, run graph algorithms like PageRank and centrality analysis, and visualize your knowledge graph interactively in a browser—all within a single Python package with zero server dependencies.
Features
semantic similarity search over embedded entities and relations
combine vector, full-text (BM25), and structured filters in one query
follow relationships across multiple levels to retrieve connected knowledge
automatically extract entities and relations from raw text with built-in deduplication
merge duplicate nodes by name similarity threshold (e.g., 0.9) without manual conflict resolution
PageRank, centrality measures, connected components via NetworkX integration
chainable API for intuitive graph queries without SQL
render your knowledge graph in the browser with zero dependencies
Example Output
Extract and store a knowledge graph:
Input: "Claude was created by Anthropic in 2022. Anthropic focuses on AI safety research."
Output nodes: [Entity(name="Claude", type="AI Model", created_by="Anthropic"), Entity(name="Anthropic", type="Company", founded=2022)]
Output edges: [Relation(src="Claude", relation="created_by", tgt="Anthropic")]
Semantic search and traversal:
Query: graph.search(query="AI safety company", top_k=5)
Result: [Anthropic (score: 0.94), Claude (score: 0.87), ...]
Multi-hop: graph.traverse(start="Claude", relation="created_by", depth=2)
Result: [Claude → created_by → Anthropic → founded_in → San Francisco]
What's Included
- SKILL.md: Complete API reference and decision table for insert, merge, search, and dedup operations
- Extraction template: DSPy-based prompt for entity and relation extraction from text
- Query builder examples: Copy-paste patterns for vector search, hybrid search, and multi-hop traversal
- Deduplication workflow: Step-by-step guide for fuzzy matching and node/edge merging
- Visualization snippet: HTML/JavaScript template to render your graph in an interactive browser view
Who It's For
- Data engineers and ML engineers building RAG systems that require graph traversal for retrieval
- Knowledge management teams extracting and organizing entities from research papers, documents, or domain-specific text
- Prototyping teams needing a lightweight knowledge graph without managing external databases
- AI researchers experimenting with DSPy-based information extraction pipelines
- Compliance and risk teams building interconnected entity relationship maps from unstructured data
Best For
- Knowledge graph construction and semantic search over entities and relationships
- Retrieval-augmented generation (RAG) where graph structure improves answer quality
- Entity and relation extraction from text with automatic deduplication
- Graph algorithms (PageRank, centrality analysis) on your stored data
- Interactive exploration and visualization of domain knowledge networks







