Skip to main content

Official Python Client for Condensate Memory System

Project description

Condensate Python SDK

Official Python client for Condensate — the open-source Agent Memory System.

PyPI License

Installation

pip install condensate

Requires Python 3.9+.

Quick Start

from condensate import CondensateClient

client = CondensateClient(
    base_url="http://localhost:8000",
    api_key="sk-your-api-key"
)

# Store a memory
client.store_memory(
    content="The team decided to use PostgreSQL for the primary store.",
    type="episodic",
    metadata={"source": "meeting", "project": "infra-v2"}
)

# Retrieve relevant memories
result = client.retrieve("What database did we choose?")
print(result["answer"])
print(result["sources"])   # list of episodic item IDs
print(result["strategy"])  # "recall" | "research" | "meta"

Configuration

Environment Variables

Set these before initialising the client, or pass them directly:

Variable Description Default
CONDENSATE_URL Base URL of your Condensate server http://localhost:8000
CONDENSATE_API_KEY API key (create one in the admin dashboard)
import os
from condensate import CondensateClient

client = CondensateClient(
    base_url=os.environ["CONDENSATE_URL"],
    api_key=os.environ["CONDENSATE_API_KEY"]
)

Connecting to a Remote Server

client = CondensateClient(
    base_url="https://memory.yourcompany.com",
    api_key="sk-prod-xxxx"
)

API Reference

store_memory(content, type, metadata)

Stores a raw episodic item and runs the full condensation pipeline (NER → entity extraction → assertion creation).

client.store_memory(
    content="Alice approved the Q3 roadmap.",
    type="episodic",          # episodic | note | event
    metadata={
        "source": "slack",
        "channel": "#product"
    }
)

retrieve(query)

Routes the query through the Memory Router (vector search + optional graph traversal) and returns a synthesised answer.

result = client.retrieve("What did Alice approve?")
# {
#   "answer": "Alice approved the Q3 roadmap.",
#   "sources": ["<uuid>", ...],
#   "strategy": "recall"
# }

add_item(item) (low-level)

Directly posts an EpisodicItemCreate payload to the v1 API.

from condensate import EpisodicItem
import uuid

client.add_item(EpisodicItem(
    project_id=str(uuid.uuid4()),
    source="api",
    text="User prefers dark mode."
))

CLI

The package ships a condensate CLI:

# Store a memory from stdin
echo "Deploy to prod on Friday" | condensate store --type episodic

# Retrieve
condensate retrieve "When are we deploying?"

Set CONDENSATE_URL and CONDENSATE_API_KEY in your shell before using the CLI.

Self-Hosting

See the main README for Docker Compose setup. The server must be running before the SDK can connect.

Development

cd sdks/python
python -m venv .venv && source .venv/bin/activate
pip install -e ".[dev]"
pytest

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

condensate-0.1.13.tar.gz (8.8 kB view details)

Uploaded Source

Built Distribution

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

condensate-0.1.13-py2.py3-none-any.whl (13.1 kB view details)

Uploaded Python 2Python 3

File details

Details for the file condensate-0.1.13.tar.gz.

File metadata

  • Download URL: condensate-0.1.13.tar.gz
  • Upload date:
  • Size: 8.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Hatch/1.16.3 cpython/3.10.19 HTTPX/0.28.1

File hashes

Hashes for condensate-0.1.13.tar.gz
Algorithm Hash digest
SHA256 aecf066482c96f410e9e24ec71164e4e10e9cb4c1a6da2a9a22c5df35587d055
MD5 90bf11ff8afafbe4eed0bab0892d1c47
BLAKE2b-256 54c5a14481b2b3bb4eb1e304e60a0ce338dba646dd87a0be8a99e82ccd6528ef

See more details on using hashes here.

File details

Details for the file condensate-0.1.13-py2.py3-none-any.whl.

File metadata

  • Download URL: condensate-0.1.13-py2.py3-none-any.whl
  • Upload date:
  • Size: 13.1 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Hatch/1.16.3 cpython/3.10.19 HTTPX/0.28.1

File hashes

Hashes for condensate-0.1.13-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 dd0ce07b67f1a929ed529db53b8caca72d0d5a5f6e5140974541dc8a91924417
MD5 3536ee9f91dafbe86089b16a49cf449a
BLAKE2b-256 eefbbf4564f90dce6eafe695b5f593c89bd54dd4d752dba106243a7e22421353

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