2026-03-26-request-pattern-fingerprinting

Request Pattern Fingerprinting

Date: 2026-03-26 Phase: 085-request-pattern-fingerprinting Systems: intelligence engine, pattern store, API, SDK-TS, SDK-PY, MCP

What

New intelligence subsystem that fingerprints each request into a bounded pattern space (~500 distinct patterns via bucketing) and tracks per-pattern x model success rates, latency, cost, and quality. Surfaced via GET /v1/intelligence/patterns.

Why

The router needs to learn which models work best for which types of requests. Thompson sampling operates per-model, but pattern fingerprinting adds a request-type dimension — tool-heavy code tasks may succeed with different models than simple chat. This data feeds into smarter routing decisions.

Pattern Dimensions

DimensionBuckets
has_toolstrue/false
tool_count0, 1-5, 6-15, 16+
message_count1, 2-5, 6-20, 21+
estimated_tokenssmall (<4K), medium (4K-32K), large (32K-128K), huge (128K+)
task_typecode, chat, analysis, creative, reasoning, general, etc.
has_system_prompttrue/false
has_imagestrue/false

Implementation

  • src/router/intelligence/pattern-fingerprint.ts — Core engine: fingerprinting, hashing, in-memory PatternStore with eviction
  • src/api/routes/intelligence-patterns.tsGET /v1/intelligence/patterns with query filters
  • src/api/server.ts — Route mount + patternStore option on CreateApiAppOpts
  • MCP: br_request_patterns tool for agent access
  • SDK-TS: client.intelligence.patterns() method
  • SDK-PY: client.intelligence.patterns() sync + async

Lockstep Checklist

  • [x] API: New route + server mount
  • [x] Tests: Bucketing, fingerprinting, hashing, store aggregation, filtering
  • [x] Docs: This ship log
  • [x] SDK-TS: patterns() method on Intelligence resource
  • [x] SDK-PY: patterns() on both sync and async classes
  • [x] MCP: br_request_patterns tool + manifest entry + agents.json
  • [x] CLI: N/A
  • [x] GTM: N/A
  • [x] Dashboard: N/A