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

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.

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.

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