Tempo Integration
Agent History integrates with the MCP payment protocol, allowing AI agents to pay for memory operations using tempo request.
What is Tempo?
Tempo is a CLI tool that enables AI agents to make HTTP requests with automatic payment handling. It discovers service pricing, creates payment sessions, and includes payment credentials in requests.
Service Discovery
Agent History exposes its pricing information at /.well-known/mcp.json:
curl https://agenthistory.ai/.well-known/mcp.jsonBasic Usage
Use tempo request instead of curl to automatically handle payments:
Create an Agent
# Create a new agent (free operation)
tempo request -X POST \
--json '{"name": "MyAgent", "mode": "cloud"}' \
https://agenthistory.ai/api/v1/agentsResponse:
{
"success": true,
"data": {
"agentKey": "aht_live_...",
"recordId": "rec_01jx8a7qz2...",
"walletAddress": "0x...",
"mode": "cloud"
}
}Store a Memory
# Store a fact ($0.05)
tempo request -X POST \
--json '{
"content": "User prefers dark mode and concise responses",
"type": "fact"
}' \
https://agenthistory.ai/api/v1/records/rec_xxx/rememberSearch Memories
# Semantic search ($0.05)
tempo request -X POST \
--json '{
"query": "what are the user preferences?",
"limit": 5
}' \
https://agenthistory.ai/api/v1/records/rec_xxx/recallRead a File
# Read file ($0.05)
tempo request \
"https://agenthistory.ai/api/v1/records/rec_xxx/read?path=config/settings"Write a File
# Write file ($0.05)
tempo request -X POST \
--json '{
"path": "config/settings",
"content": "{\"theme\": \"dark\"}"
}' \
https://agenthistory.ai/api/v1/records/rec_xxx/writeGet Full Context
# Get all memories by type ($0.05)
tempo request \
https://agenthistory.ai/api/v1/records/rec_xxx/contextPayment Modes
Session-Based Payments
For multiple operations, tempo creates a payment session with a pre-authorized amount. This reduces overhead for frequent requests.
# tempo automatically manages sessions for efficiency
tempo request -X POST --json '{"content": "Memory 1"}' \
https://agenthistory.ai/api/v1/records/rec_xxx/remember
tempo request -X POST --json '{"content": "Memory 2"}' \
https://agenthistory.ai/api/v1/records/rec_xxx/remember
# Both requests use the same payment sessionDirect Charge
For one-off operations, tempo makes direct charges without session overhead.
Example Workflows
Agent Onboarding
#!/bin/bash
# Complete agent onboarding workflow
# 1. Create the agent
RESPONSE=$(tempo request -X POST \
--json '{"name": "MyAssistant", "mode": "cloud"}' \
https://agenthistory.ai/api/v1/agents)
RECORD_ID=$(echo $RESPONSE | jq -r '.data.recordId')
# 2. Store initial identity
tempo request -X POST \
--json '{
"content": "I am a helpful coding assistant. I prefer concise responses.",
"type": "identity"
}' \
"https://agenthistory.ai/api/v1/records/$RECORD_ID/remember"
# 3. Store initial skills
tempo request -X POST \
--json '{
"content": "I can help with TypeScript, React, and Node.js development.",
"type": "skill"
}' \
"https://agenthistory.ai/api/v1/records/$RECORD_ID/remember"
echo "Agent created with record: $RECORD_ID"Context Loading
#!/bin/bash
# Load agent context at start of conversation
RECORD_ID="rec_01jx8a7qz2..."
# Get full context for system prompt
CONTEXT=$(tempo request \
"https://agenthistory.ai/api/v1/records/$RECORD_ID/context")
echo "Identity: $(echo $CONTEXT | jq '.data.identity')"
echo "Skills: $(echo $CONTEXT | jq '.data.skill')"Memory Update Flow
#!/bin/bash
# Update memories after conversation
RECORD_ID="rec_01jx8a7qz2..."
# Store new facts learned during conversation
tempo request -X POST \
--json '{
"content": "User is working on a Next.js e-commerce project",
"type": "fact"
}' \
"https://agenthistory.ai/api/v1/records/$RECORD_ID/remember"
# Store relationship information
tempo request -X POST \
--json '{
"content": "User\'s colleague Sarah handles design reviews",
"type": "relationship",
"path": "relationships/sarah"
}' \
"https://agenthistory.ai/api/v1/records/$RECORD_ID/remember"Using with Agent Keys
You can also combine tempo with agent key authentication for hybrid scenarios:
# Use agent key for free operations
curl -X GET https://agenthistory.ai/api/v1/records \
-H "Authorization: Bearer aht_live_..."
# Use tempo for paid operations (automatic payment)
tempo request -X POST \
--json '{"query": "user preferences"}' \
https://agenthistory.ai/api/v1/records/rec_xxx/recallPricing with Tempo
Tempo automatically handles payment for these operations:
| Operation | Price | Payment Required |
|---|---|---|
| Create Agent | Free | No |
| Create Record | $0.05 | Yes (on-chain anchor) |
| List/Get/Update/Delete Record | Free | No |
| Recall (Semantic Search) | $0.05 | Yes |
| Remember (Store Memory) | $0.05 | Yes |
| Read File | $0.05 | Yes |
| Write File | $0.05 | Yes |
| Get Context | $0.05 | Yes |
USDC.e Auto-Swap
Don't have pathUSD? No problem. Tempo supports auto-swap from USDC.e. When paying, the protocol automatically swaps USDC.e to pathUSD via Tempo DEX if needed.
Next Steps
- See full API Reference
- Learn about Pricing
- Explore Memory Types