Skip to main content

Python SDK for Kizuna-Mem temporal graph memory engine

Project description

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() and forget_tenant() for right-to-erasure compliance
  • Export/Import -- full data portability in JSON-LD format
  • Async-first -- built on httpx with native async/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

Project details


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)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

kizuna_mem-0.2.0-py3-none-any.whl (7.3 kB view details)

Uploaded Python 3

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

Hashes for kizuna_mem-0.2.0.tar.gz
Algorithm Hash digest
SHA256 ca24c427ae0a04ab4072bcdb26f8e18176f317c1bc861de0d10570f35b30795d
MD5 d376b01758b021c7615d753780a6ae83
BLAKE2b-256 9b2414b5cf8eec463d7e9ff618a1ff02c0b56ff6b5410c1cd613011c1ac148dc

See more details on using hashes here.

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

Hashes for kizuna_mem-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 89cfdaa5a2b7104ab0e85f2447f7d486c4b5e7ef1c82176fea483018730f1abf
MD5 7f518f732745bd1774e9c38d0bd82973
BLAKE2b-256 5efc874f332e7739bac82ae5e510b1b4099d371651d4444b08f10e84fb6fe46e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page