Local-first persistent memory for AI coding agents like Claude Code, Cursor and Codex, served over MCP from a SQLite file on your disk.
tinyhumansai/tinycortex
A Rust library for local-first AI agent memory that filters low-value content at ingest and offers configurable retrieval over Markdown-backed storage.
- Stars
- 269
- Forks
- 41
- Open issues
- 30
- Last commit
- 5 days ago
What is it?
TinyCortex is an open-source Rust library that gives AI agents and applications a memory layer. Rather than storing everything and retrieving whatever is similar, it runs a multi-signal admission gate at ingest to drop low-value content, aiming to keep retrieved context focused.
Markdown files serve as the source of truth. SQLite chunk rows, summary trees, vector indexes and a git-backed change ledger (behind the git-diff feature) are derived indexes that can be rebuilt from the canonical content. Each item keeps source provenance and a security taint marking internal versus external-sync origin.
Retrieval provides keyword, vector, graph, summary-tree and freshness-scoring primitives, plus a hybrid-score composer that hosts can configure with their own weight profile. The crate is published on crates.io, and an in-memory reference store is included for quick experiments.
Key features
- 01Admission gate filters low-value content at ingest time.
- 02Markdown files are the canonical store; other indexes can be rebuilt.
- 03Keyword, vector, graph and summary-tree retrieval primitives.
- 04Exponential freshness decay with a 7-day default half-life.
- 05Optional git-backed change tracking via the git-diff feature.
- 06Each item records source provenance and a security taint.
Use cases
- Adding long-term memory to a custom AI agent written in Rust.
- Building a local-first knowledge store that can be inspected as plain Markdown.
- Experimenting with ranking policies that combine recency and semantic relevance.
Quick start
- 1
Add the crate and async dependencies to your Rust project
cargo add tinycortex anyhow - 2
Add tokio with the runtime features used in the example
cargo add tokio --features macros,rt-multi-thread - 3
Store and recall a memory using the in-memory backend in your code
Things to know
- It is a Rust library only, with no standalone application.
- The hosted TinyCortex platform is in closed alpha and not part of this repository.
- Licensed under GPL-3.0, a copyleft license that affects distribution of derived works.
- Benchmark results cited in the README come from a harness not included in the repository.
In collections
Topics
FAQ
- What is tinycortex?
- A Rust library for local-first AI agent memory that filters low-value content at ingest and offers configurable retrieval over Markdown-backed storage. TinyCortex is an open-source Rust library that gives AI agents and applications a memory layer. Rather than storing everything and retrieving whatever is similar, it runs a multi-signal admission gate at ingest to drop low-value content, aiming to keep retrieved context focused.
- Is tinycortex free to use? What license does it have?
- tinycortex is open source under the GPL-3.0 license. Check the license terms before using it in commercial products.
- Is tinycortex still maintained?
- Actively maintained. The last commit to tinycortex was on Nov 2, 2026.
- What can I use tinycortex for?
- Adding long-term memory to a custom AI agent written in Rust. Building a local-first knowledge store that can be inspected as plain Markdown. Experimenting with ranking policies that combine recency and semantic relevance.
- How do I install tinycortex?
- Add the crate and async dependencies to your Rust project: cargo add tinycortex anyhow Add tokio with the runtime features used in the example: cargo add tokio --features macros,rt-multi-thread Store and recall a memory using the in-memory backend in your code
- Where can I get tinycortex?
- The source code and installation instructions are on GitHub: https://github.com/tinyhumansai/tinycortex
Summary generated by AI from the project's README. GitHub stats refresh daily.
Related projects
A Ruby library for building LLM-powered applications, offering a unified interface to many LLM providers, vector databases, RAG pipelines and assistants.
A local-first memory and decision layer for AI agents that stores context as Markdown and JSONL files you own, usable across several IDEs and LLMs.
A local-first personal AI assistant in readable Python, with its own agent loop, SQLite-based memory, and built-in evals.
A team-level memory hub for AI Agents that turns chats, docs, and code into shared, governed memory assets usable across agent frameworks.
A collection of official extensions for the Eino Go framework, adding LLM model, tool, retriever, loader and callback integrations.