Alpha v0.1.0 — Open Source (MIT)

The SQLite for AI agents

Liath is programmable memory for AI agents. Instead of calling a fixed vector-database API, agents write sandboxed Lua programs to query their own memory — custom retrieval, ranking, and filtering. Embedded, zero-infrastructure, Rust core.

$ pip install liath
# cargo add liath
agent_recall.lua
-- The agent writes this Lua. Liath runs it,
-- sandboxed, over its own memory.
local hits = semantic_search("memory", query, 20)

local top = filter(hits, function(m)
  return m.age_days < 7 and m.importance > 0.8
end)

return json.encode(take(sort_by(top, "score"), 5))
returned 5 memories · ranked, filtered, shaped · sandboxed

What is Liath?

Liath is an embedded, programmable memory database for AI agents, with a Rust core. It bundles a key-value store, vector search, and embeddings, and it lets agents query all of it by writing sandboxed Lua programs — no server, no vendor API, no unsafe code execution.

AI Agent writes a Lua program
Lua Sandbox no file / network / system access
Liath Engine KV · vectors · embeddings

Traditional vector DB

The agent can only call a fixed API:

semantic_search("query", 5) → results
  • One retrieval strategy, baked into the API
  • Custom filtering and ranking happens in app code
  • Usually a separate server to run and scale

Liath (programmable memory)

The agent generates a Lua program:

local r = semantic_search("mem", q, 20)
local top = rank_and_filter(r)
return json.encode(top)
  • Any retrieval strategy the agent can express in code
  • Runs in a Lua sandbox: no file, network, or system access
  • Embedded — a single dependency, zero infrastructure

The problems Liath solves

Agent memory is either too rigid, too dangerous, or too heavy. Liath fixes all three.

🧩

Fixed retrieval APIs

The Problem

Vector databases expose one call: semantic_search(query, k). Any custom ranking, recency weighting, or cross-referencing has to be reimplemented in your application for every agent.

Liath's Solution

Agents write Lua that runs inside Liath. They can search, filter by recency and importance, re-rank by a custom score, and shape the result — all in one program the LLM generates on the fly.

🛡️

Running agent code is dangerous

The Problem

Letting an LLM execute arbitrary code to query memory is a security nightmare: file access, network calls, and system commands are all on the table.

Liath's Solution

Liath executes Lua in a strict sandbox with no file, network, or system access. Agents get full programmability without any of the blast radius.

📦

Vector DBs need servers

The Problem

Most memory stores are network services you have to deploy, secure, scale, and pay for — heavy infrastructure for what is often a single agent process.

Liath's Solution

Liath is embedded. It runs in-process as a single dependency with a Rust core. Point it at a data directory; there is no server to operate.

🧠

Fragmented memory stack

The Problem

Agents typically bolt together a KV store, a vector database, an embedding service, and glue code for conversations and tool state.

Liath's Solution

Liath bundles a key-value store (Fjall), vector search (USearch), and embeddings (FastEmbed), plus agent primitives for memory, conversations, and tool state — one dependency.

Agents query memory with code, not a fixed API

The retrieval logic lives where the reasoning is — in a program the agent writes. Liath executes it against its built-in vector search, embeddings, and key-value store, safely inside a Lua sandbox.

Fixed vector-DB API (logic in app code)
# Fixed vector-DB API: one strategy
results = db.query(
    vector=embed("query"),
    top_k=5,
)

# Recency + importance re-ranking
# has to live in your app code:
recent = [r for r in results
          if r.age_days < 7
          and r.importance > 0.8]
recent.sort(key=score)

Strategy is fixed by the API; the rest is glue code.

Liath (agent-written Lua, sandboxed)
-- The agent generates this Lua program.
-- Liath runs it safely in a sandbox.

local results = semantic_search("memories", query, 20)

-- Filter by recency
local recent = filter(results, function(m)
    return m.age_days < 7 and m.importance > 0.8
end)

-- Re-rank by a custom score, return top 5
local scored = map(recent, function(m)
    m.score = m.similarity * m.importance
    return m
end)
return json.encode(top(sort_by(scored, "score"), 5))

One program: search, filter, rank, and shape the result.

Everything an agent needs to remember

Programmable Lua queries, a built-in KV store, vector search, embeddings, and agent primitives — in one embedded Rust engine.

One engine, however you run it

Embed Liath as a library, drive it from a terminal, or expose it over HTTP and MCP. The same Rust core powers every interface.

M16 18 22 12 16 6M8 6 2 12 8 18
Embedded Library Python + Rust
M4 17l6-6-6-6M12 19h8
CLI + TUI Interactive shell
M2 12h20M12 2a15 15 0 0 1 0 20 15 15 0 0 1 0-20M12 2v20
HTTP Server REST over the wire
M12 2v4M12 18v4M2 12h4M18 12h4M5 5l3 3M16 16l3 3M19 5l-3 3M8 16l-3 3
MCP Server For agent frameworks

Batteries included

Liath bundles proven Rust engines behind a single dependency — no services to wire together.

Fjall
Key-value storage engine
Rust
USearch
Vector similarity index
Rust
FastEmbed
Local text embeddings
Rust
mlua
Sandboxed Lua runtime
Rust
1
Dependency
KV, vectors, embeddings & Lua in one crate
0
Servers to run
Embedded, in-process, zero infrastructure
5
Interfaces
Library, CLI, TUI, HTTP, MCP
MIT
Licensed
Open source, no per-query fees

Liath vs a typical vector DB

The short version. See the full head-to-heads for Pinecone, Chroma, Mem0, Redis, and SQLite.

Liath Typical vector DB
Retrieval model Agent-written Lua program Fixed search(query, k) API
Custom ranking & filtering Inside the query, sandboxed In your application code
Deployment Embedded, in-process Managed / self-hosted server
Bundled storage KV + vectors + embeddings Vectors only (usually)
Agent primitives Memory, conversations, tool state Bring your own

Ready to give your agents programmable memory?

Liath is open source (MIT). Install it, store some memories, and let your agents query them with Lua.

Need a database for AI-era applications?

ORMDB is Liath's sibling from the incredlabs data platform — a relational database built for modern app workloads.

Explore ORMDB