Skip to content

Agent Skills

Per-agent accumulated knowledge that grows with every completion — the first router that stores, injects, and evolves agent skills.

# Agent Skills

BrainstormRouter is the first AI gateway to store per-agent skills that accumulate from real work. Every agent gets a skill profile that grows with use, is injected transparently into prompts, and is versioned over time.

What Makes This Novel

Existing approaches solve pieces of the puzzle:

  • Anthropic Agent Skills (Dec 2025) defines a standard for skills, but they're static — manually authored, never accumulated.
  • Memory-Augmented Routing (arxiv 2603.23013) proves retrieval-augmented routing achieves near-frontier quality at 96% cost reduction, but retrieves conversations, not procedural knowledge.
  • Procedural Memory (ICLR 2026 MemAgents) stores learned procedures per-agent, but in the agent itself — not in routing infrastructure.

BrainstormRouter combines all three: skills are stored in the router, injected at routing time, accumulated automatically from completions, and versioned for observability. The router becomes the intelligence accumulation layer.

How It Works

Skill Storage

Each agent's skill is stored in the metadata.skill field of their agent profile — a JSONB column that's already cached in-memory for O(1) hot-path access.

A skill contains:

  • domain — the agent's area of expertise (e.g., "api-security", "compliance", "architecture")
  • coreKnowledge — persistent domain expertise seeded from SOUL.md or manual input
  • learnedPatterns — accumulated from completions (FIFO, max 20)
  • projectContext — project-specific knowledge (FIFO, max 10)
  • standards — frameworks and standards the agent applies (max 10)
  • totalCompletions — how many times this agent has been called
  • version — auto-incremented on every update

Skill Injection

When an agent makes a completion request through BR, the skillInjectorMiddleware runs after memory injection but before guardrails. It loads the agent's skill from the in-memory cache and prepends it as a [Agent Skill Context] section in the system prompt.

This is completely transparent to the agent — they don't need to request their skill or manage it. BR injects it automatically.

Skill Accumulation

After every completion, BR increments the agent's totalCompletions counter. Every 5th completion, the skillAccumulator fires asynchronously:

1. Extracts the assistant's response content

2. Routes a lightweight extraction call through auto:floor (cheapest available model)

3. The extraction prompt asks: "What reusable patterns should this agent remember?"

4. Extracted patterns are appended to learnedPatterns with FIFO eviction at 20

Cost: ~$0.0001 per extraction. At $31/day agent spend, extraction adds less than 1%.

Skill History

Every skill update is recorded in the agent_skill_history table with a trigger type (accumulation, manual, seed). This creates a timeline of how each agent's knowledge evolved.

MCP Tools

Four new MCP tools for skill management:

  • br_get_agent_skill — read an agent's current skill
  • br_update_agent_skill — manually update skill patterns (merge semantics)
  • br_list_agent_skills — list all agents and their skill summaries
  • br_get_skill_history — view skill evolution timeline

Response Headers

When skills are injected, BR adds observability headers:

  • X-BR-Skill-Domain — the injected skill's domain
  • X-BR-Skill-Version — skill version number
  • X-BR-Skill-Patterns — count of learned patterns injected

Seeding Skills

Initial skills can be seeded from agent identity files (SOUL.md) using the br_update_agent_skill MCP tool or the REST API. The Living Case Study seeds skills for all 10 agents from their SOUL.md files.

Architecture

The skill system is built on 6 layers:

1. Skill Storageagent_profiles.metadata.skill (JSONB, no schema change)

2. Skill Injectionskill-injector.ts middleware in the completion chain

3. Skill Accumulationskill-accumulator.ts post-completion async extraction

4. Skill Historyagent_skill_history table for versioning

5. MCP Tools — 4 tools for reading, updating, listing, and history

6. Middleware Wiring — runs after memory injection, before guardrails

All 6 layers are fail-open — skill errors never block requests.