Core concepts

Agent file ingestion

Turn a CLAUDE.md or AGENTS.md into individual, retrievable memories.

llms.txt

Ingest a CLAUDE.md, AGENTS.md or .cursorrules once and the engine parses it into individual memories: each rule gets a type, section tags, and where it governs an action, a trigger:<action> tag. Nothing is pinned to every prompt. Rules arrive through the normal retrieval channels when they are relevant, instead of the whole file riding along on every turn.

Measured on four real public agent files (OpenAI's codex, Kiali, Temporal, and a held out file from Freerouting), retrieval delivered 100 percent of the tested rules at 2 to 8 times fewer tokens than carrying the file. The 70 KB file carried whole followed only 80 percent of its own rules. Read the full write-up.

Embedded

One call. Your workflow does not change: the file stays the source of truth, you keep editing it as always, and re-running ingest keeps memory in sync. New rules are stored, unchanged rules deduplicate, edited rules replace their old version, and rules you deleted from the file are forgotten (the report counts them as removed). Pass sync: false to turn removal off, and give each file its own source_tag when several files share one agent.

Python
report = db.ingest_agent_file(open("AGENTS.md").read())
# 606 memories, 96 action triggers, 0 pinned to every prompt

Hosted

Call the ingest_agent_file tool. Large files parse in the background: pass async and poll get_ingest_status with the returned job id.

Terminal
curl -X POST https://api.mentedb.com/mcp/v1/tools/call \
  -H "Authorization: Bearer $MENTEDB_API_KEY" \
  -H "content-type: application/json" \
  -d '{"name":"ingest_agent_file","arguments":{"content":"<file text>","async":true}}'
Terminal
curl -X POST https://api.mentedb.com/mcp/v1/tools/call \
  -H "Authorization: Bearer $MENTEDB_API_KEY" \
  -H "content-type: application/json" \
  -d '{"name":"get_ingest_status","arguments":{"job_id":"<job id>"}}'

How the rules come back

Topic rules surface through recall when the conversation touches them. Rules about performing an action, commit style, push policy, fire through action rules at the moment of the action. Standing directives, the rules that apply to a whole activity like writing or reviewing, are stored with exemplars so they activate whenever that activity starts. The result is the handful of rules that govern the current change, not the file.

Wire it into a new agent

The whole lifecycle is three calls: ingest at startup (and whenever the file changes), retrieve per turn, fetch action rules at the moment of a tool call.

Python
from mentedb import MenteDB
import uuid

db = MenteDB("./agent-memory")
AGENT = str(uuid.uuid5(uuid.NAMESPACE_URL, "myapp:coding-agent"))

# Startup, and again whenever AGENTS.md changes: memory mirrors the file.
db.ingest_agent_file(open("AGENTS.md").read(), agent_id=AGENT)

def build_system_prompt(task):
    # Per turn: only the rules that govern this task ride along.
    rules = db.recall_for_injection(task, k=8, agent_id=AGENT)
    return "Repository rules:\n" + "\n".join(
        f"- {r['content']}" for r in rules)

def rules_for(action):
    # At the tool moment (git-commit, order-refund): deterministic, no model call.
    return db.recall_for_action(action, agent_id=AGENT, k=6)

Hosted, it is the same flow through the three tools shown above: ingest_agent_file (async for large files), get_injection_context per turn, and get_action_rules at the action. For rules whose relevance only appears once a draft exists, like a translation rule that fires on a hardcoded label, run retrieval a second time against the draft and revise; that second pass is what carried the benchmark to 100 percent.