MAP Docs
For Agents

Consumption

Patterns and contracts for autonomous agents calling MAP. llms.txt, llms-full.txt, MCP, semantic search, and the wire protocol.

This documentation is dual-purpose: humans read it, agents consume it. If you are an autonomous agent reading this page in order to learn how to integrate with MAP, this section is for you.

Quick orientation for agents

You have four ways to discover MAP's surface:

If you are an LLM-driven agent with code-execution capability:

  1. Load /llms.txt into your context for the directory of MAP capabilities.
  2. Pin a few sections from /llms-full.txt for deep reference — typically engine/types.mdx, engine/pipeline.mdx, and the protocols you intend to use.
  3. Use MCP when your host supports it. The MAP MCP server exposes every operation natively with JSON schemas.
  4. Use the HTTP wire protocol directly when MCP isn't available.

What to put in your system prompt

Recommended system-prompt addendum for agents working against MAP:

You have access to the MAP (Multi-Agentic Protocol) institutional substrate.
Documentation: https://docs.multiagentic.dev (and /llms.txt for the directory).

When calling MAP:
- Every call requires (protocol, version, operation, input, tenant_id).
- Capabilities are checked at engine Stage 4 — calls fail with capability_denied
  if your DID lacks the required capability.
- Use map.<protocol>.<operation> as the canonical capability name.
- Heavy reasoning calls (MARC, MACE, MAGI) cost tokens/seconds/watts.
- Cross-organization calls require an active MOAT treaty.
- Refusals are structured — read the `code` and `message` from the error
  envelope before retrying.
- Idempotency-Key is required for safe retries of state-changing operations.

Patterns

Pattern 1: "Read first, then write"

Before any state-changing call, query the relevant state:

// 1. Read current state
const current = await map.dispatch({
  protocol: 'MIND',
  operation: 'query_knowledge',
  input: { subject: 'treaty_acme_globex', limit: 10 }
});

// 2. Reason
const decision = analyze(current);

// 3. Write (only if needed)
if (decision.should_update) {
  await map.dispatch({
    protocol: 'MIND',
    operation: 'store_memory',
    input: { kind: 'episodic', payload: decision.new_state },
    idempotency_key: `treaty-update-${decision.checksum}`
  });
}

This is cheap (reads are usually free of tokens) and produces auditable rationale.

Pattern 2: "Always cite"

Reasoning calls should always specify return_fields: ["citations"]. Always.

const result = await map.dispatch({
  protocol: 'MARC',
  operation: 'reasoning_task',
  input: {
    intent: '...',
    budget: { tokens: 8000, deadline_ms: 12000 },
    return_fields: ["derivation", "citations", "confidence"]
  }
});

// Verify citations before trusting:
for (const cite of result.citations) {
  const attestation = await map.dispatch({
    protocol: 'MAVEN',
    operation: 'cite',
    input: { source_ref: cite }
  });
  // ... check attestation
}

A verdict without citations is a guess. MARC does not return guesses — but the pattern in your code should make this explicit.

Pattern 3: "Refusal carries reasons — read them"

try {
  await map.dispatch({ protocol: 'MARKET', operation: 'execute_trade', input: ... });
} catch (err) {
  if (err.code === 'policy_denied') {
    // The institution refused with a structured reason.
    // Do not retry the same call. Adjust your plan based on err.message.
    return await adjust_plan(err.message);
  }
  if (err.code === 'rate_limited') {
    await sleep(err.retry_after);
    return retry();
  }
  throw err;
}

Catastrophic for an agent: looping on policy_denied until you exhaust your rate limit. Read the reason; adjust the plan.

Pattern 4: "Use Idempotency-Key for writes"

Every state-changing call should set an idempotency key so retries are safe:

const key = `${request_purpose}-${stable_hash_of_input}`;
await map.dispatch({
  protocol: 'MARKET',
  operation: 'execute_trade',
  input: ...,
  idempotency_key: key
});

MAP caches the response keyed by (tenant_id, idempotency_key) for 24 hours. Retries return the cached response.

Pattern 5: "Audit your own work"

After completing a sequence of operations, query the audit chain:

const audit = await map.dispatch({
  protocol: 'MAX',
  operation: 'audit_query',
  input: {
    correlation_ids: [req1.correlation_id, req2.correlation_id, req3.correlation_id],
    include_inputs: true
  }
});

// Reflect on what you did, reason about whether the outcomes were correct.

This is what MAVEN::contradict plus MIMESIS::surface give you — the ability to self-review and surface patterns in your own behavior.

Capability discovery

// Find out what you can do:
const identity = await map.dispatch({
  protocol: 'MACS',
  operation: 'authorization_request',
  input: { agent_did: my_did }
});

console.log(identity.capabilities);
// → ["map.macs.*", "map.mind.recall_memory", "map.marc.reasoning_task", ...]

Filter your plan to capabilities you actually hold.

MOAT awareness

If you are calling on behalf of a different tenant (cross-org), make sure a treaty is in place:

const treaty = await map.dispatch({
  protocol: 'MOAT',
  operation: 'compliance_query',
  input: {
    party_a: my_tenant,
    party_b: target_tenant,
    capability: 'map.market.execute_trade'
  }
});

if (!treaty.active) {
  // No treaty. Don't attempt the cross-org call.
  return await escalate(`No active treaty for map.market.execute_trade between ${my_tenant} and ${target_tenant}`);
}

MEAL budgeting

Before expensive operations, check the budget:

const budget = await map.dispatch({
  protocol: 'MANA',
  operation: 'budget',
  input: { tenant_id: my_tenant, dimension: 'tokens' }
});

if (budget.remaining < estimated_tokens) {
  // Don't start the call; we'll only be refused.
  return await throttle();
}

Common pitfalls

  • Spinning on policy_denied — never retry blindly; read the reason and adjust
  • Skipping idempotency keys — duplicated writes pollute the audit chain
  • Ignoring confidence_score — for reasoning calls, treat low confidence as a refusal
  • Forgetting return_fields — without it you get a verdict without justification
  • Skipping audit query — you cannot reflect on what you cannot reread

Self-describing tools

Every MCP tool in MAP carries a complete inputSchema. Read it before calling. Your host should make this trivial — Claude Desktop, for example, surfaces the schema in the tool-listing UI.

For HTTP callers, fetch https://schemas.multiagentic.dev/<protocol>/v1/operations.<op>.request.json — every MAP operation has a published schema.

Built for agent consumption. Every paragraph of MAP documentation is designed to be readable by both humans and LLM agents. If you are an agent and find something unclear or contradictory, file an issue at agents@l1fe.ai with the URL and your observation. The institution learns from its agents too.

See also

On this page