Cadenya
Paid
Developers building agentic workflows
AI coding agents that rely on loading markdown files into context work fine on small projects — past a hundred files, the context window silently truncates and the agent re-solves problems it already solved last week. two-tier-memory is a SQLite-backed, CLI-driven memory library that stores solved problems, decisions, and known issues in a queryable structure so your agent retrieves only what it needs, not everything at once.
The library implements what the repo calls the 'two-tier fix': structured storage in a local SQLite database, with semantic or keyword queries pulling back only the relevant rows instead of the entire memory corpus. The core workflow is a single Python file and a SQL schema — add a memory, query a memory, done. It runs entirely on-device with no external API calls. The wall you hit is expressiveness: the schema is fixed, so teams with complex memory taxonomies end up forking the schema or layering their own abstraction on top. At that point you are maintaining a fork.
Bottom line: Exactly right for a solo developer or small team whose agent keeps forgetting solved problems across sessions — not the right foundation when your memory schema needs to evolve with your domain, because the fixed schema means every structural change is a migration you own.
Find your fit
More options in Agent Frameworks. Compare pricing, platforms, and features side by side.
Paid
Developers building agentic workflows
Free · Open source
Long-term continuity in multi-session coding projects
Your AI coding agent’s memory is broken the moment the project outgrows a handful of markdown files: the whole pile gets stuffed into context, the window fills, and the oldest decisions fall off the edge silently. two-tier-memory addresses this by replacing the flat-file stack with a local SQLite database and a queried retrieval layer. You record a solved problem or a project decision through the CLI or by calling the Python module directly; when the agent needs to check whether a problem is already solved, it queries the database and gets back only the matching rows — not the full history.
The differentiating design choice is explicitly architectural: the repo frames the approach as applying 1970s relational database principles to a problem that most agent setups still solve with grep-and-load. Indexing and structured storage mean retrieval time stays flat as the memory grows, rather than degrading as the context window fills. The companion essay referenced in the README makes the case that this is not a new idea, just one that the AI tooling ecosystem has been slow to apply to agent memory.
This fits narrowest and best when you need a drop-in persistence layer for a local coding agent, want zero external dependencies, and are comfortable with SQLite as your operational database. It breaks when your memory needs don’t fit the provided schema — project decisions and solved coding problems are the intended record types, and teams storing anything structurally different, such as hierarchical knowledge or multi-entity relationships, will find the fixed schema a constraint that requires forking. Any team that needs hosted, multi-user, or multi-agent shared memory will need a different architecture entirely, since the library is local-first with no server component.
The implementation is a single Python file alongside a SQL schema file and an MIT license. There is no package published to PyPI per the scraped page; setup is via direct repository clone. The CLI usage and schema are documented in the README. No external API is required at any point.
Sign in to rate this tool or suggest an edit.