Python SDK for the 0Latency agent memory API with drop-in wrappers for Anthropic, OpenAI, and Gemini
Reason this release was yanked:
Broken /v1/ prefix — non-functional release, use 0.2.1
Project description
0Latency Python SDK
A lightweight Python client for the 0Latency agent memory API.
Installation
pip install zero-latency
Quick Start
from zero_latency import ZeroLatencyClient
# Initialize the client
client = ZeroLatencyClient(api_key="your_api_key_here")
# Extract memories from a conversation
result = client.extract(
agent_id="my-agent",
human_message="I love hiking in the mountains",
agent_message="That's great! Mountain hiking is wonderful exercise."
)
# Recall relevant memories
memories = client.recall(
agent_id="my-agent",
query="What outdoor activities does the user enjoy?",
limit=5
)
for memory in memories:
print(f"- {memory['content']} (confidence: {memory['confidence']})")
Features
- Extract: Automatically extract and store memories from conversations
- Recall: Semantic search to find relevant memories
- Search: Keyword-based text search
- Seed: Bulk import existing facts or notes
- Graph: Explore memory relationships and connections
- Entities: Extract and track people, places, concepts
- Sentiment: Analyze emotional tone across memories
- Consolidate: Merge and deduplicate similar memories
Usage
Context Manager (Recommended)
with ZeroLatencyClient(api_key="your_api_key") as client:
memories = client.recall(agent_id="my-agent", query="user preferences")
Direct Instantiation
client = ZeroLatencyClient(api_key="your_api_key")
try:
memories = client.recall(agent_id="my-agent", query="user preferences")
finally:
client.close()
Error Handling
from zero_latency import ZeroLatencyClient, AuthenticationError, ValidationError
client = ZeroLatencyClient(api_key="your_api_key")
try:
result = client.extract(
agent_id="my-agent",
human_message="Hello!",
agent_message="Hi there!"
)
except AuthenticationError:
print("Invalid API key")
except ValidationError as e:
print(f"Invalid request: {e}")
API Methods
extract(agent_id, human_message, agent_message)
Extract and store memories from a conversation turn.
recall(agent_id, query, limit=10)
Recall relevant memories using semantic search.
search(agent_id, q, limit=20)
Search memories by keyword.
list_memories(agent_id, limit=50)
List all memories for an agent.
seed(agent_id, facts)
Bulk import a list of facts.
get_graph(agent_id, memory_id, depth=2)
Get memory graph traversal.
get_entities(agent_id, limit=50)
List extracted entities.
get_sentiment_summary(agent_id)
Get sentiment breakdown.
consolidate(agent_id, auto_merge=False)
Run consolidation to merge similar memories.
delete_memory(memory_id)
Delete a specific memory.
Documentation
Full documentation available at docs.0latency.ai
License
MIT License - see LICENSE file for details.
Support
- Email: justin@0latency.ai
- Issues: GitHub Issues
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 zerolatency-0.2.0.tar.gz.
File metadata
- Download URL: zerolatency-0.2.0.tar.gz
- Upload date:
- Size: 13.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b6c8c5511380bca5363873d520f637e2dbefb77253f706dca6d47554cba85b39
|
|
| MD5 |
4f78215e6324502c0df8fc71aaff7c1d
|
|
| BLAKE2b-256 |
6e3b9cf4c24026eeb5bb8948f1ebb19b789098db0dc942fe56031e7a20535268
|
File details
Details for the file zerolatency-0.2.0-py3-none-any.whl.
File metadata
- Download URL: zerolatency-0.2.0-py3-none-any.whl
- Upload date:
- Size: 13.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2232f0c016510df7c0d261522d312dfd634800b93c420fbe65d1f7eda15d599c
|
|
| MD5 |
9ba7077aa68031fa81b2398a9f9568b3
|
|
| BLAKE2b-256 |
b285c8e8c623fa5779e1cf18a21c7207cdf2f01db35bd97f87c0956459c4fbd1
|