
From Flat Files to a Living Memory: Building Graph-Based Semantic Memory for PocketPaw
TL;DR — I upgraded PocketPaw’s memory from a line-based file store to a hybrid semantic memory: (1) vector-backed retrieval for relevance-aware recall, and (2) a small knowledge graph for entity/relationship tracking. The result: the agent remembers semantically, connects concepts across sessions, and surfaces context proactively. Link: https://github.com/pocketpaw/pocketpaw/issues/455 Why change the memory system? PocketPaw's original memory (memory/file_store.py) stores facts as plain text lines. That model is simple and reliable, but it fails at several important agent behaviors: Lexical-only recall: users must repeat keywords to be found. No relationships: facts stay isolated (e.g., "Project X uses React" doesn't connect to "React 19 has breaking changes"). Poor cross-session continuity: facts are hard to prioritize/retrieve semantically across long histories. No decay, timestamps, or metadata to shape relevance over time. These limitations make the agent brittle for longer-term, p
Continue reading on Dev.to
Opens in a new tab


