REST API Overview
MEMANTO exposes a comprehensive REST API for programmatic memory management. All endpoints are accessed via HTTP with JSON request/response bodies.Base URL
/api/v2 prefix indicates API version 2 (current version).
Starting the Server
Before using the API, start the MEMANTO server:Authentication
All API requests require two headers:1. Moorcheh API Key
Every request must include your Moorcheh API key:2. Session Token (for Memory Operations)
Memory operations also require a session token from agent activation:Endpoint Structure
Agent Management
- Create, list, delete agents
- Manage agent lifecycle
Sessions
- Activate agent sessions (get session token)
- Deactivate sessions
- Extend session duration
- Check session status
Memory Operations
POST /{agent_id}/remember- Store single memoryPOST /{agent_id}/batch-remember- Store multiple memoriesGET /{agent_id}/recall- Semantic searchPOST /{agent_id}/answer- AI-powered question answering
Temporal Queries
GET /{agent_id}/recall/as-of- Memories at specific timeGET /{agent_id}/recall/changed-since- Memories changed since dateGET /{agent_id}/recall/current- Only current (non-superseded) memories
Memory Management
- Validate memories
- Supersede outdated memories
- Detect contradictions
- Export memories
Context Summarization
- Summarize memory scopes
- Compress conversation history
Status Codes
| Code | Meaning | Action |
|---|---|---|
200 | OK | Request succeeded |
201 | Created | Resource created |
204 | No Content | Successful deletion |
400 | Bad Request | Invalid parameters |
401 | Unauthorized | Invalid API key or session token |
404 | Not Found | Resource not found |
422 | Validation Error | Invalid request format |
500 | Server Error | Internal error |
Common Response Format
Success Response
Error Response
Rate Limiting
MEMANTO respects your Moorcheh free tier limits:- Free Tier: 500 credits/month (~100,000 operations)
- Each operation: 1 credit
- Rate Limit: No per-second limit, cumulative monthly limit
Pagination
List endpoints support pagination:limit- Results per page (default: 10, max: 100)offset- Skip first N results (default: 0)
Timestamps
All timestamps use ISO 8601 format with UTC timezone:Error Handling
Invalid API Key
Missing Session Token
API Documentation UI
MEMANTO provides interactive API documentation:- Swagger UI: http://localhost:8000/docs
- ReDoc: http://localhost:8000/redoc
- Parameter descriptions
- Request/response examples
- Interactive testing
Quick Start Example
API Endpoints Summary
Agent Management
POST /agents- Create agentGET /agents- List agentsGET /agents/{agent_id}- Get agent detailsDELETE /agents/{agent_id}- Delete agent
Sessions
POST /agents/{agent_id}/activate- Activate sessionPOST /agents/{agent_id}/deactivate- Deactivate sessionGET /session/current- Check current sessionPOST /session/extend- Extend session
Memory Operations
POST /agents/{agent_id}/remember- Store memoryPOST /agents/{agent_id}/batch-remember- Batch storeGET /agents/{agent_id}/recall- Semantic searchPOST /agents/{agent_id}/answer- AI answer
Temporal Queries
GET /agents/{agent_id}/recall/as-of- As-of queryGET /agents/{agent_id}/recall/changed-since- Changed sinceGET /agents/{agent_id}/recall/current- Current only
Memory Management
POST /agents/{agent_id}/validate/{memory_id}- ValidatePOST /agents/{agent_id}/supersede/{memory_id}- Replace outdatedPOST /agents/{agent_id}/contradict/{memory_id}- Mark contradiction
Context Operations
POST /context/summarize- Summarize scopePOST /context/summarize/custom- Summarize by IDsPOST /context/compress- Compress conversation
Detailed Endpoint Documentation
Common Patterns
Create Agent, Activate, Store Memory
Batch Store Memories
Next Steps
The REST API is fully featured and production-ready. Use it to build custom integrations!