Antonlytics Python SDK
Memory for AI Agents - Simple natural language SDK.
Installation
pip install antonlytics
Quick Start
from antonlytics import Agent
# Initialize agent
agent = Agent(
api_key="your-api-key",
project_id="your-project-id"
)
# Ingest - agent learns from natural language
agent.ingest("""
Had a call with Sarah Johnson from TechCorp today.
She's interested in our Enterprise plan for 50 users.
Follow up next Tuesday.
""")
# Chat - agent remembers and responds
response = agent.chat("Who should I follow up with?")
print(response["response"])
# => "You should follow up with Sarah Johnson from TechCorp..."
Features
- Natural Language Ingestion - No complex entity creation, just plain English
- AI-Powered Chat - Chat with your agent using our model + your memory
- Memory Access - Get structured memory for your own AI model
- System Prompts - Configure agent behavior and personality
- Simple API - 3 lines of code to get started
Two Usage Options
Option 1: Use Our Model
Full-service AI with your system prompt + memory:
# We handle everything
response = agent.chat("Who should I follow up with?")
print(response["response"])
Option 2: Use Your Model
Just get memory context for your own model:
# Get memory
memory = agent.get_memory()
# Use with your model (OpenAI, Anthropic, etc.)
from openai import OpenAI
client = OpenAI()
response = client.chat.completions.create(
model="gpt-4",
messages=[
{"role": "system", "content": "You are a sales assistant"},
{"role": "system", "content": f"Memory: {memory}"},
{"role": "user", "content": "Who to follow up?"}
]
)
Documentation
Agent Class
__init__(api_key, project_id, base_url=None)
Initialize the agent.
Parameters:
api_key(str): Your Antonlytics API keyproject_id(str): Your project/agent IDbase_url(str, optional): API base URL
ingest(text: str) -> dict
Ingest natural language text and extract entities/relationships.
Parameters:
text(str): Natural language text (conversations, notes, emails)
Returns:
- dict with extracted entities and relationships
Example:
result = agent.ingest("Customer Alice bought Laptop Pro for $999")
print(result["created"]) # {"entities": 2, "relationships": 1}
chat(message: str, history: list = None) -> dict
Chat with your agent. Uses system prompt + full memory context.
Parameters:
message(str): Your question or messagehistory(list, optional): Conversation history
Returns:
- dict with response and relevant entities
Example:
response = agent.chat("Who bought laptops?")
print(response["response"])
print(response["relevant_entities"])
get_memory(query: str = None) -> dict
Get structured memory for your own AI model.
Parameters:
query(str, optional): Natural language query to filter memory
Returns:
- dict with entities and relationships
Example:
memory = agent.get_memory("laptop purchases")
# Use with your own model
set_system_prompt(prompt: str) -> dict
Configure agent behavior and personality.
Parameters:
prompt(str): System prompt text
Example:
agent.set_system_prompt("""
You are a helpful sales assistant.
Be concise and action-oriented.
Focus on follow-ups and next steps.
""")
get_system_prompt() -> str
Get current system prompt.
Returns:
- str: System prompt text
Error Handling
from antonlytics import Agent, AntonlyticsError, APIError, AuthenticationError
try:
agent = Agent(api_key="invalid", project_id="test")
agent.chat("Hello")
except AuthenticationError as e:
print(f"Auth error: {e}")
except APIError as e:
print(f"API error: {e.status_code} - {e}")
except AntonlyticsError as e:
print(f"Error: {e}")
Complete Example
from antonlytics import Agent
# Initialize
agent = Agent(
api_key="your-api-key",
project_id="your-project-id"
)
# Set behavior
agent.set_system_prompt("""
You are a sales assistant.
Focus on follow-ups and next steps.
""")
# Ingest multiple conversations
agent.ingest("""
Call with Mike Rodriguez from StartupXYZ.
He's the founder. Looking at our API for their mobile app.
Has 100K users. Wants custom pricing.
Send proposal by Friday.
""")
agent.ingest("""
Email from Sarah Chen at BigCorp.
VP of Engineering. Interested in Enterprise.
Team of 200 developers. Budget discussion next week.
""")
# Query memory
response = agent.chat("What are my top priorities this week?")
print(response["response"])
# Get all contacts
response = agent.chat("List all people I've talked to")
for entity in response["relevant_entities"]:
if entity["type"] == "Person":
print(f"- {entity['name']}")
Requirements
- Python >= 3.8
- requests >= 2.28.0
Development
# Clone repository
git clone https://github.com/Voidback-Inc/antonlytics-python-sdk
cd antonlytics-python-sdk
# Install dependencies
pip install -e ".[dev]"
# Run tests
pytest
# Format code
black .
# Type check
mypy antonlytics
Links
License
MIT License - see LICENSE file for details.
Support
- Email: support@antonlytics.com
- Documentation: https://antonlytics.com/docs
- Issues: https://github.com/Voidback-Inc/antonlytics-python-sdk/issues
Metadata
Release files for antonlytics 2.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| antonlytics-2.3.0.tar.gz | 16.3 kB | Without provenance | Details for antonlytics-2.3.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| antonlytics-2.3.0-py3-none-any.whl | Python 3 | none | any | Details for antonlytics-2.3.0-py3-none-any.whl |
Total release size: 29.5 kB
Release files / antonlytics-2.3.0.tar.gz
| Download URL | antonlytics-2.3.0.tar.gz |
|---|---|
| Size | 16.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0173b60655ca31b2a0371863c4b00fffd5198de7d0540b2c6240258081d852b4
|
|
BLAKE2b-256 checksum How to use checksums |
1c42fefaa974ab1ce316d33ea6f9d12a7bf02657e42e0be083802b352259cfb1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.16 {"installer":{"name":"uv","version":"0.9.16","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / antonlytics-2.3.0-py3-none-any.whl
| Download URL | antonlytics-2.3.0-py3-none-any.whl |
|---|---|
| Size | 13.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e7bfea26ae6747121382ec7fb8d92966c1ce3e17ea3fcb6b8fee5da6bcab7d6f
|
|
BLAKE2b-256 checksum How to use checksums |
0445d72cf8b6c4093527174b63646a70b6c8989779ec68f453449e0e3903086f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.16 {"installer":{"name":"uv","version":"0.9.16","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Security for antonlytics 2.3.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.