kepta
Python client for KEPTA — local memory for AI agents.
Your agents forget you after every conversation. KEPTA fixes that — with a SQLite file on your own machine. No account, no cloud, no telemetry.
This package is the client, not the app. KEPTA runs as a desktop application on the same device; here you connect to it.
pip install kepta
In thirty seconds
from kepta import KeptaClient
kepta = KeptaClient() # finds the running instance on its own
kepta.save("Carbonara", "Guanciale, pecorino, egg yolk. No cream.", tags=["cooking"])
for hit in kepta.search("carbonara without cream"):
print(f"{hit.score:.2f} {hit.memory.title}")
How search works
Three tracks, fused by Reciprocal Rank Fusion: full text (BM25), vectors and the knowledge graph.
Full text and graph work immediately. The vector track also finds what is worded differently from the question — for that it needs a local embedding model:
ollama pull nomic-embed-text
Only then does search("what do I cook with pasta") find the carbonara recipe, which does not contain the word pasta at all. Without the model, hit.vector_score stays at 0.0 and search remains lexical — not an error, just fewer hits on paraphrased questions. How to tell:
kepta.health()["embeddings"] # {'total': 128, 'embedded': 128, ...} — or zeros everywhere
Why this is interesting
The same memory as your agents. Claude Desktop and Cursor talk to the same database over MCP. What your Python script writes, Claude knows in its next answer.
Memories age. Each one has a type, a validity window and a confidence score. When someone moves house, the new address supersedes the old one — the old one stays as history and drops in the ranking. Contradictions do not pile up.
old = kepta.save("Home", "Alex lives in Hamburg.")
kepta.update(old.id, valid_to=1788400000000) # expired from this point on
kepta.save("Home, current", "Alex now lives in Leipzig.")
m = kepta.list()[0]
m.is_expired, m.is_superseded # state right on the object
No dependencies. Standard library only. A memory that promises privacy should not pull foreign code into your process.
Finding the connection
KeptaClient() looks in this order:
- Environment variable
KEPTA_URL ~/.kepta/endpoint.json— the address file KEPTA writes on startuphttp://127.0.0.1:3000as a fallback for development mode
Step 2 is the important one: the packaged app picks a random port. Being explicit works too, of course:
kepta = KeptaClient("http://127.0.0.1:52341")
If nothing is running you do not get a cryptic network error but a sentence that says what to do:
if not kepta.is_alive():
print("KEPTA is not running — start the app or set KEPTA_URL.")
What the client can do
| Method | Purpose |
|---|---|
health() · is_alive() |
Status, version, node count |
list(trash=False) |
All memories, or the trash |
search(query, top_k, tags, type, scope) |
Hybrid retrieval with temporal weighting |
save(title, content, …) |
Create — type, tags, confidence, validity |
update(id, **fields) |
Change; use valid_to= rather than validTo= |
delete(id, permanent=False) |
Trash, or permanently if you insist |
restore(id) |
Bring it back from the trash |
graph() |
Entities and relations |
Memory and SearchHit are frozen dataclasses with type annotations. Alongside the overall score, SearchHit exposes the individual tracks as vector_score and lexical_score.
Installing KEPTA
The app is available for macOS, Windows and Linux under Releases — Intel and ARM in each case. MIT licensed, free.
Note: the documentation is English, but the desktop UI is currently German only. This client, the HTTP API and MCP are language-neutral.
License
MIT
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file kepta-0.1.2.tar.gz.
File metadata
- Download URL: kepta-0.1.2.tar.gz
- Upload date:
- Size: 8.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0afa47bd549e2adcbba554672177fd07cb66da14d787be10712e0ccb72bc9d80
|
|
| MD5 |
745bb035410359c8b0b2b2949321ba05
|
|
| BLAKE2b-256 |
607ca8859fd270c92d68e7786d5c5328fd100faa184e0328b1851bb3a108ce5e
|
Provenance
The following attestation bundles were made for kepta-0.1.2.tar.gz:
Publisher:
pypi.yml on DamianTodorovic/kepta
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
kepta-0.1.2.tar.gz -
Subject digest:
0afa47bd549e2adcbba554672177fd07cb66da14d787be10712e0ccb72bc9d80 - Sigstore transparency entry: 2699478407
- Sigstore integration time:
-
Permalink:
DamianTodorovic/kepta@19aaf6da059a7f7645c4a409ba441dbd130c65a7 -
Branch / Tag:
refs/tags/py-v0.1.2 - Owner: https://github.com/DamianTodorovic
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yml@19aaf6da059a7f7645c4a409ba441dbd130c65a7 -
Trigger Event:
push
-
Statement type:
File details
Details for the file kepta-0.1.2-py3-none-any.whl.
File metadata
- Download URL: kepta-0.1.2-py3-none-any.whl
- Upload date:
- Size: 7.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0793c444903bfc6edd874c76d915061481ac6e24d2c922c599b41a7e974d0436
|
|
| MD5 |
0afe86fdfa02c91a122d460182282a0a
|
|
| BLAKE2b-256 |
b1cc4d14c28aa4a2dc25a4f9c93e911dbb4a242295408228cf41cf368a18db70
|
Provenance
The following attestation bundles were made for kepta-0.1.2-py3-none-any.whl:
Publisher:
pypi.yml on DamianTodorovic/kepta
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
kepta-0.1.2-py3-none-any.whl -
Subject digest:
0793c444903bfc6edd874c76d915061481ac6e24d2c922c599b41a7e974d0436 - Sigstore transparency entry: 2699478668
- Sigstore integration time:
-
Permalink:
DamianTodorovic/kepta@19aaf6da059a7f7645c4a409ba441dbd130c65a7 -
Branch / Tag:
refs/tags/py-v0.1.2 - Owner: https://github.com/DamianTodorovic
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yml@19aaf6da059a7f7645c4a409ba441dbd130c65a7 -
Trigger Event:
push
-
Statement type: