Documentation
Everything you need to integrate, connect MCP, and build with KAAL & Smriti.
Authentication
All API requests must be authenticated using a Bearer token or X-API-Key header.
Authorization: Bearer chrn_... # OR X-API-Key: chrn_...
Model Context Protocol (MCP) Server
NewConnect Smriti directly to Claude Desktop, Cursor IDE, VS Code, or Windsurf using the official Model Context Protocol (MCP) server. Give your AI persistent temporal memory with zero glue code.
1. Quick 3-Step Setup
# 1. Install dependencies pip install -r mcp/requirements.txt # 2. Set your API Key export SMRITI_API_KEY="chrn_your_api_key_here" # 3. Run stdio server (or test with MCP Inspector) python -m smriti.mcp # npx @modelcontextprotocol/inspector python -m smriti.mcp
2. Claude Desktop Integration
Add this snippet to your claude_desktop_config.json file:
{
"mcpServers": {
"smriti": {
"command": "python",
"args": ["-m", "smriti.mcp"],
"cwd": "/path/to/smriti",
"env": {
"SMRITI_API_KEY": "chrn_your_api_key_here",
"SMRITI_SOURCE_ID": "claude-desktop"
}
}
}
}3. Cursor IDE Integration
Add to your project's .cursor/mcp.json or global Cursor settings:
{
"mcpServers": {
"smriti": {
"command": "python",
"args": ["-m", "smriti.mcp"],
"cwd": "/path/to/smriti",
"env": {
"SMRITI_API_KEY": "chrn_your_api_key_here",
"SMRITI_SOURCE_ID": "cursor-workspace",
"SMRITI_SCOPE": "code"
}
}
}
}Exposed MCP Tools
| Tool Name | Description | Parameters |
|---|---|---|
| smriti_remember | Stores text memory; auto-extracts Subject-Verb-Object causal tuples | text, source_id, scope, timestamp |
| smriti_recall | Hybrid search across semantic, temporal, and entity indexes | query, max_results, source_id, scope |
| smriti_timeline | Retrieves chronological event timeline for a specified time range | time_range_start, time_range_end, scope |
| smriti_forget | Finds memories to mark as superseded (preserving bi-temporal history) | query, scope, max_to_forget |
| smriti_health | Checks memory engine status, event count & embedding statistics | none |
| smriti_usage | Fetches current monthly usage statistics and plan tier limits | none |
MCP Environment Variables
| Variable | Default | Description |
|---|---|---|
| SMRITI_API_KEY | (required) | Your Smriti API key (chrn_...) |
| SMRITI_BASE_URL | https://spy9191-chronos-api-backend.hf.space | Base URL of your deployed Smriti API backend |
| SMRITI_SOURCE_ID | mcp-client | Default source identifier for memory operations |
| SMRITI_SCOPE | default | Logical namespace scope for memory partitioning |
| SMRITI_MAX_RESULTS | 20 | Default max search results for recall & timeline |
Ingest Event
Feed unstructured text to your agent's memory. KAAL automatically extracts S-V-O relationships, entities, and temporal data.
POST
/ingestcurl -X POST https://spy9191-chronos-api-backend.hf.space/ingest \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"source_id": "my-app",
"events": [{"text": "Acme Corp signed a new $50k contract today"}]
}'Query Memory
Search your agent's memory using natural language. Performs hybrid semantic + temporal + entity retrieval.
POST
/querycurl -X POST https://spy9191-chronos-api-backend.hf.space/query \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"query": "What did Acme Corp do?"}'