X2f X2f
backend · 13 signals · 1 source
Evidence
I Replaced My AI Agent's Flat Fact Store with a Graph Database — # I Replaced My AI Agent's Flat Fact Store with a Graph Database and It Runs in 85MB<p>I've been building LocalClaw, a local-model-first AI agent framework running on personal hardware through Ollama. No cloud, no API costs. A few weeks ago I posted about the router/specialist architecture. A lot of people asked about the memory system so here's that.<p>## The Problem<p>Started with a JSONL fact store and embedding similarity retrieval. Simple enough until it wasn't. After a few weeks of real use I had 14 near-duplicate facts about the same topics from different sessions. Layered dedup on top of dedup and it still wasn't clean.<p>The bigger problem was relationships. "Peter works at DevMesh" and "DevMesh is building an outreach platform" were two separate embeddings. You could retrieve each one but you couldn't traverse from one to the other. No multi-hop. No fact evolution. Old facts and new facts coexisted with no signal about which was current.<p>Four iterations on the flat store later I accepted I was patching the wrong thing.<p>## Why FalkorDB<p>Looked at Neo4j (Community Edition is intentionally crippled), Memgraph (no native vector search), and FalkorDB.<p>FalkorDB runs in Docker, uses the Redis wire protocol, has native HNSW vector search, and the entire thing sits at 85MB at my current scale. Graph traversal, vector similarity, and hybrid keyword search in one container. No separate Qdrant, no sync issues between two stores.<p>## What the Graph Enables<p>Every fact connects to the entities it references via ABOUT edges. Multi-hop traversal becomes natural - find everything connected to a project, find all entities mentioned alongside a technology.<p>When a fact changes, the new fact gets a SUPERSEDES edge to the old one. Both persist with timestamps. Temporal queries now work. "What did the system know about this last month?" is a real query.<p>The vector index runs inside FalkorDB on 4096-dimensional embeddings from qwen3-embedding:8b. O(log n) HNSW search. No external database.<p>## The Part That Surprised Me<p>Entity extraction by a small local model is unreliable blind. phi4-mini classified DGX Spark as software and created separate nodes for singular and plural forms of the same entity.<p>Fix: before extracting entities from a new fact, query existing typed entities from the graph and inject them into the NER prompt as reference context. Now phi4-mini sees "DGX Spark → hardware, FalkorDB → software" before it classifies anything new. Each correctly typed entity makes future extractions more consistent. The graph teaches the model over time without any additional training.<p>## Scoring<p>Pure vector similarity surfaces whatever is semantically closest regardless of whether it matters. The scoring formula:<p>``` score = similarity × 0.5 + recency × 0.2 + importance × 0.3 ```<p>Importance uses a 1-5 tier (critical health/family = 5, job/identity = 4, preference = 3, context = 2, ephemeral = 1). A moderately relevant but critical fact scores higher than a highly relevant but ephemeral one. Your wife's health condition surfaces above yesterday's weather.<p>## What I Learned<p>The model computes nothing. Code handles which facts changed, which are duplicates, what the scores are. The model handles what it means. The moment you let a model do arithmetic or hash-based dedup you get failures you can't explain.<p>Importance tiers need concrete examples in the extraction prompt. phi4:14b defaulted everything to tier 2 until I added few-shot examples with emotional weight. Abstract instructions don't calibrate a model.<p>The graph beats flat storage the moment you need relationship reasoning. SUPERSEDES chain alone justified the migration.<p>Runs entirely on a Mac Mini. 85MB for the graph. Everything local.<p>GitHub: https://github.com/PeterGreenAppliedAI/LocalClaw
Show HN: Graphiti – LLM-Powered Temporal Knowledge Graphs — Hey HN! We're Paul, Preston, and Daniel from Zep. We've just open-sourced Graphiti, a Python library for building temporal Knowledge Graphs using LLMs.<p>Graphiti helps you create and query graphs that evolve over time. Knowledge Graphs have been explored extensively for information retrieval. What makes Graphiti unique is its ability to build a knowledge graph while handling changing relationships and maintaining historical context.<p>At Zep, we build a memory layer for LLM applications. Developers use Zep to recall relevant user information from past conversations without including the entire chat history in a prompt. Accurate context is crucial for LLM applications. If an AI agent doesn't remember that you've changed jobs or confuses the chronology of events, its responses can be jarring or irrelevant, or worse, inaccurate.<p>Before Graphiti, our approach to storing and retrieving user “memory” was, in effect, a specialized RAG pipeline. An LLM extracted “facts” from a user’s chat history. Semantic search, reranking, and other techniques then surfaced facts relevant to the current conversation back to a developer for inclusion in their prompt.<p>We attempted to reconcile how new information may change our understanding of existing facts:<p>Fact: “Kendra loves Adidas shoes”<p>User message: “I’m so angry! My favorite Adidas shoes fell apart! Puma’s are my new favorite shoes!”<p>Facts:<p>- “Kendra used to love Adidas shoes but now prefers Puma.”<p>- “Kendra’s Adidas shoes fell apart.”<p>Unfortunately, this approach became problematic. Reconciling facts from increasingly complex conversations challenged even frontier LLMs such as gpt-4o. We saw incomplete facts, poor recall, and hallucinations. Our RAG search also failed at times to capture the nuanced relationships between facts, leading to irrelevant or contradictory information being retrieved.<p>We tried fixing these issues with prompt optimization but saw diminishing returns on effort. We realized that a graph would help model a user’s complex world, potentially addressing these challenges.<p>We were intrigued by Microsoft’s GraphRAG, which expanded on RAG text chunking with a graph to better model a document corpus. However, it didn't solve our core problem: GraphRAG is designed for static documents and doesn't natively handle temporality.<p>So, we built Graphiti, which is designed from the ground up to handle constantly changing information, hybrid semantic and graph search, and scale:<p>- Temporal Awareness: Tracks changes in facts and relationships over time. Graph edges include temporal metadata to record relationship lifecycles.<p>- Episodic Processing: Ingests data as discrete episodes, maintaining data provenance and enabling incremental processing.<p>- Hybrid Search: Semantic and BM25 full-text search, with the ability to rerank results by distance from a central node.<p>- Scalable: Designed for large datasets, parallelizing LLM calls for batch processing while preserving event chronology.<p>- Varied Sources: Ingests both unstructured text and structured data.<p>Graphiti has significantly improved our ability to maintain accurate user context. It does a far better job of fact reconciliation over long, complex conversations. Node distance reranking, which places a user at the center of the graph, has also been a valuable tool. Quantitative data evaluation results may be a future ShowHN.<p>Work is ongoing, including:<p>1. Improving support for faster and cheaper small language models.<p>2. Exploring fine-tuning to improve accuracy and reduce latency.<p>3. Adding new querying capabilities, including search over neighborhood (sub-graph) summaries.<p>## Getting Started<p>Graphiti is open source and available on GitHub: <a href="https://github.com/getzep/graphiti">https://github.com/getzep/graphiti</a>.<p>We'd love to hear your thoughts. Please also consider contributing!
Show HN: Capsule – Single-file web apps that save their data into SQLite — Hey HN,<p>I always had the problem that building HTML pages is really simple now, but trying to save data required hosting it somewhere, and sharing it afterwards was not easy. Over the last few months, I've been building an app called Capsule (it’s also the file extension name) written in Rust with Tauri 2.0 that allows packing an HTML app and its data into a single SQLite file.<p>The HTML file and any related assets are directly embedded in the database. User data can either be saved as a localStorage key/value store or via a MongoDB-inspired collections API as documents, saved in a table in the file. You can also save other assets, like PDF files or images, directly in the database to keep different documents together. All data can be easily exported to CSV or JSON if needed.<p>Privacy and security were a big priority for me, so documents cannot do anything out of the box. They don’t have direct access to the file system and they require permission to access the internet. The permission model is still something I’m working to improve. Capsule documents can also use local or remote AI models for document specific AI features.<p>One downside with this approach is that multiple people working on it will create different copies. To make it possible to merge different copies of the same file, each data entry has a unique UUID and timestamp.<p>I’m planning to open up the file format specification for the 1.0 version of the app so other apps can read or write Capsule files.<p>You can try it out in the web preview at <a href="https://withcapsule.app/preview" rel="nofollow">https://withcapsule.app/preview</a> with pre-built templates or use any AI provider of your choice to create a custom, Capsule-optimized app by using the following prompt:<p>"Please read the app wizard instructions at <a href="https://withcapsule.app/prompt.txt" rel="nofollow">https://withcapsule.app/prompt.txt</a> and help me design an app.“<p>I’m still working on the file format but there are migrations for each new version, so data should never be lost when using newer versions of the app in the future. Please let me know if you have any ideas or use cases where this might make sense or does not work.
🔒 10 more evidence quotes with Pro
See every signal, who said it, and where — across all sources.
Unlock with Pro