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

New

Connect 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 NameDescriptionParameters
smriti_rememberStores text memory; auto-extracts Subject-Verb-Object causal tuplestext, source_id, scope, timestamp
smriti_recallHybrid search across semantic, temporal, and entity indexesquery, max_results, source_id, scope
smriti_timelineRetrieves chronological event timeline for a specified time rangetime_range_start, time_range_end, scope
smriti_forgetFinds memories to mark as superseded (preserving bi-temporal history)query, scope, max_to_forget
smriti_healthChecks memory engine status, event count & embedding statisticsnone
smriti_usageFetches current monthly usage statistics and plan tier limitsnone

MCP Environment Variables

VariableDefaultDescription
SMRITI_API_KEY(required)Your Smriti API key (chrn_...)
SMRITI_BASE_URLhttps://spy9191-chronos-api-backend.hf.spaceBase URL of your deployed Smriti API backend
SMRITI_SOURCE_IDmcp-clientDefault source identifier for memory operations
SMRITI_SCOPEdefaultLogical namespace scope for memory partitioning
SMRITI_MAX_RESULTS20Default 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/ingest
curl -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/query
curl -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?"}'