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

Your Application
Backend service, chatbot, etc.
HTTPS + API Key
Memstate REST API
api.memstate.ai
Remember
Store memories
Search
Semantic recall
Ingest
AI-powered

Base URL

Production
https://api.memstate.ai/api/v1

All API endpoints are prefixed with /api/v1.

Authentication

All API requests require an API key. Include it in the request header:

HTTP Header
X-API-Key: your_api_key_here

# Or alternatively:
Authorization: Bearer your_api_key_here

Get an API key from your dashboard. See the authentication guide for full details.

Quick Example

Remember content (auto-extraction)
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"
  }'
Search memories
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