Antonlytics API Documentation
Complete API reference for building AI agents with persistent memory. Simple REST API with natural language ingestion and querying.
https://api.antonlytics.com/api/v1Quick Start
1. Get Your API Key
Sign up at antonlytics.com and create an API key from your dashboard.
Create API Key2. Make Your First Request
curl -X POST https://api.antonlytics.com/api/v1/memory/extract/ \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"text": "Customer Alice from TechCorp bought Enterprise plan",
"project_id": "YOUR_PROJECT_ID"
}'Authentication
API Key Authentication
All API requests require authentication using Bearer tokens. Include your API key in the Authorization header:
Authorization: Bearer anto_live_xxxxxxxxxxxxxxxxSecurity: Never expose your API key in client-side code. Always make API calls from your backend.
Example Request
cURL
curl https://api.antonlytics.com/api/v1/graph/projects/ \
-H "Authorization: Bearer YOUR_API_KEY"Python
import requests
headers = {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
}
response = requests.get(
"https://api.antonlytics.com/api/v1/graph/projects/",
headers=headers
)
print(response.json())JavaScript
const response = await fetch(
'https://api.antonlytics.com/api/v1/graph/projects/',
{
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
}
}
);
const data = await response.json();
console.log(data);Memory API
Natural language API for giving your AI agent persistent memory. No complex entity creation - just plain English.
Extract & Store
Ingest natural language text and automatically extract entities and relationships.
/api/v1/memory/extract/Request Body
{
"text": "Had a call with Sarah Johnson from TechCorp. She's the VP of Engineering and is interested in our Enterprise plan for 50 users. Follow up next Tuesday.",
"project_id": "550e8400-e29b-41d4-a716-446655440000"
}Response (200 OK)
{
"extracted": {
"entities": [
{
"name": "Sarah Johnson",
"type": "Person",
"properties": {
"title": "VP of Engineering"
}
},
{
"name": "TechCorp",
"type": "Company"
},
{
"name": "Enterprise plan",
"type": "Product"
}
],
"relationships": [
{
"from": "Sarah Johnson",
"to": "TechCorp",
"type": "WORKS_AT",
"properties": {}
},
{
"from": "Sarah Johnson",
"to": "Enterprise plan",
"type": "INTERESTED_IN",
"properties": {
"users": 50
}
}
]
},
"created": {
"entities": 3,
"relationships": 2
}
}Example
curl -X POST https://api.antonlytics.com/api/v1/memory/extract/ \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"text": "Customer Alice bought Laptop Pro for $999",
"project_id": "YOUR_PROJECT_ID"
}'Chat with Memory
Chat with your agent using our AI model + your system prompt + full memory context.
/api/v1/memory/chat/Request Body
{
"message": "Who should I follow up with this week?",
"project_id": "550e8400-e29b-41d4-a716-446655440000"
}Response (200 OK)
{
"response": "You should follow up with Sarah Johnson from TechCorp. She expressed strong interest in the Enterprise plan for 50 users and you mentioned following up next Tuesday.",
"relevant_entities": [
{
"id": "ent_123",
"name": "Sarah Johnson",
"type": "Person",
"properties": {
"title": "VP of Engineering",
"company": "TechCorp"
}
}
]
}Example
curl -X POST https://api.antonlytics.com/api/v1/memory/chat/ \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"message": "Who bought laptops?",
"project_id": "YOUR_PROJECT_ID"
}'Query Memory
Get structured memory context for your own AI model. Returns relevant entities and relationships.
/api/v1/memory/query/Request Body
{
"question": "laptop purchases",
"project_id": "550e8400-e29b-41d4-a716-446655440000"
}Response (200 OK)
{
"graph_context": {
"entities": [
{
"id": "ent_123",
"name": "Alice",
"type": "Customer",
"properties": {"country": "USA"}
},
{
"id": "ent_124",
"name": "Laptop Pro",
"type": "Product",
"properties": {"price": 999}
}
],
"relationships": [
{
"from": "ent_123",
"to": "ent_124",
"type": "PURCHASED",
"properties": {"date": "2024-01-15"}
}
]
}
}System Prompt
Get or update the system prompt that defines your agent's behavior.
/api/v1/memory/system-prompt/<project_id>//GET - Retrieve System Prompt
curl https://api.antonlytics.com/api/v1/memory/system-prompt/YOUR_PROJECT_ID/ \
-H "Authorization: Bearer YOUR_API_KEY"PATCH - Update System Prompt
curl -X PATCH https://api.antonlytics.com/api/v1/memory/system-prompt/YOUR_PROJECT_ID/ \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"system_prompt": "You are a helpful sales assistant. Focus on follow-ups and next steps."
}'Templates
Get pre-built templates for common use cases (CRM, Support, Legal).
/api/v1/memory/templates/curl https://api.antonlytics.com/api/v1/memory/templates/ \
-H "Authorization: Bearer YOUR_API_KEY"Response
{
"templates": [
{
"id": "crm",
"name": "Sales CRM",
"description": "Track customers, deals, and interactions",
"system_prompt": "You are a sales assistant...",
"ontology": {
"entities": ["Customer", "Company", "Deal"],
"relationships": ["WORKS_AT", "INTERESTED_IN"]
}
}
]
}Projects API
Manage your projects (agents). Each project has its own memory graph and system prompt.
List Projects
Get all projects for your account.
/api/v1/graph/projects/curl https://api.antonlytics.com/api/v1/graph/projects/ \
-H "Authorization: Bearer YOUR_API_KEY"Create Project
Create a new project (agent).
/api/v1/graph/projects/curl -X POST https://api.antonlytics.com/api/v1/graph/projects/ \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "My Sales Agent",
"description": "Tracks customer interactions"
}'Response
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "My Sales Agent",
"description": "Tracks customer interactions",
"created_at": "2024-01-15T10:30:00Z"
}Get Project Stats
Get statistics for a project (entity count, relationship count, etc.).
/api/v1/graph/projects/<project_id>/stats/curl https://api.antonlytics.com/api/v1/graph/projects/YOUR_PROJECT_ID/stats/ \
-H "Authorization: Bearer YOUR_API_KEY"Error Handling
Error Response Format
All errors return a JSON object with an error message and appropriate HTTP status code.
{
"error": "Invalid API key",
"detail": "The provided API key is not valid or has been revoked"
}HTTP Status Codes
200201400401403404429500Rate Limits
X-RateLimit-RemainingRate Limit Headers: Check the X-RateLimit-Remaining and X-RateLimit-Reset headers in responses.
Official SDKs
Need Help?
Have questions about the API? Contact our developer support team or join our community.