Official Python Client for Condensate Memory System
Project description
Condensate Python SDK
Official Python client for Condensate — the open-source Agent Memory System.
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
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 condensate-0.1.12.tar.gz.
File metadata
- Download URL: condensate-0.1.12.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
db74b2d4d58edceaac10c695ae5954297db99f257210af95561f274291509a2e
|
|
| MD5 |
147edb91ceca68f5feb340edd10c6f6f
|
|
| BLAKE2b-256 |
f8e941cd2a3407e8b9de86750490d292e0e9283fa62846b3a26aa48a6d36dc6b
|
File details
Details for the file condensate-0.1.12-py2.py3-none-any.whl.
File metadata
- Download URL: condensate-0.1.12-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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e7e6d79fe944b1dfcc33bcc6cc6842830338b94ff288fc006b0f21bb86c99f93
|
|
| MD5 |
2dc2153272721c61f4c08cfae07b17c8
|
|
| BLAKE2b-256 |
f9937d18f9da245e7590031b5eb65948a92bf7de3fdba7ba29612d7f1cb352e9
|