REST API
Integrate Memstate directly into your backend services, chatbots, and custom applications. The REST API provides full programmatic access to memory storage, search, and retrieval.
How It Works
Base URL
https://api.memstate.ai/api/v1All API endpoints are prefixed with /api/v1.
Authentication
All API requests require an API key. Include it in the request header:
X-API-Key: your_api_key_here
# Or alternatively:
Authorization: Bearer your_api_key_hereGet an API key from your dashboard. See the authentication guide for full details.
Quick Example
curl -X POST https://api.memstate.ai/api/v1/memories/remember \
-H "Content-Type: application/json" \
-H "X-API-Key: mst_your_key" \
-d '{
"project_id": "my-app",
"content": "## Caching\n\nUser preferences are cached for 30 days with automatic invalidation on profile updates. Session tokens are cached in Redis with a 1-hour TTL.",
"source": "agent"
}'curl -X POST https://api.memstate.ai/api/v1/memories/search \
-H "Content-Type: application/json" \
-H "X-API-Key: your_api_key_here" \
-d '{
"query": "how is caching implemented",
"project_id": "my-app",
"limit": 5
}'Use Cases
Chatbot Memory
Store conversation context, user preferences, and learned facts so your chatbot remembers across sessions.
Knowledge Base
Build a versioned knowledge base that tracks how information evolves over time with full audit trail.
Multi-Agent Orchestration
Share structured context between multiple agents with project-level isolation and conflict detection.
Document Processing Pipeline
Use the remember endpoint to process raw documents, task summaries, or any text with AI-powered extraction and automatic organization.
Response format
All API responses are JSON. Successful responses return a 200 status code. Errors return appropriate HTTP status codes (400, 401, 404, 500) with an {"error": "message"} body.
API Sections
Authentication
API keys, headers, and multi-tenant isolation
Memories
Store, retrieve, update, and browse memories
Search & Retrieval
Semantic search and keypath-based retrieval
Remember API
AI-powered content processing -- auto-extract facts from any text
Projects & Organization
Project management, tree view, keypaths, and changelog