MCP Server
MCP Server
Litica exposes two tools over the Model Context Protocol for writing to and retrieving from the shared namespace. Any MCP-compatible agent can use them without code changes.
Overview
The Model Context Protocol is a standard for connecting external tools to AI models. The Litica MCP server implements this protocol to give any compatible agent a persistent, structured namespace for storing and retrieving context. Once configured, the agent calls these tools automatically when it determines they are relevant to the current task.
The server supports two transports: HTTP (for production and remote deployments) and stdio (for local Claude Desktop use). Both expose the same two tools. Each agent writes to its own namespace viaagent_id.
add_memoryWrites structured context to the agent's namespace. Litica decomposes the content into reference frames (goals, entities, emotional valence, temporal scope), embeds each domain independently with a local sentence-transformers model, and stores the result in PostgreSQL with pgvector. Provenance is recorded at write time.
content: str # The experience to store (required)
agent_id: str # Agent identifier, default "default"Returns a confirmation string when the memory is stored.
search_memoryRetrieves context relevant to a natural language query using spreading activation. Litica generates a reference frame for the query, activates the namespace across all four domains in parallel, aggregates scores using domain-specific weights, and applies a salience multiplier that surfaces context that has proven useful before. Returns ranked results with provenance.
query: str # Natural language query (required)
top_k: int # Number of results, default 5
agent_id: str # Agent identifier, default "default"Returns a list of memory text strings ordered by relevance.
How retrieval works
When search_memory is called, Litica does the following:
- Generates a reference frame for the query using Gemini
- Queries each domain table (goals, entities, emotional valence, temporal scope) in parallel using cosine similarity against the stored embeddings
- Aggregates scores across domains with weighted combination (goals 30%, entities 25%, emotional valence 20%, temporal scope 25%)
- Applies a salience multiplier based on emotional importance and retrieval frequency
- Returns the top-k results by final score
Context that is retrieved often accumulates salience and surfaces more readily in subsequent searches. This is the spreading activation model: relevance propagates through the namespace rather than being computed purely at query time.
Compatibility
The Litica MCP server works with any MCP-compatible host, including:
- Claude Desktop (HTTP or stdio transport)
- Claude Code CLI (HTTP transport via
.mcp.json) - Cursor (HTTP transport)
- Any custom agent built with the MCP SDK
Ready to connect? See the configuration guide.