Skip to main content

kognite

Python SDK for Kognite — long-term memory for AI agents. Hybrid semantic + full-text search, LLM memory formation, and a knowledge graph, behind one API key. Zero dependencies (stdlib only), Python 3.9+.

pip install kognite

Quickstart

from kognite import Kognite

k = Kognite(api_key="kgn_...")

# Store a memory
k.memories.add("User prefers dark mode", kind="preference")

# Hybrid search (semantic + full-text, RRF-fused)
hits = k.memories.search("ui preferences", limit=5)["results"]

# Highest precision (cross-encoder rerank — slower):
k.memories.search("ui preferences", rerank=True)

Memory formation (the good stuff)

ingest runs the pipeline behind Kognite's published LoCoMo results: it stores raw messages as episodes and extracts atomic facts — pronouns resolved to names, relative dates converted to absolute ones. Prefer it over add for any multi-message context:

k.memories.ingest([
    {"speaker": "user", "timestamp": "2026-07-15", "content": "I moved to Berlin last month."},
    {"speaker": "assistant", "content": "Noted — how are you finding it?"},
])
# → {"raw": 2, "extracted": 1, "stored": 3}

Context assembly

A token-budgeted bundle of relevant memories, ready to drop into a prompt:

ctx = k.context.assemble("user's living situation", token_budget=2000)

Everything else

k.memories.get(memory_id)
k.memories.forget(memory_id)      # soft-delete (+ graph cascade)
k.memories.list(limit=50)         # newest-first paging
k.graph.query("Berlin")           # knowledge-graph search
k.health()

Errors raise KogniteError with .status (HTTP) and .code (validation_failed, quota_exceeded, not_found, …). Retries with exponential backoff on 429/5xx/network errors are built in.

The tenant scope is derived server-side from your API key — the SDK has no scope parameter and cannot reach another tenant. Get a key in the dashboard, and see the live, judge-audited benchmarks.

Self-hosted? Pass base_url= to the constructor.

Development

smoke_live.py is a full live-API exercise of every method (safe: runs in the key's own scope and forgets everything it creates):

KOGNITE_API_KEY=kgn_... python smoke_live.py

Metadata

Release files for kognite 0.1.0

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

Source distribution (sdist)

Source distribution for kognite 0.1.0
File Size Uploaded Provenance Actions
kognite-0.1.0.tar.gz 5.8 kB Without provenance Details for kognite-0.1.0.tar.gz

Built distribution (wheel)

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

Total release size: 12.2 kB

Release files / kognite-0.1.0.tar.gz

Download URL kognite-0.1.0.tar.gz
Size 5.8 kB
Tags Source
SHA-256 checksum
How to use checksums
9268f980b85acc716e3bb28ba3beb4dfcfa58d8966b647095a75ed7543dde83a
BLAKE2b-256 checksum
How to use checksums
5abb8df19cb5226953f3e71e08800cdc112419b12f854bc45ef8df4c27e172d3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.7

Release files / kognite-0.1.0-py3-none-any.whl

Download URL kognite-0.1.0-py3-none-any.whl
Size 6.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
587488dd3a8759ed0b31944986eee0f142679e280b12e418fd53a4ae737fb552
BLAKE2b-256 checksum
How to use checksums
9672d397403f4b06e7b132a9f63bd0e206996339365e59ec40d9464b6d26dbec
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.7

Security for kognite 0.1.0

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

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