Skip to main content

Persistent memory for AI agents — Kronvex Python SDK

Project description

Kronvex Python SDK

Persistent memory for AI agents. Three endpoints, one API key, production-ready.

Installation

pip install kronvex                        # core SDK
pip install "kronvex[langchain]"           # + LangChain integration
pip install "kronvex[crewai]"              # + CrewAI integration
pip install "kronvex[langgraph]"           # + LangGraph integration
pip install "kronvex[all-integrations]"    # all three at once

Quick start

from kronvex import Kronvex

kx = Kronvex("kx_your_api_key")
agent = kx.agent("your-agent-id")

# Store a memory
agent.remember("User prefers concise answers", memory_type="preference")

# Recall relevant memories
memories = agent.recall("what does the user prefer?", top_k=5)
for m in memories:
    print(f"[{m['score']:.2f}] {m['content']}")

# Inject context into your prompt
context = agent.inject_context("How should I respond?")
# → "Relevant memories:\n- User prefers concise answers\n..."

Async support

import asyncio
from kronvex import AsyncKronvex

async def main():
    async with AsyncKronvex("kx_your_api_key") as kx:
        agent = kx.agent("your-agent-id")
        await agent.remember("User is based in Paris", memory_type="semantic")
        memories = await agent.recall("where is the user?")

asyncio.run(main())

Framework integrations

LangChain

pip install "kronvex[langchain]"
from kronvex.integrations.langchain import KronvexMemory
from langchain_openai import ChatOpenAI
from langchain.chains import ConversationChain

memory = KronvexMemory(api_key="kv-your-key", agent_id="your-agent-id")
chain = ConversationChain(llm=ChatOpenAI(), memory=memory)
chain.predict(input="I prefer concise answers.")

CrewAI

pip install "kronvex[crewai]"
import os
os.environ["KRONVEX_API_KEY"] = "kv-your-key"
os.environ["KRONVEX_AGENT_ID"] = "your-agent-id"

from kronvex.integrations.crewai import recall_memory, store_memory, get_context
from crewai import Agent

researcher = Agent(role="Researcher", goal="...", tools=[recall_memory, store_memory])

LangGraph

pip install "kronvex[langgraph]"
from kronvex.integrations.langgraph import make_recall_node, make_store_node

recall_node = make_recall_node("kv-your-key", "your-agent-id")
store_node  = make_store_node("kv-your-key", "your-agent-id")

builder.add_node("recall", recall_node)
builder.add_node("store",  store_node)

API reference

Kronvex(api_key, *, base_url, timeout)

Method Description
.agent(agent_id) Get an Agent handle
.create_agent(name) Create a new agent
.list_agents() List all agents

Agent

Method Description
.remember(content, *, memory_type, session_id, ttl_days, pinned, metadata) Store a memory
.recall(query, *, top_k, memory_type, session_id, threshold) Semantic search
.inject_context(message, *, top_k, session_id) Get prompt-ready context block
.sessions() List session IDs
.memories(*, session_id, memory_type, limit, offset) List stored memories
.delete_memory(memory_id) Delete one memory
.clear() Delete all memories

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

kronvex-0.5.0.tar.gz (9.7 kB view details)

Uploaded Source

Built Distribution

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

kronvex-0.5.0-py3-none-any.whl (14.9 kB view details)

Uploaded Python 3

File details

Details for the file kronvex-0.5.0.tar.gz.

File metadata

  • Download URL: kronvex-0.5.0.tar.gz
  • Upload date:
  • Size: 9.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for kronvex-0.5.0.tar.gz
Algorithm Hash digest
SHA256 7ada038cc0e15423ab0876c9f7cf90943b645ec2888f5cacf830a13143ecef50
MD5 70cd318f7b115f996b171782eed1428f
BLAKE2b-256 546c3c3f9befff4e0665c84025b1d65c715727b6500833a4517e68d0087e54f9

See more details on using hashes here.

File details

Details for the file kronvex-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: kronvex-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 14.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for kronvex-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c45338d96519b3c768f9d5efeff9595ca734583be928ca5437749deeb9b73398
MD5 21ca7dbd16a12ee8ec561d264afc650c
BLAKE2b-256 e2b0c99ce7267e88abf9505587419fe539f01457c363535c6dd7e1a00da34f8d

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