Skip to main content

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:

  1. Environment variable KEPTA_URL
  2. ~/.kepta/endpoint.json — the address file KEPTA writes on startup
  3. http://127.0.0.1:3000 as 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.

The server behind it

The client talks to the KEPTA HTTP API on your own machine — start it from the open core (npm run dev), or run KEPTA Enterprise, the desktop app for macOS, Windows and Linux with the knowledge graph, drag & drop import and a chat cockpit (write to me on LinkedIn for a license). German notes work as well as English ones: the search stopword list covers both languages.

License

MIT

Release files for kepta 0.1.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for kepta 0.1.4
File Size Uploaded
kepta-0.1.4.tar.gz 8.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for kepta 0.1.4
File Interpreter ABI Platform
kepta-0.1.4-py3-none-any.whl Python 3 none any Details

Total release size: 15.9 kB

Release files / kepta-0.1.4.tar.gz

Download URL kepta-0.1.4.tar.gz
Size 8.7 kB
Tags Source
SHA-256 checksum
How to use checksums
d4ac332e7d735c4c6684e0960256caa1d80731c457cedeb1e73028d42462ef02
BLAKE2b-256 checksum
How to use checksums
61b18efbd9932154d117ac6c32dc64f61c4fa8c84a9b22e2e98c2c0ce7269750
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 17, 2026.

Transparency log

Release files / kepta-0.1.4-py3-none-any.whl

Download URL kepta-0.1.4-py3-none-any.whl
Size 7.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d97519e8a1c76e833a1521022496886e1fc7c81408b527c9f7de58e5a6e00018
BLAKE2b-256 checksum
How to use checksums
95f8fd81681e63c7226cbbe1e405ba4b7c2bbf49ba106cd14c5af92dc438902a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 17, 2026.

Transparency log

Release history Release notifications | RSS feed

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

This release

0.1.4 This release

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page