Python SDK
The official Python client for ACE3 - type-safe, async-ready, with Pydantic models
pip install ace3-memoryRequires Python 3.9+. Includes sync and async clients, Pydantic v2 models, and full type hints.
Synchronous Client
from ace3 import ACEClient
client = ACEClient(
base_url="http://localhost:7777",
token="your-jwt-token",
namespace="my-project"
)
# Create a memory
memory = client.memories.create(
title="PostgreSQL Connection Pooling",
content="Use max_connections=100 for production",
tags=["database", "performance"]
)
print(f"Created memory: {memory.id}")
# Search memories
results = client.search("database performance")
for r in results:
print(f" {r.title} (score: {r.score:.2f})")Async Client
from ace3 import AsyncACEClient
import asyncio
async def main():
client = AsyncACEClient(
base_url="http://localhost:7777",
token="your-jwt-token",
namespace="my-project"
)
# All methods have async equivalents
issues = await client.issues.list(status="open")
for issue in issues:
print(f" [{issue.priority}] {issue.title}")
asyncio.run(main())# Option 1: JWT token
client = ACEClient(token="your-jwt-token", ...)
# Option 2: API key
client = ACEClient(api_key="ace_...", ...)
# Option 3: Environment variables (auto-detected)
# Set ACE_JWT_TOKEN or ACE_API_KEY
client = ACEClient(base_url="http://localhost:7777", namespace="my-project")client.memoriesGeneric memories - create, list, get, update, delete
client.issuesIssue tracking - with status, priority, severity filters
client.decisionsArchitecture decisions - with rationale and alternatives
client.work_logsDaily work logs - with tasks, hours, date filters
client.architectureSystem architecture - components, layers, tech stack
client.best_practicesCoding standards - guidelines and conventions
client.patternsCode patterns - reusable solutions and templates
client.relationshipsKnowledge graph - create, traverse, query links
CRUD Example - Issues
# Create
issue = client.issues.create(
title="Add OAuth2 support",
description="Implement Google and GitHub OAuth",
priority="P1",
severity="high",
tags=["auth", "feature"]
)
# List with filters
open_issues = client.issues.list(
status="open",
priority="P1",
limit=10
)
# Get by ID
issue = client.issues.get(42)
# Update
client.issues.update(42, status="in_progress")
# Delete
client.issues.delete(42)All API responses are parsed into Pydantic v2 models, giving you type safety, validation, and IDE autocomplete out of the box.
from ace3.models import Issue, Decision, Memory
# Responses are typed Pydantic models
issue: Issue = client.issues.get(42)
print(issue.title) # str
print(issue.priority) # Literal["P0","P1","P2","P3","P4"]
print(issue.created_at) # datetime
print(issue.tags) # list[str]
# Serialize to dict or JSON
issue_dict = issue.model_dump()
issue_json = issue.model_dump_json()# Semantic search across all entities
results = client.search("database migration strategy")
# Hybrid search with custom weights
results = client.hybrid_search(
query="auth service dependencies",
semantic_weight=0.4,
graph_weight=0.6
)
# Knowledge graph traversal
related = client.relationships.traverse(
entity_type="decision",
entity_id=5,
max_depth=2
)
# Create a relationship
client.relationships.create(
source_type="issue",
source_id=42,
target_type="decision",
target_id=5,
relationship_type="resolves"
)Use Environment Variables
Set ACE_JWT_TOKEN and ACE_BASE_URL as environment variables to avoid hardcoding credentials.
Prefer Async in Web Apps
Use AsyncACEClient in FastAPI, Django async views, or any async Python application for better performance.
Type Hints Everywhere
The SDK is fully typed. Enable strict mypy or pyright for maximum safety.