Quickstart: REST API
Learn how to build an AI agent with persistent memory using Memanto’s REST API.What You’ll Build
A simple customer support agent that:- Remembers customer preferences
- Recalls relevant context
- Uses memories to provide personalized responses
Prerequisites
- Memanto server running (
memanto serve) withMOORCHEH_API_KEYconfigured in its environment - Python 3.10+
httpxlibrary:pip install httpx
Memanto authenticates with Moorcheh on the server using the configured
MOORCHEH_API_KEY. API clients do not send an Authorization header — they only send X-Session-Token for memory operations.Architecture
Step 1: Start Memanto Server
In a terminal:Step 1.5: Create the Agent Once
Create the agent ID used by the example before running the script:Step 2: Create the Agent
Createcustomer_agent.py:
Step 3: Use Your Agent
Createmain.py:
Step 4: Run Your Agent
Step 5: Use Memory Types Effectively
Different memory types help organize information:Step 6: Extend Your Agent
Batch Store Memories
Store multiple memories at once:Temporal Queries
Recall memories from specific time periods:Recall the Latest Memories
/recall/recent returns memories sorted newest-first (no query needed):
Session Renewal
Sessions are auto-renewed on memory requests when they’re near expiry. To start a fresh session explicitly, call/activate again — the new token replaces the old one. There is no separate /extend endpoint.
Complete Example
For a production-ready example, see the API Reference with all endpoints documented.Next Steps
- Full REST API Reference: API Documentation
- Memory Types: Memory Types Reference
- Advanced Patterns: Agent Patterns Guide
- CLI Alternative: CLI Commands
- TypeScript SDK: TypeScript SDK Reference
- Integrations: Connect to IDE Plugins
Congratulations! You’ve built your first memory-enabled agent. Now explore advanced features!