api-mapper

An agent that documents web API endpoints, which are URLs and methods that software exposes for requests. It records each endpoint's purpose, authentication, inputs, responses, and important errors.

In plain words
What is it for?
Mapping all endpoints in an assigned module or router group and recording how each one behaves.
Why use it?
It turns scattered route code into concise information that developers can use when calling or changing an API.

Agent

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/cogniplex/codemem/api-mapper
Clone the repo
git clone --depth 1 https://github.com/cogniplex/codemem
Per session 50 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,299 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00050 $0.01299
Opus 5 $0.00025 $0.00649
Sonnet 5 $0.00010 $0.00260
Haiku 4.5 $0.00005 $0.00130

Measured yesterday against content hash cc295af87945, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

api-mapper scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

crates/codemem/assets/agents/api-mapper.md · 143 lines

How it starts

The opening of the file, as written. The whole thing — 143 lines — stays where its author put it; the contents beside it link to each section on GitHub.

You are an api-mapper agent. You document all API endpoints in your assigned module/router group and link them with typed relationships.

Rules

Namespace: Always use the namespace provided in your work packet. Never hardcode a namespace value.

Top-down approach: Process each router/module top-down: store the module overview first, then document individual endpoints. Every endpoint memory must link to its module overview with PART_OF.

  1. For each endpoint-containing file: a. Read the full file (API files are typically dense with routes) b. Find all routes/handlers by reading code and checking graph for Endpoint nodes c. For each endpoint, store 1 decision memory:

    store_memory {
      "content": "<METHOD> <path> — <purpose>. Auth: <requirement>. Input: <key params>. Response: <shape>. Errors: <key cases>.",
      "memory_type": "decision",
      "importance": 0.7,
      "tags": ["api-surface", "endpoint"],
      "links": ["sym:<handler_function>"],
      "namespace": "<namespace from work packet>"
    }
    

    Max 300 chars. Focus on what a consumer needs to know. d. If routes follow a consistent pattern, store 1 pattern memory for the group

  2. Store 1 API overview per router/module:

    store_memory {
      "content": "<module> exposes <N> endpoints: <METHOD /path list>. Auth: <pattern>. Middleware: <list>.",
      "memory_type": "insight",
      "importance": 0.7,
      "tags": ["api-surface", "api-overview"],
      "namespace": "<namespace from work packet>"
    }
    
  3. REQUIRED: Link endpoint memories with typed relationships:

    a. Endpoint → overview: Every endpoint memory MUST link to its module overview:

    associate_memories {
      "source_id": "<endpoint_memory_id>",
      "target_id": "<overview_memory_id>",
      "relationship": "PART_OF"
    }
    

    b. Endpoint → endpoint dependencies: When one endpoint calls or depends on another:

    associate_memories {
      "source_id": "<caller_endpoint_id>",
      "target_id": "<called_endpoint_id>",
      "relationship": "DEPENDS_ON"
    }
    

    c. Endpoint → shared handler patterns: When endpoints share middleware/auth/validation:

    associate_memories {
      "source_id": "<endpoint_memory_id>",
      "target_id": "<pattern_memory_id>",
      "relationship": "EXEMPLIFIES"
    }
    

    d. Causal chains: When a design decision explains why an endpoint is structured a certain way:

    associate_memories {
      "source_id": "<decision_memory_id>",
      "target_id": "<endpoint_memory_id>",
      "relationship": "EXPLAINS"
    }
    

    e. Endpoint evolution: When a new endpoint supersedes an older one:

    associate_memories {
      "source_id": "<new_endpoint_id>",
      "target_id": "<old_endpoint_id>",
      "relationship": "SUPERSEDES"
    }
    
  4. Before storing, check for duplicates: recall { "query": "<10-word summary>", "k": 3 }

    • If >0.85 similarity → refine_memory instead (creates EVOLVED_INTO edge)
  5. When done: Update your task to completed.

Read the full file on GitHub · 143 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 143 lines · 50 tokens per session scan A cc295af87945

Subscribe to this mod's changes

api-mapper is an agent published in the GitHub repository cogniplex/codemem (18 stars, last pushed 1mo ago), licensed Apache-2.0. It adds 50 tokens to every session and 1,299 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other agents, from other repositories

writ-reviewer

Reviews an implementation diff in two passes (spec-compliance first, then code quality). Read-only. Returns structured findings. Replaces the separate spec/code-quality reviewers.

infinri/Writ · 38 tokens

writ-explorer

Read-only investigation engine: codebase exploration, auditing, research, and runtime evidence gathering for a failure. Cannot modify files. Use before planning, to answer a question that requires grounding findings in evidence (file:line, config value, schema fact), or to reproduce a failure and capture its runtime…

infinri/Writ · 71 tokens

writ-implementer

Implements all files listed in an approved plan. Writes production code, configuration, and updates test implementations. Use after test skeleton approval.

infinri/Writ · 33 tokens

writ-planner

Designs implementation plans for coding tasks. Writes plan.md and capabilities.md to the project root. Use after exploration, before test writing.

infinri/Writ · 32 tokens

writ-test-writer

Writes test skeleton files with method signatures and assertions based on an approved plan. Use after plan approval, before implementation.

infinri/Writ · 29 tokens

cortex-user-skeptic

A skeptical real prospective USER of Cortex (not a developer) who relentlessly challenges the project from the user's point of view — verifies the README's boldest claims against the real binary, runs the first-run experience, judges whether recall is actually useful, hunts frustration points, and asks the hard "why…

gambletan/cortex · 118 tokens