Liath
The SQLite for AI agents
What is Liath? Liath is an embedded, open-source memory store for AI agents — the SQLite for AI agents — where the agent writes sandboxed Lua to query its own memory instead of calling a fixed vector-search API.
pip install liath Liath is an embedded, programmable memory store for AI agents — the SQLite for AI agents. Agents write sandboxed Lua programs to query their own memory with custom retrieval, ranking, and filtering, instead of calling a fixed vector-DB API. It ships a KV store, vector search, and embeddings with zero infrastructure. Available as a Python package (pip install liath) and a Rust crate (liath-rs).
Highlights
- Agents write Lua to query their own memory
- Sandboxed execution — no file, network, or system access
- Embedded and zero-infrastructure — no server to run
- Rust core: fast, portable, single dependency
- Built-in KV store, vector search, and embeddings
- Python (pip install liath) and Rust (liath-rs) editions
How Liath works
Most agent-memory systems expose a single fixed call like search(query, k): one similarity lookup, a fixed number of results, ranked one way. Real tasks need more — filter to the last 7 days, re-rank by recency, keep only what an agent marked important, cross-reference entities against earlier turns. A fixed API forces that logic up into the application, round-tripping data back and forth.
Liath inverts that. The agent (usually the LLM) writes a short Lua program that calls primitives like semantic_search, then filters, ranks, and combines results however the task demands. Liath executes the program and returns the answer — custom retrieval expressed as code the model can adapt on the fly.
Running model-generated code is only safe because Liath executes Lua in a hard sandbox with no file, network, or system access. Everything is embedded — a KV store, vector search, and embeddings in a single dependency with a Rust core — so there is no server to run and no infrastructure to manage. Install it as a Python package (pip install liath) or a Rust crate (liath-rs).
Example
-- The agent writes Lua to query its own memory
local hits = semantic_search("mem", query, 20)
local recent = filter(hits, function(r)
return r.age_days < 7 and r.importance > 0.8
end)
return json.encode(top(recent, 5)) When to use Liath
- Long-running or autonomous agents that need retrieval logic more expressive than a single vector-search call
- Memory that filters by recency, importance, or metadata and re-ranks results before returning them
- Local-first and edge agents that cannot depend on a hosted vector database or extra infrastructure
- Embedding agent memory directly into a Python or Rust application as a single dependency
Who it's for: AI engineers and agent builders who have outgrown a one-line semantic_search() call and want programmable, sandboxed memory they can embed without standing up a vector-database service.
Liath vs. a hosted vector database
A vector database gives you a fixed similarity-search API and a service to operate. Liath gives the agent a real programming language — sandboxed Lua — to express custom retrieval, ranking, and filtering, and runs embedded with zero infrastructure. Use a vector DB when you need a shared, horizontally scaled index; reach for Liath when you want per-agent, programmable memory with a hard security boundary and no server.
Liath FAQ
- What is Liath?
- Liath is an embedded, open-source memory store for AI agents — the SQLite for AI agents — where the agent writes sandboxed Lua to query its own memory instead of calling a fixed vector-search API.
- Who is Liath for?
- AI engineers and agent builders who have outgrown a one-line semantic_search() call and want programmable, sandboxed memory they can embed without standing up a vector-database service.
- Is Liath open source?
- Yes. Liath is open source under the MIT License and developed in the open at https://github.com/incredlabs/liath. There is no license fee.
- How do I install Liath?
- Install Liath with `pip install liath`. Full setup instructions live in the documentation at https://docs.incredlabs.com/liath.
More from the incredlabs data platform
- ORMDB — The database that speaks ORM natively
- Read the incredlabs FAQ — licensing, languages, and how the products fit together