iranti
Iranti
Shared memory for AI coding tools — Claude Code, Codex CLI, and GitHub Copilot.
Iranti is a self-hosted MCP server that gives your AI tools persistent, identity-based memory. Facts written in one session are retrievable in any other — across tools, projects, and context resets.
Quick Start
# Install globally
npm install -g iranti
# Run the guided setup (configures database, API key, project binding)
iranti setup
# Start the instance
iranti run --instance localThen wire it into your AI tool:
iranti claude-setup # Claude Code
iranti codex-setup # Codex CLI
iranti copilot-setup # GitHub CopilotThat's it. Your AI tool now has persistent memory across sessions.
Related MCP server: Turbo Quant Memory MCP Server
Supported Tools
Tool | Command | What it does |
Claude Code |
| Adds |
Codex CLI |
| Registers Iranti in the global MCP registry |
GitHub Copilot |
| Writes MCP config to |
Any MCP client |
| Runs the stdio MCP server directly |
What It Does
Iranti stores facts as entityType/entityId → key → value triples in PostgreSQL. Any agent that knows the entity and key can retrieve the fact exactly — no semantic guessing, no hallucinated state.
Agent A writes: project/my-app → deployment_status → "deployed to staging"
Agent B reads: project/my-app → deployment_status → "deployed to staging" ✓Facts persist across sessions, context resets, and tool switches. When you restart Claude Code tomorrow, it can pick up exactly where you left off.
Key capabilities
Exact lookup — retrieve by
entityType/entityId + key, deterministic and fastHybrid search — lexical + vector similarity when exact keys are unknown
Cross-tool sharing — Claude Code, Codex, and Copilot share the same memory
Conflict resolution — concurrent writes from multiple agents are detected and resolved
Per-fact confidence — every fact carries a confidence score; low-confidence facts age out
Session recovery — checkpoint/resume for interrupted work
User operating rules — define trigger-based rules that surface only when relevant
File-change recall — agents remember which files changed and why
Staff agents
Iranti is built around four internal Staff components that run alongside the host AI tool. Each Staff member has a specific job, and together they turn the memory layer into an active participant in the session — not just a dictionary the agent reads from.
Staff | Role | What it does |
Librarian | Writes and conflict resolution | Normalizes facts before storage, runs multi-step conflict resolution with cited evidence, enforces schema and confidence rules |
Attendant | Turn-time context | Pre-response memory injection, mid-turn tool-call guidance, post-response autowrite nudges, drift detection, session objective tracking |
Archivist | Background maintenance | Decays stale facts, archives expired entries, processes escalations, runs a bounded reasoning pass that proposes compressions and demotions |
Resolutionist | Human-in-the-loop | Consumes escalation files for conflicts the Librarian could not auto-resolve |
Attendant agency (what the Attendant surfaces on every turn)
The Attendant runs in three phases — pre-response, mid-turn, and post-response — and returns a structured result each time. Beyond raw fact injection, every attend response carries:
toolCallGuidance— when the host passes a pending tool call (Read,Grep,Glob,Bash,WebSearch,WebFetch), the Attendant derives entity hints from the tool args and emits ashouldSkipverdict when stored facts already cover the target. Hosts can gate tool execution on the verdict instead of string-matching notes.drift— detects when the latest message has diverged from the declared task topic. Emits the driving tokens so the host can surface a confirmation prompt. Suppressed whencheckpoint.currentStepstarts withCOMPLETE— so a finished task does not produce spurious drift alarms as the conversation winds down.sessionObjective— derived from the task description or checkpoint continuation, threaded through every attend call as a stable anchor.autoCheckpointSignal— fires when pressure has built up (drift, turns-without-write, tool-cost threshold) so the host can checkpoint before the next risky step.refinementPass— when the first retrieval pass comes back empty, the Attendant runs a bounded widened-hint retry (max 1 extra observe call) and reports the outcome.subTurnLoopPlan— onmid-turnattends, when the host passes apartialResponseof the Attendant's own in-progress assistant output, the Attendant re-scores the partial against memory, harvests novel tokens and entity hints from the text, and fires one bounded extra observe call with the widened hints unioned onto the original ones. Net-new facts are deduped against the pre-retry baseline so repeat hits are dropped. Gated by phase, partial length, a once-per-turn budget, and a novelty check on the tokens. This isrefinementPassre-applied on response progress rather than empty initial retrieval — the "most agentic" sub-turn loop from the M-series memo.attendantToolPlan— up to three planned follow-up tool calls (search_related, observe_entity, query) derived from brief entities, drift tokens, or the session objective. Deterministic and surfaced, never executed.councilConsultationPlan— proposes which peer Staff members the Attendant would consult for this turn (e.g. Librarian for source-reliability on a clear topic, Archivist when the injection surface has multiple low-confidence facts). Proposal only.usageGuidance— carries the MANDATORY protocol reminder block. Gated on compliance health: when all counters (turnsWithoutWrite,consecutiveUnusedMemoryInjections, etc.) are zero the reminder is suppressed so well-behaved agents do not pay the injection cost every turn.writeNudge— reminds the host to write a fact after substantial activity without a durable write.toolResultExtraction— on mid-turn/post-response, the Attendant extracts candidate facts from the tool result so the host can autowrite them.responseFileCapture— onpost-response, the Attendant scans the assistant's reply for file paths, infers the action (edited/created/read) from the ±150-character context window around each match, and auto-writesproject/{id}/file/{basename}facts so file-scoped memory is populated without host involvement. Result carriesautowriteBatchId,filesDetected,factsWritten,entities,skipped, anddurationMs. Only present on post-response attend calls.
Archivist reasoning budget
Each Archivist scan cycle ends with a bounded, deterministic reasoning pass that emits proposals (never mutations) for the Resolutionist to consider:
compress — clusters of duplicate entries at the same
entityType/entityId/keyflag_drift — clusters with high confidence spread suggesting disagreement
demote — stale low-confidence single entries
review_stale — very old single entries regardless of confidence
Proposals fire as reasoning_proposal_emitted staff events and travel on the ArchivistReport so callers can ship them onward.
Council mode
Staff members can propose consultations with each other before finalising a decision. The Librarian can ask the Attendant for relevance when resolving a conflict; the Attendant can ask the Librarian for source-reliability context on a topic; the Resolutionist can ask the Archivist for pending reasoning-proposal context on an escalation. Consultations are proposed, bounded, and fired as council_consultation_proposed staff events — they are not executed automatically today.
MCP Tools
When connected via MCP, Iranti exposes these tools to your AI tool:
Tool | Purpose |
| Initialize session, load operating rules and working memory |
| Pre/post-response memory injection — call before every reply |
| Write a durable fact to shared memory |
| Exact entity+key lookup |
| Hybrid semantic/lexical search |
| Save current task progress |
| Extract facts from prose or documents |
| Create a relationship between two entities |
| Traverse entity relationships |
| Fact history with timestamps |
| Find which agents have written about an entity |
| Demand-driven context injection with entity hints |
| Write a user operating rule with trigger conditions |
| Auto-persist facts from an assistant response |
Install Strategy
Iranti uses a two-layer model: one machine-level runtime, many project bindings.
1. Install and set up
npm install -g iranti
iranti setupiranti setup walks you through:
Instance creation and database onboarding (local Postgres, managed Postgres, or Docker)
LLM provider API keys (OpenAI, Claude, Gemini, Groq, Mistral, or local Ollama)
Project binding
Non-interactive automation:
iranti setup --defaults --db-url "postgresql://postgres:yourpassword@localhost:5432/iranti"2. Start the instance
iranti run --instance local3. Bind a project
cd /path/to/your/project
iranti project init . --instance local --agent-id my_agentThis writes .env.iranti with IRANTI_URL, IRANTI_API_KEY, and agent identity. Each agent in a multi-agent system gets its own --agent-id.
4. Integrate with your AI tool
iranti claude-setup # or codex-setup / copilot-setupAPI Keys
# Create a scoped key for one user or service
iranti auth create-key --instance local --key-id my_app --owner "My App" \
--scopes "kb:read,kb:write,memory:read,memory:write"
# List keys
iranti list api-keys --instance local
# Revoke a key
iranti auth revoke-key --instance local --key-id my_appSDK Usage
Python (PyPI):
from iranti import IrantiClient
client = IrantiClient(base_url="http://localhost:3001", api_key="your_key")
# Write a fact
client.write(
entity="project/my-app",
key="status",
value="in_review",
summary="App is in review",
confidence=90,
source="my_script",
agent="my_agent",
)
# Read it back
fact = client.query(entity="project/my-app", key="status")TypeScript (npm):
import { IrantiClient } from "@iranti/sdk";
const client = new IrantiClient({ baseUrl: "http://localhost:3001", apiKey: "your_key" });
await client.write({
entity: "project/my-app",
key: "status",
value: "in_review",
summary: "App is in review",
confidence: 90,
source: "my_script",
agent: "my_agent",
});
const fact = await client.query("project/my-app", "status");User Operating Rules
Rules are trigger-based instructions that surface only when the agent is about to do a relevant task (e.g. releasing, pushing to CI). Unlike project policies which are always injected, rules match against the current context using keyword triggers.
# Create a rule via MCP (iranti_write_rule tool) or the API
# Example: remind the agent to use GitHub Releases instead of npm publish
# triggers: ["publish", "release", "npm"]
# enforcement: "hard" (required) or "soft" (guidance)
# List all rules
iranti list-rules
# Remove a rule
iranti delete-rule no_npm_publishRules are stored as rule/* entities. During iranti_attend, triggers are matched against the current conversation context — single-word triggers match as tokens, multi-word triggers match as phrases.
Diagnostics
iranti doctor # Validate database, API key, and provider
iranti status # Show known instances and project bindings
iranti chat # Interactive chat shell for sanity checking
iranti upgrade --check # Check for available updates
iranti upgrade --yes # Apply updatesOperator-facing CLI help now includes short "what it does" and "use this when" guidance for every command — run iranti --help or iranti <command> --help for details.
Configuration
Environment variables (set during iranti setup or manually in .env):
Variable | Description |
| PostgreSQL connection string (pgvector required) |
| Server authentication key |
|
|
| API port (default: |
| Watch escalation files and auto-run maintenance ( |
Uninstall
iranti uninstall --dry-run # Preview what would be removed
iranti uninstall --all --yes # Remove runtime + project bindingsGuides
Links
License
AGPL-3.0-or-later
Available Tools
16 toolsiranti_attendA
Ask Iranti whether memory should be injected before the next LLM turn. REQUIRED CALL SEQUENCE — follow this every turn, regardless of host:
Call with phase='pre-response' BEFORE replying to the user.
Call BEFORE any lookup tool (Read, Grep, Glob, Bash, WebSearch, WebFetch) where Iranti might already hold the answer. When you do, pass the pendingToolCall field so Iranti can derive entity hints from the tool target (file, URL, query) and preempt the lookup with stored facts.
If you just ran Edit/Write/Bash/WebSearch/WebFetch since your last iranti_write, call iranti_write FIRST — then attend.
Call with phase='post-response' AFTER every reply, without exception.
If the user is asking you to recall a remembered fact (preference, decision, blocker, next step, prior project detail), use this before answering instead of guessing or saying you do not know. Returns an injection decision plus any facts that should be added to context if relevant memory is missing. If no handshake has been performed yet for this agent in the current process, attend will auto-bootstrap the session first and report that in the result metadata. This is the minimum safe pre-reply call even when the host skipped handshake. Omitting currentContext falls back to the latest message only; pass the full visible context when available. For host compatibility, message is accepted as an alias for latestMessage. When phase='post-response', pass the assistant response so Iranti can persist strict continuity facts and shared checkpoint state before closing the turn.
Inputs: latestMessage, message, currentContext, entityHints, +7 more.
iranti_checkpointA
Persist a shared progress checkpoint while you work. Use this at meaningful milestones so current step, next step, open risks, recent outputs, structured actions, and shared entity state survive across turns, sessions, and agents. This is the strongest shared-RAM tool for active work: prefer it over ad-hoc prose when you need another session or another agent to pick up where you left off. If entityTargets are supplied, Iranti also writes canonical shared state such as current_step, next_step, open_risks, recent_actions, and recent_file_changes to those entities for handoff.
Inputs: task (required), recentMessages, currentStep, nextStep, +9 more.
iranti_handshakeA
Initialize or refresh an agent's working-memory brief for the current task. Call this at session start or when a new task begins, passing the task and recent messages. Returns operating rules plus prioritized relevant memory for that task. If the recent messages appear to contain durable facts that are not yet in shared memory, the result may include a backfill suggestion. If your host does not support a true session-start hook, call this on the first user turn before you start answering recall-style questions. Do not use this as a per-turn retrieval tool; use iranti_attend.
Inputs: task (required), recentMessages, agent, agentId, +2 more.
iranti_historyA
Retrieve the full version history of a fact for an exact entity+key pair. Returns all archived past values plus the current value, ordered oldest-first. Each entry includes value, summary, confidence, source, validFrom, validUntil, isCurrent, archivedReason, and resolutionState. REQUIRED: call iranti_attend before this discovery tool so Iranti can decide whether memory should be injected first. Use this to understand how a fact evolved over time — decisions that changed, blockers that were resolved, values that were contested or superseded.
Inputs: entity (required), key (required), limit, includeExpired, +3 more.
iranti_ingestC
Ingest a raw text block and let the Librarian chunk it into atomic facts.
Inputs: entity (required), content (required), confidence, source, +2 more.
iranti_observeB
Recover relevant facts that have fallen out of Claude context.
Inputs: currentContext (required), entityHints, maxFacts, agent, +1 more.
iranti_queryA
Retrieve the current fact for an exact entity+key lookup. REQUIRED: call iranti_attend before this discovery tool so Iranti can decide whether memory should be injected before exact lookup. Use this when you already know both the entity and the key. Returns the current value, summary, confidence, source, and temporal metadata when available. Prefer this over iranti_search when the target fact is already known, and do not answer from memory alone before checking Iranti.
Inputs: entity (required), key (required), agent, agentId.
iranti_relateC
Create a relationship edge between two entities.
Inputs: fromEntity (required), relationshipType (required), toEntity (required), propertiesJson, +1 more.
iranti_remember_responseA
Persist a strict durable summary from your own response. Use this after you decide to say something like "the next step is ...", "the blocker is ...", "we decided ...", or "the current owner is ...". This uses the same narrow summary extractor as the Claude Stop hook, but it is explicit and works for Codex or any MCP client. Do not use this for arbitrary prose or every turn.
Inputs: response (required), projectEntity, personalEntity, source, +3 more.
iranti_searchA
Search shared memory with natural language when the exact entity or key is unknown. Uses hybrid lexical and vector search across stored facts. Use this for discovery and recall, not exact lookup. REQUIRED: call iranti_attend before this discovery tool so Iranti can decide whether memory should be injected before search. If the user asks what they previously told you and you do not know the exact key, use this before saying you do not know.
Inputs: query (required), entityType, entityId, limit, +5 more.
iranti_who_knowsA
List which agents have written facts about an entity. REQUIRED: call iranti_attend before this discovery tool so Iranti can decide whether memory should be injected before provenance discovery.
Inputs: entity (required), agent, agentId.
iranti_writeA
Write one durable fact to shared memory for a specific entity. TIMING: Call IMMEDIATELY when a fact is confirmed — do not batch or defer to end of turn. One call per finding. If you edited a file, write before the next action. If you ran a command and got a result, write before the next action. If you got a search result, write before moving on. Use this when you learned something concrete that future turns, agents, or sessions should retain. Requires: entity ("type/id"), key, value JSON, and summary. Confidence is optional and defaults to 85. Conflicts on the same entity+key are detected automatically and may be resolved or escalated. Personal-memory keys honor the configured canonical personal entity for this project/session. Use properties JSON when you need structured issue or workflow metadata such as issueStatus=open|resolved, severity, or resolution notes.
Inputs: entity (required), key (required), valueJson (required), summary (required), +7 more.
iranti_write_issueA
Write a canonical open or resolved issue fact on a stable key. Use this when you want defects, bugs, or chores to remain first-class shared memory instead of loose prose. The same issueId always maps to the same issue_ key, so changing status from open to resolved archives the prior state automatically while preserving history. Prefer this over hand-rolling issueStatus properties through iranti_write when the fact is specifically a trackable issue lifecycle entry.
Inputs: entity (required), issueId (required), title (required), status (required), +12 more.
iranti_write_ruleA
Write a task-scoped user operating rule with trigger keywords. Rules surface during iranti_attend only when the current context matches one or more trigger keywords. Use this for recurring guidelines that should be applied to specific task types (e.g. "always use GitHub Releases, not npm publish" triggered by "release", "publish", "npm"). Rules are stored as rule/<rule_id> entities and persist across sessions.
Inputs: ruleId (required), rule (required), triggers (required), scope, +4 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
16 tool updates
v0.3.37- First observed
iranti_attend - First observed
iranti_checkpoint - First observed
iranti_handshake - First observed
iranti_history - First observed
iranti_ingest - First observed
iranti_observe - First observed
iranti_query - First observed
iranti_relate - First observed
iranti_related - First observed
iranti_related_deep - First observed
iranti_remember_response - First observed
iranti_search - First observed
iranti_who_knows - First observed
iranti_write - First observed
iranti_write_issue - First observed
iranti_write_rule
TDQS
Scored across 16 tools
Most tools have distinct purposes, but there is some overlap between iranti_observe and iranti_search (both retrieve facts) and between iranti_write and iranti_write_issue/iranti_write_rule (all write facts). The descriptions clarify differences, but an agent might initially confuse these pairs.
All tools follow a consistent iranti_verb or iranti_verb_noun pattern, using snake_case throughout. The naming is highly predictable, with clear prefixes and descriptive suffixes.
16 tools is slightly high but reasonable for a memory management system, covering handshake, checkpointing, querying, writing, and history. It might feel heavy, but each tool appears to serve a specific role in the workflow.
The toolset provides comprehensive coverage for memory operations: initialization (handshake), per-turn checks (attend), CRUD operations (write, query, search), history (history), relationships (relate, related), and specialized writes (issue, rule). No obvious gaps exist for the domain.
Maintenance
Related MCP Connectors
Shared memory for coding agents. Stop re-explaining your codebase every session.
Persistent memory for AI agents. Search and store durable facts, preferences and decisions.
Persistent memory for AI agents, for code, research and everyday life. Stale facts retire.
Persistent cross-session memory shared by Codex, Claude Code, ChatGPT, and other AI agents.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceProvides AI coding agents with persistent, graph-connected memory across projects, enabling cross-project context retrieval via synaptic connections and hybrid search.10 npm8MIT
- AlicenseNot gradedqualityBmaintenanceProvides persistent, local-first memory with knowledge graph and hybrid search for AI coding agents, reducing token usage by storing decisions, patterns, and codebase context.55 PyPI10MIT
- AlicenseNot gradedqualityDmaintenanceProvides long-term memory for AI coding agents, enabling them to remember, search, and organize information across sessions and platforms like Claude Code, ChatGPT, and Cursor.16 npm8MIT
- AlicenseNot gradedqualityBmaintenancePersistent memory for AI coding agents that stores and recalls preferences, decisions, and conventions via semantic similarity, with zero cloud dependencies and plug-and-play MCP integration for Claude Code.Apache 2.0