v0.4.0-alpha3SQL-first database with realtime updates

Private, realtime storage for AI agents

Store messages, agent memory, embeddings, and tool logs. USER tables keep every query inside the signed-in user boundary, while `live()` streams current rows to browsers and agents in realtime. Run vector search with SQL, then keep recent data fast and move older history to cheaper storage.

curl -fsSL https://kalamdb.org/install.sh | bash
KalamDB — Sample Code
import { createClient, Auth, SeqId } from 'kalam-link'; const client = createClient({  url: 'http://localhost:8080',  authProvider: async () => Auth.jwt('<ACCESS_TOKEN>'),}); const resumeFrom = SeqId.from('7262216745594062848'); const stopMessages = await client.live(  `SELECT id, room, role, content, created_at    FROM chat.messages`,  (rows) => {    // `chat.messages` can be a USER table.    // The same query runs for every signed-in customer, but KalamDB only    // returns that caller's rows.    renderRows(rows);  },  {    subscriptionOptions: {      last_rows: 200,      from_seq_id: resumeFrom.toJSON(),    },  },); await client.query(  'INSERT INTO chat.messages (room, role, content) VALUES ($1, $2, $3)',  ['main', 'user', 'hello from the browser']);

Core pillars for AI agents and chat apps

Keep each user or tenant in their own data space. Query USER tables directly, stream materialized rows in realtime, use topics for pub/sub, and move old history to object storage when you need to scale.

Live

Per-tenant isolation — no app-side filters

Every user gets a private tenant partition. The same SQL can run for every account, and USER tables still return only that caller's rows. No app-side WHERE user_id = ? glue.

Read more →
Live / Planned

Topics + Pub/Sub streams

Publish events to topics and subscribe from any client or agent. Replay events and use consumer groups when you need them.

Read more →
Live

Live queries with materialized rows

Use live() to stream the current row set for messages, memory, dashboards, and tool logs without writing your own diff reconciler.

Read more →
Live

Bring your own storage

Store old history in S3, Azure Blob, GCS, or local disk. Keep hot data fast and move cold data to cheaper storage.

Read more →
Live

Scales by user + efficient cold storage

Isolation creates natural shards per user. Older history can compact into compressed files in object storage for lower cost and faster scans.

Read more →
Live

High availability clustering (Raft)

Run a Raft cluster with leader election and failover, so chat and subscriptions stay online.

Read more →
Live

Fast and steady performance

Low-latency writes and steady throughput for chat and high-volume agent events. Built in Rust.

Read more →
Planned

End-to-end encryption (client-side)

Encrypt agent memory before it leaves your app. KalamDB stores only encrypted data. The server never sees plaintext. You hold the keys.

Read more →
Live

Admin UI: SQL Studio, Live Data and more

Web Admin UI for instances, users, and streams. Run SQL in SQL Studio, turn on Live query, browse topics, and explore per-user namespaces.

Read more →
Live

CLI tool (kalam)

Postgres-style CLI for local and cloud instances. Connect, query, subscribe, export data, and manage users from one binary.

Read more →

KalamDB Architecture

See how queries run, how data is stored, and how live updates flow.

Familiar SQL for storage, subscriptions, and handoffs

No custom language to learn. Write standard SQL to create tables, save state, and subscribe to live updates. Keep hot data on local disk and store long-term history in object storage.

kalamdb — SQL Console
CREATE TABLE agent.messages (
  id       BIGINT DEFAULT SNOWFLAKE_ID(),
  role     TEXT,
  content  TEXT,
  user_id  TEXT,
  created  TIMESTAMP
) WITH (TYPE='USER');

Live state timeline

Write state, trigger subscriptions, and sync users and agents in realtime.

Agent Writes

An agent writes memory or tool state with SQL.

KalamDB Stores

Recent data stays fast. Older history can move to object storage.

Subscribers Notified

Live updates stream over WebSocket to matching subscribers.

Agents Resume

Apps and agents continue from the latest state.

Each user scope supports files, vectors, tables, and indexes

KalamDB is more than chat messages. Inside each user space, store tables, vectors, and file records so your agents can find what they need fast.

Files

Store file metadata, ownership, and processing status in user tables.

Vectors

Store embeddings in SQL tables and rank similar rows with vector search.

Tables

Model messages, tool calls, checkpoints, and your app data as SQL tables.

Indexes

Add indexes for fast lookups as your agent workload grows.

Built for secure, multi-tenant agent workloads

AI Chat History

Per-user chat threads with materialized live rows, resume checkpoints, and full history replay.

Agent Memory & Tool Events

Store tool calls, checkpoints, and agent state in durable per-tenant tables.

Semantic Retrieval & RAG

Store embeddings alongside documents and files, then find the nearest rows with SQL vector search.

Human-in-the-Loop Workflows

Agents pause for approval, humans respond, and agents resume. Every step is saved in a private per-user history.

Realtime Dashboards

Live metrics, monitoring feeds, and notification streams with row-materialized SQL subscriptions.

Multi-tenant SaaS isolation

Ship one codebase for every customer. USER tables keep each tenant in its own partition, so the same query only returns that tenant's data.

Collaboration Feeds

Shared docs, boards, and multiplayer state with instant sync.

Every tool you need, out of the box

KalamDB includes a web Admin UI and an interactive CLI. Explore data, run SQL, subscribe to live streams, and manage users without extra tools.

🧭

Admin UI — SQL Studio & Live Data

Live

A web admin console that ships with every instance. Browse namespaces, inspect tables, and run SQL in the built-in SQL Studio. Turn on Live query to make anySELECT stream updates as rows change. Explore topics and per-user data without writing app code.

Read more →
⌨️

CLI — Interactive Database Terminal

Live

A Postgres-style terminal for local and cloud instances. Connect, query, subscribe, export user data, and manage users from one binary. It includes history, \info, and tab-completion. Great for scripts and CI.

Read more →

Give every user private data. Let your agents use it.

One SQL-first realtime database for user isolation, agent collaboration, and live subscriptions. Start building in minutes.