memweave is an open-source Python library that gives AI agents persistent memory using plain Markdown files and a local SQLite database, eliminating the need for a vector database. Memories are stored as .md files on disk, indexed into SQLite with hybrid BM25 + semantic vector search via sqlite-vec. Key features include: SHA-256-based embedding caching (only changed chunks hit the API), temporal decay to rank recent memories above stale ones, MMR re-ranking for result diversity, agent namespaces via subdirectories, and full git-diffable auditability. A book club demo illustrates how temporal decay (a single parameter) causes an agent to correctly surface today's file over older semantically similar ones. The entire store is a single file — no server, no Docker, no cloud service required.

18m read timeFrom towardsdatascience.com
Post cover image
Table of contents
The Approach: Markdown + SQLiteWhy Files and SQLite Instead of a Vector DatabaseArchitectureThe Write PathThe Search PathWhy SQLite as the Infrastructure Layer?How memweave Organises Memory: Evergreen Files, Dated Logs, and Agent NamespacesAgent Namespaces (enables Multi-Agent Memory)memweave Search PipelineReal-World Example using memweave — Book Club Decision LogAgent A — No Temporal DecayAgent B — With Temporal Decay ( half_life = 90 days )What This DemonstratesSummaryGet Started

Sort: