Skip to content
v0.1.1 — typed clients for TypeScript, Python, and Go

A practical in-memory databasewith a familiar Redis interface

Keep application state, collections, queues, and live events in RAM. Connect with an existing Redis client, persist snapshots to disk, and add text or vector indexes only where you need ranked retrieval.

$docker run -d -p 7171:7171 ghcr.io/hitesh-s0lanki/klyro:latest
from klyro_db import Klyro

db = Klyro()
db.set("session:42", "active", ex=900)
db.hset("user:42", mapping={"name": "Ari", "plan": "pro"})
db.lpush("jobs", "generate-report")

status = db.get("session:42")
profile = db.hgetall("user:42")
job = db.brpop("jobs", timeout=5)
commands
145commands130 Redis-shaped, 15 MEM.*
data types
6data typesfive classic, one searchable
container image
~15 MBcontainer imagestatic musl on Alpine
dependency
1dependencylibc, for poll()

Features

The building blocks for fast application state

Use familiar data structures, transactions, queues, pub/sub, expiry, and snapshots through one RESP endpoint.

Six native data types
Store simple values, queues, objects, unique members, rankings, and searchable records in one keyspace. Choose the type that matches the data.
Transactions and optimistic locking
Group commands with MULTI and EXEC. Use WATCH when an update depends on the current value, or DISCARD to abandon queued work.
Pub/sub and blocking queues
Publish live events by channel or pattern. Let workers block on lists or sorted sets until new work arrives.
Expiry on keys and records
Expire keys in seconds or milliseconds. Searchable records can have their own TTL without removing the index that contains them.
Snapshots and graceful shutdown
Load a snapshot at startup and save on demand, on a schedule, or during graceful shutdown. Each save replaces the previous file atomically.
Memory limits and eviction
Set a memory ceiling, then choose no eviction or an LRU, LFU, random, or TTL-based policy for selecting keys to remove.
Text and vector indexes when needed
Create SEARCH, VECTOR, or HYBRID indexes alongside ordinary keys. Combine BM25, vector similarity, recency, importance, and metadata filters.
RESP clients and typed packages
Connect with redis-py, ioredis, go-redis, redis-rs, or redis-cli. Klyro also provides typed memory helpers for TypeScript, Python, and Go.

How it works

Start a server and write data immediately

Klyro listens on port 7171 and accepts RESP commands from redis-cli or an existing Redis client. No schema or migration is required.

01

Write application state

Keys need no schema. Store a temporary value as a string, a profile as a hash, or unique members in a set.

klyro
SET session:42 active EX 900
HSET user:42 name Ari plan pro
SADD online-users 42
02

Coordinate workers and events

Use blocking list operations for work queues, pub/sub for live events, and MULTI/EXEC when a group of commands must run together.

klyro
LPUSH jobs generate-report
BRPOP jobs 5
PUBLISH deployments complete
03

Add ranked retrieval where it fits

A memory index is optional. Use it for records that need BM25 keyword search, vector similarity, filters, or a weighted hybrid ranking.

klyro
MEM.QUERY user:123 TEXT "how do they ship?" FVEC 3 0.10 0.79 0.46 \
  TOPK 5 FILTER type EQ shipping FUSION LINEAR WITHSCORES

Why Klyro

One server for state, coordination, and search

Keep frequently accessed data and the operations around it behind one port and one client protocol.

1 keyspace
Keep common state behind one endpoint
Sessions, counters, profiles, queues, sets, leaderboards, and searchable records share one keyspace, one persistence path, and one port.
RESP2 / RESP3
Use familiar Redis commands
Standard commands work through existing Redis clients. TypeScript, Python, and Go also have typed helpers for Klyro's MEM.* command family.
8 eviction policies
Control how RAM is used
Configure a memory ceiling and choose the eviction policy that matches a cache, session store, or durable in-memory workload.
Atomic snapshots
Persist without adding another service
Klyro reloads snapshots at startup and writes them on SAVE, graceful shutdown, or the configured automatic interval.

Comparison

Core data structures, with search when you need it

Use the standard keyspace for application state and coordination. Add a memory index when records need keyword, vector, recency, or importance ranking.

CapabilityCore databaseMemory extension
Data modelStrings and collectionsText, vectors, metadata
Primary commandsGET, HSET, LPUSH, ZADDMEM.ADD, MEM.QUERY
ExpiryPer keyPer index and per record
CoordinationTransactions, queues, pub/subRanked result retrieval
SearchKey scans and collection rangesBM25, vector, hybrid
Client accessAny RESP clientTyped TypeScript, Python, Go, or raw RESP
PersistenceShared snapshotShared snapshot

Packages & imports

Use a typed client in TypeScript, Python, or Go

Standard database commands keep their familiar client API. Typed Klyro helpers encode vectors, build MEM.* commands, and decode their results.

npm install klyro-db@0.1.1
import { createClient } from "klyro-db";

const klyro = createClient();

await klyro.memory.create("user:123", { mode: "HYBRID", dim: 3 });
await klyro.memory.add("user:123", {
  text: "User prefers PostgreSQL for backend projects.",
  vector: [0.12, 0.81, 0.43],
  meta: { type: "preference" },
  importance: 0.85,
});

const hits = await klyro.memory.query("user:123", {
  text: "preferred database?",
  vector: [0.10, 0.79, 0.46],
  topK: 5,
});
pip install klyro-db==0.1.1
from klyro_db import Klyro, MemoryAdd, MemoryCreate, MemoryQuery

klyro = Klyro(host="localhost", port=7171)

klyro.memory.create("user:123", MemoryCreate(mode="HYBRID", dim=3))
klyro.memory.add("user:123", MemoryAdd(
    text="User prefers PostgreSQL for backend projects.",
    vector=[0.12, 0.81, 0.43],
    metadata={"type": "preference"},
    importance=0.85,
))

hits = klyro.memory.query("user:123", MemoryQuery(
    text="preferred database?",
    vector=[0.10, 0.79, 0.46],
    top_k=5,
))
go get github.com/Hitesh-s0lanki/klyro/go
import klyro "github.com/Hitesh-s0lanki/klyro/go"

db := klyro.NewClient(nil)

db.Memory.Create(ctx, "user:123", klyro.CreateOptions{
  Mode: klyro.Hybrid,
  Dim: 3,
})
db.Memory.Add(ctx, "user:123", klyro.AddOptions{
  Text: "User prefers PostgreSQL for backend projects.",
  Vector: []float32{0.12, 0.81, 0.43},
})

hits, err := db.Memory.Query(ctx, "user:123", klyro.QueryOptions{
  Text: "preferred database?",
  Vector: []float32{0.10, 0.79, 0.46},
  SearchOptions: klyro.SearchOptions{TopK: 5},
})

FAQ

Questions people ask first

If something here is still unclear, the documentation goes deeper on every point.

Start with the data structures your application already understands

Run one process, connect on port 7171, and use a familiar Redis client. Add ranked text and vector retrieval when the workload calls for it.