incredlabs
AI memory / Database

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
RustPythonLua

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

How Liath works

1

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.

2

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.

3

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

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