Skill Router and Investigation API
Agents

Skill Router and Investigation API

Skip to main content
Table of Contents
< All Topics
Print

Skill Router and Investigation API

Last updated: November 20, 2026

What it is

Two connected services run on our backend.

  • The Skill Router decides which of our methodology skills to hand to the AI for a given question. A skill is a written method: how to read a campaign finance record, how to check a claim, how to weigh a source. The router chooses a few and adds short excerpts to the AI’s instructions. The The Rights Advisor AI uses it when it answers a question.
  • The Investigation API is a small set of endpoints that help plan an investigation, look up entities in our knowledge base, and find tools. Next to it sit two search endpoints, one for our research corpus and one for our speeches corpus.

None of this publishes anything. It selects, plans and searches.

When it runs

Per request. The router runs once for each message the Rights Advisor receives, and it can also be called directly. The Investigation API and the search endpoints run when someone calls them. Nothing here is on a schedule. All of these endpoints accept a token, as described in The Rights Advisor AI.

What it does

How the Skill Router picks skills

The router works in three stages.

  1. Tag filter. The question is split into words, plus pairs of neighboring words joined with a hyphen. Each skill in the index carries a list of inject_on tags, which are the topics it is good for, and a weight (injection_weight). A skill’s score is how much of each tag the question matches, multiplied by the weight. A looser match on a shared word stem earns half credit. A skill can also list do_not_inject_on tags. If the whole of one of those tags appears in the question, the skill is dropped. The rule applies only when the whole tag is present, so a loose match cannot drop a skill by accident. The 15 highest scorers go forward.
  2. Claude picks the final set. If more than five candidates remain, a smaller, faster Claude model is shown each candidate’s name and a short description and asked to choose up to five. It is asked to pick skills that complement each other rather than repeat each other. If that call fails, the router falls back to the five top-scoring candidates.
  3. Load the method. For each chosen skill, the router reads its Instructions section. It cuts each skill to 1,500 characters and the whole set to 6,000 characters, and adds them to the AI’s instructions.

The router reloads its index every five minutes. The index file is built by scripts/build_skill_index.py. Tags for methodology skills are generated in a one-time Claude pass, and the build merges previously generated tags by default.

As of November 20, 2026, the index file lists 109 methodology skills, measured from its type field. Their weights run from 3 to 5. A question that matches no tags gets no skills.

One practical catch. The index and the skill files on the live service are updated together by a deliberate step (make deploy-skills). A skill that is in the index but has no file on the live service is selected and then injects nothing.

How editors use the same logic

Editors run make route Q="". This runs the same tag filter against the same index, offline and without any key, and prints the ranked skills with the path to each skill file. Adding LLM=1 adds the Claude selection stage. The tool also lists team-only skills the live service never sees, unless run with a public-only option. See scripts/ca_route.py.

The Investigation API

  • Workflow composer (/investigate/workflow). You send an investigative question of at least 10 characters, with optional context. Claude returns a structured plan: the question restated as a hypothesis that could be proved wrong, ordered steps, each with the skill to use, the action, the tools to try, the minimum evidence needed before moving on, and what would make the step a dead end and where to pivot. It adds confidence checkpoints between stages and an estimate of complexity. The plan is built from the patterns in Investigation Workflow Designer. It plans only. It does not go and run any of the steps.
  • Entity lookup (/investigate/entity-lookup). Searches our knowledge base for a name or term, with an optional category filter and up to 50 results. It uses the same index and keyword scoring as the Rights Advisor’s retrieval.
  • Tool recommender (/investigate/tool-recommend, with /investigate/tool-areas to list the areas). Filters our tool catalog by functional area, by skill, or by a word in the tool’s name or notes. As of November 20, 2026, the catalog file lists 211 entries across 50 areas. Ten entries are marked deprecated, and the recommender never returns those.

The workflow, lookup and tool endpoints do not call outside data services other than Claude.

Our published workflow templates, indexed in Investigation Workflow Templates (n8n), refer to these endpoints.

Research and speech search

  • Research search (/research/search) searches our research document corpus. In its default mode it combines meaning-based matching with keyword matching, weighting the first at 70 percent unless told otherwise. Other modes search community summaries, trace relationships in the entity graph, combine everything, or let the service classify the question and choose.
  • Speech search (/speeches/search) does the same hybrid search over speeches, with filters for speaker, event type, genre, transcript quality and date range. The API also serves a document’s extracted claims and language features.

Both return the matching passage with its source details, so a result can be checked against the original.

Skills and models it uses

  • Models. Claude writes investigation plans. The router uses a smaller, faster Claude model for its selection step.
  • Skills. The router’s catalog is the methodology skill index. Investigation Workflow Designer is the skill behind the workflow composer.

Rules and gates it obeys

  • A plan is not evidence. The composer’s prompt asks for evidence tiers on every step: Documented, Credibly Reported or Alleged. Our rules on those tiers are in AI and Research Runtime Guardrails. The plan only says what to look for. What a person finds must still meet those rules.
  • Size limits. Questions, queries and result counts are capped, as listed above.
  • Retrieval filters. Entity lookup uses the same index as the Rights Advisor, which leaves out drafts and other non-public statuses, internal-audience documents and staging folders.
  • Refusals surface. If Claude declines a request, the service reports that rather than returning an empty plan.

What it may never do

  • Run an investigation, file a request, contact anyone or publish a finding. These endpoints return text and search results.
  • Treat a generated plan as a finding.

Where a human decides

  • Which skills exist and how they are tagged. Editors write and review skills and push the index live.
  • Whether to follow a plan. The composer gives a suggestion. A reporter decides what to do with it, and a person judges the evidence.
  • Anything that is published. Nothing from these services reaches readers except as chat answers, covered in The Rights Advisor AI.

Agents that do investigative work for editors are described in The Research Worker and the Document Auditor.

Factual correction requests: If you believe information in this page is incorrect, please contact factcheck@citizenanalyst.ai with your name (optional), the specific claim, and any supporting documentation. We review all submissions and correct verified errors promptly.

Was this article helpful?
0 out of 5 stars
5 Stars 0%
4 Stars 0%
3 Stars 0%
2 Stars 0%
1 Stars 0%
5
Please Share Your Feedback
How Can We Improve This Article?