memweave: Zero-Infra AI Agent Memory with Markdown and SQLite — No Vector Database Required

· Source: Towards Data Science · Field: Technology & Digital — Artificial Intelligence & Machine Learning, Software Development & Engineering · Depth: Intermediate, quick

Summary

memweave is an open-source project designed to provide persistent, auditable memory for LLM agents, addressing the limitations of traditional context stuffing and vector databases. It stores memories as Markdown files on disk, indexing them into a local SQLite database for hybrid BM25 + semantic vector search. This approach allows for version control via `git diff`, direct inspection of memory files, and eliminates infrastructure overhead associated with vector stores. memweave's architecture separates storage from search, using Markdown files as the source of truth and the SQLite database as a derived, rebuildable index. It incorporates a deterministic write path with SHA-256 hashing for efficient caching of embeddings and a search path that merges BM25 and vector search results, followed by optional temporal decay and MMR re-ranking to prioritize recent, diverse, and relevant information.

Key takeaway

For AI Engineers building LLM agents that require persistent, auditable, and context-aware memory, memweave offers a lightweight, file-based solution. You should consider integrating memweave to avoid stale context issues and infrastructure overhead, allowing your agents to retain and reason about knowledge over time with full transparency and version control.

Key insights

LLM agent memory can be managed effectively using version-controlled Markdown files and a local SQLite index.

Principles

Method

memweave processes Markdown files into a SQLite index using SHA-256 hashing for caching, then performs hybrid BM25 and vector search, applying optional temporal decay and MMR re-ranking for optimal results.

In practice

Topics

Code references

Best for: AI Engineer, Machine Learning Engineer, AI Architect

Related on AIssential

Open in AIssential →

Editorial summary, takeaway, and curation by AIssential. Original article published by Towards Data Science.