Deploy¶
From the source repository
The Docker and compose files named here are in the source repository, which is not public. Any image that runs pip install kioko and kioko serve works the same way.
A Dockerfile based on python:3.14-slim, a one-command local stack (compose.yml: service + console +
Postgres/pgvector on http://127.0.0.1:8770, API key kioko-local-test-key) and docker-compose.stores.yml
(Postgres + pgvector, Qdrant and the service) are included.
docker build -t kioko . # SQLite / Qdrant
docker build -t kioko --build-arg KIOKO_EXTRAS=pgvector . # + Postgres/pgvector (psycopg)
docker run -p 8765:8765 -v kioko-data:/data -e KIOKO_API_KEY=... kioko \
kioko serve --host 0.0.0.0 --db /data/memory.db --intelligence
export KIOKO_PG_PASSWORD=... KIOKO_API_KEY=...
docker compose -f docker-compose.stores.yml up -d # Postgres + pgvector, Qdrant, the service
Production notes¶
- Embeddings. The default
HashingEmbedderis lexical: it matches words, word pairs and character trigrams, not meaning, so "car" and "automobile" don't match. UseOpenAIEmbedder,AzureOpenAIEmbedder,AgnoEmbedderorFunctionEmbedderfor semantic recall. After you change embedders, runmemory.reembed()once. TuneHybridRanker(min_vector_only=...)to your embedder's cosine range. - Extraction and management. The offline rules and intelligence cover common English phrasings: identity,
location, work, likes and dislikes, instructions, goals and progress, decisions and changes, procedures,
lessons, dated events, "remember ..." and "forget ...". For open-ended conversations and other languages,
give the intelligence a model (
kioko.intelligent(llm=...)); the rules stay as gate and fallback. - Scale. Without
vector_search, search scores every memory in the user's scope: about 5–30 ms for a few hundred memories, ~150 ms for 1,000. Past that, use the pgvector or Qdrant store. The service is a threaded standard-library server, which is enough for an internal agent fleet. For heavy traffic, run several instances behind a load balancer on Postgres, and lowercontext_cache_ttl. - Secrets and PII.
DropSecretsis on by default (passwords, API keys, tokens, private keys, card numbers). AddRedactPIIto mask e-mails and phone numbers. Processors run on every write and every update, through any channel (Python, REST, MCP, tools, console). - Languages. Storage, tokenization, the offline embedder and search work in any script, and tool and MCP
output keeps non-ASCII text readable. The rule-based extraction only understands English, so use a model
(
LLMExtractor, or the intelligence withllm=) for other languages. - Python 3.14 annotations. Annotations are evaluated lazily in 3.14 (PEP 649), so an agent function may
annotate with a class defined later in the module.
attach()/with_memorynever force that evaluation: they read signatures withannotationlib.Format.FORWARDREFand copy the lazy__annotate__function. - Concurrency. SQLite runs in WAL mode with one serialized connection per process. That's fine for a service plus the console. For many writers, use Postgres + pgvector.