kizuna-mem
Python SDK for Kizuna-Mem -- a temporal graph-based memory engine for AI agents.
Kizuna-Mem replaces stateless per-request context with an evolving knowledge graph that remembers, consolidates, and retrieves relevant context using spreading activation rather than naive vector similarity.
Installation
pip install kizuna-mem
Quick Start
import asyncio
from kizuna_mem import KizunaMem
async def main():
async with KizunaMem(
endpoint="http://localhost:8080",
api_key="your-api-key",
tenant_id=1,
) as mem:
# Observe a conversation turn
episode_id = await mem.observe(
speaker="user",
text="I just moved to Tokyo for the new job at Anthropic.",
)
print(f"Stored episode: {episode_id}")
# Retrieve relevant context for a query
result = await mem.retrieve(
query="Where does the user live?",
top_k=5,
)
if result.context_found:
print(f"Context: {result.assembled_context}")
for node in result.nodes:
print(f" [{node.kind}] {node.text} (score: {node.score:.3f})")
asyncio.run(main())
Features
- Observe conversations and events into a temporal knowledge graph
- Retrieve context using spreading activation (multi-hop graph traversal) or static fusion
- Profiles -- access consolidated user traits and preferences
- Multi-tenant isolation with
with_tenant() - GDPR --
forget_entity()andforget_tenant()for right-to-erasure compliance - Export/Import -- full data portability in JSON-LD format
- Async-first -- built on
httpxwith nativeasync/await
Retrieval Modes
# Default: static fusion (BM25 + vector + temporal)
result = await mem.retrieve(query="billing issues")
# Spreading activation: multi-hop graph traversal
result = await mem.retrieve(
query="billing issues",
retrieval_mode="spreading_activation",
)
Requirements
- Python 3.10+
- A running Kizuna-Mem server
Links
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
kizuna_mem-0.2.0.tar.gz
(15.0 kB
view details)
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 kizuna_mem-0.2.0.tar.gz.
File metadata
- Download URL: kizuna_mem-0.2.0.tar.gz
- Upload date:
- Size: 15.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ca24c427ae0a04ab4072bcdb26f8e18176f317c1bc861de0d10570f35b30795d
|
|
| MD5 |
d376b01758b021c7615d753780a6ae83
|
|
| BLAKE2b-256 |
9b2414b5cf8eec463d7e9ff618a1ff02c0b56ff6b5410c1cd613011c1ac148dc
|
File details
Details for the file kizuna_mem-0.2.0-py3-none-any.whl.
File metadata
- Download URL: kizuna_mem-0.2.0-py3-none-any.whl
- Upload date:
- Size: 7.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
89cfdaa5a2b7104ab0e85f2447f7d486c4b5e7ef1c82176fea483018730f1abf
|
|
| MD5 |
7f518f732745bd1774e9c38d0bd82973
|
|
| BLAKE2b-256 |
5efc874f332e7739bac82ae5e510b1b4099d371651d4444b08f10e84fb6fe46e
|