Skip to main content
AIDiveForge AIDiveForge
Visit Two-tier-memory

Get This Tool

License: MIT Any use incl. commercial
Local-run terms: MIT license permits commercial use, modification, and distribution with attribution.

Share This Tool

Compare This Tool
📋 Embed this tool on your site

Copy this code to embed a compact tool card:

Two-tier-memory

FreeOpen SourceSelf-Hosted

Pricing

Model
Free

Summary

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.

Community Performance Report Card

No community ratings yet. Be the first to rate this tool!

Best For: AI coding agents with growing memory needs, Projects using local SQLite for persistence, Developers wanting simple CLI-based memory

Community Benchmarks Community

No community benchmarks yet. Be the first to share a real-world data point.

  • Queries the SQLite store for only the relevant memory entries rather than loading the full history into context, so the agent's effective memory scales with the size of the database rather than the size of the context window.
  • Entirely local and dependency-light — no API keys, no network calls, no managed service — which means the memory layer cannot go down because a third-party endpoint is unavailable.
  • MIT license with full source in a single Python file, so you can read exactly what happens to your stored data and modify the retrieval logic without waiting on a vendor.
  • CLI-driven interface means you can add or query memories from shell scripts, editor plugins, or agent tool calls without importing a framework.
  • Persistent across sessions by default via SQLite, so a solved problem recorded in one session is available in every subsequent session without any additional configuration.
  • The schema ships with a fixed structure targeting solved coding problems and project decisions. Teams whose memory needs include different record types — hierarchical documentation, multi-entity relationships, or domain-specific metadata — hit the schema ceiling immediately and must fork and migrate, at which point they own all future schema evolution.
  • There is no server, no sync layer, and no multi-agent access model. A team with more than one agent process, or a developer working across multiple machines, gets no shared state — each environment has its own isolated database, and keeping them consistent is a manual problem.
  • At the point where a team needs semantic vector search rather than keyword or structured queries — typical once the memory corpus grows large and queries become fuzzy — this library provides no embedding or vector retrieval path. That is the condition under which teams move to a dedicated vector database or a memory framework like Mem0 instead.

Community Reviews

No reviews yet. Be the first to share your experience.

About

Platforms
Python, SQLite
API Available
No
Self-Hosted
Yes
Last Updated
2026-07-06T08:16:04.261Z

Best For

Who it's for

  • AI coding agents with growing memory needs
  • Projects using local SQLite for persistence
  • Developers wanting simple CLI-based memory

What it does well

  • Storing solved coding problems for later lookup
  • Preventing agents from re-solving known issues
  • Maintaining project decisions across sessions

Discussion Community

No discussion yet. Sign in to start the conversation.

Compare Two-tier-memory

Spotted incorrect or missing data? Join our community of contributors.

Sign Up to Contribute

Community Notes & Tips Community

Be the first to contribute. General notes, observations, gotchas, and tips from people who use this tool day-to-day.

Frequently Asked Questions

Is Two-tier-memory free?
Yes — Two-tier-memory is fully free to use. There is no paid tier.
Is Two-tier-memory open source?
Yes. Two-tier-memory is open source.
Can I self-host Two-tier-memory?
Yes. Two-tier-memory supports self-hosting on your own infrastructure.
What platforms does Two-tier-memory support?
Two-tier-memory is available on: Python, SQLite.

Hours Saved & ROI Stories Community

Be the first to contribute. Concrete time/cost savings, with context. e.g. "Cut my code review backlog from 4h to 45m per week."

Two-tier-memory

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.