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.1.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.1.0-py3-none-any.whl (7.3 kB view details)

Uploaded Python 3

File details

Details for the file kizuna_mem-0.1.0.tar.gz.

File metadata

  • Download URL: kizuna_mem-0.1.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.1.0.tar.gz
Algorithm Hash digest
SHA256 91cba39ad0cb2d98dd006dc90251cca1763d46433b3f77ca6ce8ee3639e34864
MD5 107e49aadfcac87df17fc040cd1fa8de
BLAKE2b-256 52d9b38417003d01181273cd670ac8d3bc9b5c2023c00cf7472a4772ee888253

See more details on using hashes here.

File details

Details for the file kizuna_mem-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: kizuna_mem-0.1.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.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c7268cfad3dbdf5944be882bd9f506f301d7f841ee472f435c3cfb4f862285a5
MD5 5ff89c1fa96c674c4a545646aedb19ef
BLAKE2b-256 3d2b719bb63f81b84bbaa804602fa3e1c3afe496edd73afca3a5275ac1b02962

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