Skip to content

AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.

fix(backend/copilot): find_capability finds roster experts to hire and the user's team (#15149)

Reinier van der Leer096fc9c30687
diff --git a/autogpt_platform/backend/backend/copilot/capabilities/dispatch.py b/autogpt_platform/backend/backend/copilot/capabilities/dispatch.py
index 6f3c463f94..7d2a071f58 100644
--- a/autogpt_platform/backend/backend/copilot/capabilities/dispatch.py
+++ b/autogpt_platform/backend/backend/copilot/capabilities/dispatch.py
@@ -13,7 +13,7 @@ from typing import TYPE_CHECKING, Any, NamedTuple
from backend.copilot.capabilities.registry import configured_tool, get_registry
from backend.copilot.capabilities.resolve import resolve_entry
-from backend.copilot.capabilities.sources import SKILL_TOOL, skill_name
+from backend.copilot.capabilities.sources import SKILL_TOOL, expert_dispatch, skill_name
if TYPE_CHECKING:
from backend.copilot.tools.base import BaseTool
@@ -38,7 +38,9 @@ def resolve_tool_dispatch(
A ``skill:<name>`` id is the ``read_skill`` call that loads the skill,
with the name taken from the id, so a skill found by search is loaded
- through the one tool path like any other skill.
+ through the one tool path like any other skill. An ``expert:`` id is the
+ ``hire_expert`` call for that template and a ``teammate:`` id the
+ ``delegate_to_expert`` call for that expert, the id bound over the input.
Never raises: it runs on the streaming path, where a bad id must degrade to
the dispatcher's own "unknown capability" answer rather than break the turn.
@@ -50,8 +52,11 @@ def resolve_tool_dispatch(
try:
capability_id = str(args.get("id") or "")
skill = skill_name(capability_id)
+ expert = expert_dispatch(capability_id)
if skill is not None:
name, bound = SKILL_TOOL, {"name": skill}
+ elif expert is not None:
+ name, bound = expert
else:
entry = resolve_entry(get_registry(), capability_id)
if entry is None or entry.kind != "tool" or not entry.implementations:
diff --git a/autogpt_platform/backend/backend/copilot/capabilities/eval/expert_hire_dataset.json b/autogpt_platform/backend/backend/copilot/capabilities/eval/expert_hire_dataset.json
new file mode 100644
index 0000000000..f08846e6ca
--- /dev/null
+++ b/autogpt_platform/backend/backend/copilot/capabilities/eval/expert_hire_dataset.json
@@ -0,0 +1,1155 @@
+{
+ "source": "Hand-written 2026-10-02 before the first scored run (SECRT-2814); labels are roster template names, any one counts as a hit",
+ "items": [
+ {
+ "query": "product manager",
+ "group": "plain",
+ "expect": [
+ "Alex",
+ "Priya"
+ ]
+ },
+ {
+ "query": "hire expert product",
+ "group": "plain",
+ "expect": [
+ "Alex",
+ "Priya"
+ ]
+ },
+ {
+ "query": "partnerships manager",
+ "group": "plain",
+ "expect": [
+ "Anika"
+ ]
+ },
+ {
+ "query": "expert for partnerships and alliances",
+ "group": "plain",
+ "expect": [
+ "Anika"
+ ]
+ },
+ {
+ "query": "QA engineer",
+ "group": "plain",
+ "expect": [
+ "Casey"
+ ]
+ },
+ {
+ "query": "code review expert",
+ "group": "plain",
+ "expect": [
+ "Casey"
+ ]
+ },
+ {
+ "query": "video producer",
+ "group": "plain",
+ "expect": [
+ "Clip"
+ ]
+ },
+ {
+ "query": "motion graphics expert",
+ "group": "plain",
+ "expect": [
+ "Clip"
+ ]
+ },
+ {
+ "query": "financial analyst",
+ "group": "plain",
+ "expect": [
+ "Daniel"
+ ]
+ },
+ {
+ "query": "hire a finance expert",
+ "group": "plain",
+ "expect": [
+ "Daniel",
+ "Mina",
+ "Theo"
+ ]
+ },
+ {
+ "query": "application security engineer",
+ "group": "plain",
+ "expect": [
+ "Devon"
+ ]
+ },
+ {
+ "query": "dependency security expert",
+ "group": "plain",
+ "expect": [
+ "Devon"
+ ]
+ },
+ {
+ "query": "contract manager",
+ "group": "plain",
+ "expect": [
+ "Ellis"
+ ]
+ },
+ {
+ "query": "expert to manage contracts",
+ "group": "plain",
+ "expect": [
+ "Ellis"
+ ]
+ },
+ {
+ "query": "hire an ops expert",
+ "group": "plain",
+ "expect": [
+ "Frankie",
+ "James"
+ ]
+ },
+ {
+ "query": "executive assistant",
+ "group": "plain",
+ "expect": [
+ "Kai",
+ "Frankie"
+ ]
+ },
+ {
+ "query": "recruiter",
+ "group": "plain",
+ "expect": [
+ "Harper",
+ "Sofia"
+ ]
+ },
+ {
+ "query": "recruiting and hiring expert",
+ "group": "plain",
+ "expect": [
+ "Harper",
+ "Sofia"
+ ]
+ },
+ {
+ "query": "people operations specialist",
+ "group": "plain",
+ "expect": [
+ "Ines"
+ ]
+ },
+ {
+ "query": "HR expert",
+ "group": "plain",
+ "expect": [
+ "Ines"
+ ]
+ },
+ {
+ "query": "operations manager",
+ "group": "plain",
+ "expect": [
+ "James",
+ "Frankie"
+ ]
+ },
+ {
+ "query": "operations expert",
+ "group": "plain",
+ "expect": [
+ "James",
+ "Frankie"
+ ]
+ },
+ {
+ "query": "deal desk manager",
+ "group": "plain",
+ "expect": [
+ "Jordan"
+ ]
+ },
+ {
+ "query": "proposal writing expert",
+ "group": "plain",
+ "expect": [
+ "Jordan"
+ ]
+ },
+ {
+ "query": "social media manager",
+ "group": "plain",
+ "expect": [
+ "Jules"
+ ]
+ },
+ {
+ "query": "hire expert social media",
+ "group": "plain",
+ "expect": [
+ "Jules"
+ ]
+ },
+ {
+ "query": "personal assistant expert",
+ "group": "plain",
+ "expect": [
+ "Kai",
+ "Frankie"
+ ]
+ },
+ {
+ "query": "hire an executive assistant",
+ "group": "plain",
+ "expect": [
+ "Kai",
+ "Frankie"
+ ]
+ },
+ {
+ "query": "compliance analyst",
+ "group": "plain",
+ "expect": [
+ "Lena"
+ ]
+ },
+ {
+ "query": "privacy and compliance expert",
+ "group": "plain",
+ "expect": [
+ "Lena"
+ ]
+ },
+ {
+ "query": "performance marketer",
+ "group": "plain",
+ "expect": [
+ "Marco"
+ ]
+ },
+ {
+ "query": "paid ads expert",
+ "group": "plain",
+ "expect": [
+ "Marco"
+ ]
+ },
+ {
+ "query": "SEO content manager",
+ "group": "plain",
+ "expect": [
+ "Maria"
+ ]
+ },
+ {
+ "query": "SEO expert",
+ "group": "plain",
+ "expect": [
+ "Maria"
+ ]
+ },
+ {
+ "query": "account executive",
+ "group": "plain",
+ "expect": [
+ "Max"
+ ]
+ },
+ {
+ "query": "sales expert",
+ "group": "plain",
+ "expect": [
+ "Max"
+ ]
+ },
+ {
+ "query": "marketing manager",
+ "group": "plain",
+ "expect": [
+ "Maya",
+ "Zara"
+ ]
+ },
+ {
+ "query": "hire a marketing expert",
+ "group": "plain",
+ "expect": [
+ "Maya",
+ "Zara"
+ ]
+ },
+ {
+ "query": "bookkeeper",
+ "group": "plain",
+ "expect": [
+ "Mina"
+ ]
+ },
+ {
+ "query": "invoicing and bookkeeping expert",
+ "group": "plain",
+ "expect": [
+ "Mina"
+ ]
+ },
+ {
+ "query": "market research analyst",
+ "group": "plain",
+ "expect": [
+ "Nadia"
+ ]
+ },
+ {
+ "query": "competitor intelligence expert",
+ "group": "plain",
+ "expect": [
+ "Nadia"
+ ]
+ },
+ {
+ "query": "communications manager",
+ "group": "plain",
+ "expect": [
+ "Noor"
+ ]
+ },
+ {
+ "query": "PR expert",
+ "group": "plain",
+ "expect": [
+ "Noor"
+ ]
+ },
+ {
+ "query": "revenue operations analyst",
+ "group": "plain",
+ "expect": [
+ "Omar"
+ ]
+ },
+ {
+ "query": "CRM hygiene expert",
+ "group": "plain",
+ "expect": [
+ "Omar"
+ ]
+ },
+ {
+ "query": "product management expert",
+ "group": "plain",
+ "expect": [
+ "Priya",
+ "Alex"
+ ]
+ },
+ {
+ "query": "product management specialist",
+ "group": "plain",
+ "expect": [
+ "Priya",
+ "Alex"
+ ]
+ },
+ {
+ "query": "data analyst",
+ "group": "plain",
+ "expect": [
+ "Quinn"
+ ]
+ },
+ {
+ "query": "KPI analysis expert",
+ "group": "plain",
+ "expect": [
+ "Quinn"
+ ]
+ },
+ {
+ "query": "email marketing manager",
+ "group": "plain",
+ "expect": [
+ "Remy"
+ ]
+ },
+ {
+ "query": "lifecycle email expert",
+ "group": "plain",
+ "expect": [
+ "Remy"
+ ]
+ },
+ {
+ "query": "customer success manager",
+ "group": "plain",
+ "expect": [
+ "Riley"
+ ]
+ },
+ {
+ "query": "retention expert",
+ "group": "plain",
+ "expect": [
+ "Riley"
+ ]
+ },
+ {
+ "query": "customer support specialist",
+ "group": "plain",
+ "expect": [
+ "Robin",
+ "Sasha"
+ ]
+ },
+ {
+ "query": "customer support expert",
+ "group": "plain",
+ "expect": [
+ "Robin",
+ "Sasha"
+ ]
+ },
+ {
+ "query": "help desk support specialist",
+ "group": "plain",
+ "expect": [
+ "Sasha",
+ "Robin"
+ ]
+ },
+ {
+ "query": "support ticket expert",
+ "group": "plain",
+ "expect": [
+ "Sasha",
+ "Robin"
+ ]
+ },
+ {
+ "query": "recruiter for my startup",
+ "group": "plain",
+ "expect": [
+ "Sofia",
+ "Harper"
+ ]
+ },
+ {
+ "query": "hire a recruiting expert",
+ "group": "plain",
+ "expect": [
+ "Sofia",
+ "Harper"
+ ]
+ },
+ {
+ "query": "investor relations manager",
+ "group": "plain",
+ "expect": [
+ "Theo"
+ ]
+ },
+ {
+ "query": "fundraising expert",
+ "group": "plain",
+ "expect": [
+ "Theo"
+ ]
+ },
+ {
+ "query": "procurement specialist",
+ "group": "plain",
+ "expect": [
+ "Vera"
+ ]
+ },
+ {
+ "query": "vendor management expert",
+ "group": "plain",
+ "expect": [
+ "Vera"
+ ]
+ },
+ {
+ "query": "GTM strategist",
+ "group": "plain",
+ "expect": [
+ "Zara"
+ ]
+ },
+ {
+ "query": "go-to-market expert",
+ "group": "plain",
+ "expect": [
+ "Zara"
+ ]
+ },
+ {
+ "query": "someone to run my LinkedIn",
+ "group": "near",
+ "expect": [
+ "Jules",
+ "Maya"
+ ]
+ },
+ {
+ "query": "post our blog content on social",
+ "group": "near",
+ "expect": [
+ "Jules"
+ ]
+ },
+ {
+ "query": "turn my podcast into posts",
+ "group": "near",
+ "expect": [
+ "Jules",
+ "Clip"
+ ]
+ },
+ {
+ "query": "chase my unpaid invoices",
+ "group": "near",
+ "expect": [
+ "Mina"
+ ]
+ },
+ {
+ "query": "reconcile my bank statements",
+ "group": "near",
+ "expect": [
+ "Mina",
+ "Daniel"
+ ]
+ },
+ {
+ "query": "write my product spec",
+ "group": "near",
+ "expect": [
+ "Alex",
+ "Priya"
+ ]
+ },
+ {
+ "query": "prioritize our feature backlog",
+ "group": "near",
+ "expect": [
+ "Alex",
+ "Priya"
+ ]
+ },
+ {
+ "query": "review my pull requests",
+ "group": "near",
+ "expect": [
+ "Casey"
+ ]
+ },
+ {
+ "query": "write test plans for releases",
+ "group": "near",
+ "expect": [
+ "Casey"
+ ]
+ },
+ {
+ "query": "make a video ad for our app",
+ "group": "near",
+ "expect": [
+ "Clip"
+ ]
+ },
+ {
+ "query": "budget vs actuals every month",
+ "group": "near",
+ "expect": [
+ "Daniel"
+ ]
+ },
+ {
+ "query": "check our npm packages for vulnerabilities",
+ "group": "near",
+ "expect": [
+ "Devon"
+ ]
+ },
+ {
+ "query": "review an NDA against our playbook",
+ "group": "near",
+ "expect": [
+ "Ellis"
+ ]
+ },
+ {
+ "query": "track contract renewals",
+ "group": "near",
+ "expect": [
+ "Ellis",
+ "Vera"
+ ]
+ },
+ {
+ "query": "brief me every morning before meetings",
+ "group": "near",
+ "expect": [
+ "Frankie",
+ "Kai"
+ ]
+ },
+ {
+ "query": "sort my inbox",
+ "group": "near",
+ "expect": [
+ "Kai",
+ "Frankie"
+ ]
+ },
+ {
+ "query": "screen resumes for an open role",
+ "group": "near",
+ "expect": [
+ "Harper",
+ "Sofia"
+ ]
+ },
+ {
+ "query": "write a job description",
+ "group": "near",
+ "expect": [
+ "Harper",
+ "Sofia"
+ ]
+ },
+ {
+ "query": "build an onboarding plan for new hires",
+ "group": "near",
+ "expect": [
+ "Ines"
+ ]
+ },
+ {
+ "query": "write our company handbook policies",
+ "group": "near",
+ "expect": [
+ "Ines"
+ ]
+ },
+ {
+ "query": "write SOPs for the team",
+ "group": "near",
+ "expect": [
+ "James"
+ ]
+ },
+ {
+ "query": "draft a statement of work",
+ "group": "near",
+ "expect": [
+ "Jordan"
+ ]
+ },
+ {
+ "query": "answer a security questionnaire",
+ "group": "near",
+ "expect": [
+ "Lena"
+ ]
+ },
+ {
+ "query": "map where we store personal data",
+ "group": "near",
+ "expect": [
+ "Lena"
+ ]
+ },
+ {
+ "query": "find wasted spend in google ads",
+ "group": "near",
+ "expect": [
+ "Marco"
+ ]
+ },
+ {
+ "query": "write blog articles that rank",
+ "group": "near",
+ "expect": [
+ "Maria"
+ ]
+ },
+ {
+ "query": "find prospects and draft cold emails",
+ "group": "near",
+ "expect": [
+ "Max"
+ ]
+ },
+ {
+ "query": "plan our content calendar",
+ "group": "near",
+ "expect": [
+ "Maya",
+ "Jules"
+ ]
+ },
+ {
+ "query": "teardown of our competitors",
+ "group": "near",
+ "expect": [
+ "Nadia"
+ ]
+ },
+ {
+ "query": "write a press release for our launch",
+ "group": "near",
+ "expect": [
+ "Noor"
+ ]
+ },
+ {
+ "query": "clean up duplicate deals in our CRM",
+ "group": "near",
+ "expect": [
+ "Omar"
+ ]
+ },
+ {
+ "query": "explain why signups dropped last week",
+ "group": "near",
+ "expect": [
+ "Quinn"
+ ]
+ },
+ {
+ "query": "build a weekly KPI report",
+ "group": "near",
+ "expect": [
+ "Quinn"
+ ]
+ },
+ {
+ "query": "write our onboarding email sequence",
+ "group": "near",
+ "expect": [
+ "Remy"
+ ]
+ },
+ {
+ "query": "plan renewals for our biggest accounts",
+ "group": "near",
+ "expect": [
+ "Riley"
+ ]
+ },
+ {
+ "query": "reply to customer support tickets",
+ "group": "near",
+ "expect": [
+ "Robin",
+ "Sasha"
+ ]
+ },
+ {
+ "query": "turn repeat questions into help center articles",
+ "group": "near",
+ "expect": [
+ "Sasha",
+ "Robin"
+ ]
+ },
+ {
+ "query": "prepare a pitch deck for investors",
+ "group": "near",
+ "expect": [
+ "Theo"
+ ]
+ },
+ {
+ "query": "compare quotes from three vendors",
+ "group": "near",
+ "expect": [
+ "Vera"
+ ]
+ },
+ {
+ "query": "figure out our pricing and positioning",
+ "group": "near",
+ "expect": [
+ "Zara"
+ ]
+ },
+ {
+ "query": "I need more followers",
+ "group": "leap",
+ "expect": [
+ "Jules",
+ "Maya"
+ ]
+ },
+ {
+ "query": "nobody engages with our posts",
+ "group": "leap",
+ "expect": [
+ "Jules"
+ ]
+ },
+ {
+ "query": "customers keep cancelling",
+ "group": "leap",
+ "expect": [
+ "Riley"
+ ]
+ },
+ {
+ "query": "our churn is too high",
+ "group": "leap",
+ "expect": [
+ "Riley"
+ ]
+ },
+ {
+ "query": "I'm drowning in email",
+ "group": "leap",
+ "expect": [
+ "Kai",
+ "Frankie"
+ ]
+ },
+ {
+ "query": "my calendar is a mess",
+ "group": "leap",
+ "expect": [
+ "Kai",
+ "Frankie"
+ ]
+ },
+ {
+ "query": "we're about to raise a seed round",
+ "group": "leap",
+ "expect": [
+ "Theo"
+ ]
+ },
+ {
+ "query": "I can't keep up with my books",
+ "group": "leap",
+ "expect": [
+ "Mina"
+ ]
+ },
+ {
+ "query": "nobody visits our website",
+ "group": "leap",
+ "expect": [
+ "Maria",
+ "Marco",
+ "Maya"
+ ]
+ },
+ {
+ "query": "our ads cost too much",
+ "group": "leap",
+ "expect": [
+ "Marco"
+ ]
+ },
+ {
+ "query": "we need to grow headcount",
+ "group": "leap",
+ "expect": [
+ "Harper",
+ "Sofia"
+ ]
+ },
+ {
+ "query": "I'm worried about GDPR",
+ "group": "leap",
+ "expect": [
+ "Lena"
+ ]
+ },
+ {
+ "query": "our app keeps shipping bugs",
+ "group": "leap",
+ "expect": [
+ "Casey"
+ ]
+ },
+ {
+ "query": "we got hit by a vulnerable library",
+ "group": "leap",
+ "expect": [
+ "Devon"
+ ]
+ },
+ {
+ "query": "launch is next week and the press doesn't know",
+ "group": "leap",
+ "expect": [
+ "Noor"
+ ]
+ },
+ {
+ "query": "our sales pipeline is a mess",
+ "group": "leap",
+ "expect": [
+ "Omar",
+ "Max"
+ ]
+ },
+ {
+ "query": "I don't know what my competitors charge",
+ "group": "leap",
+ "expect": [
+ "Nadia",
+ "Zara"
+ ]
+ },
+ {
+ "query": "we're entering a new market",
+ "group": "leap",
+ "expect": [
+ "Zara",
+ "Nadia"
+ ]
+ },
+ {
+ "query": "our support queue is overflowing",
+ "group": "leap",
+ "expect": [
+ "Sasha",
+ "Robin"
+ ]
+ },
+ {
+ "query": "nobody opens our newsletter",
+ "group": "leap",
+ "expect": [
+ "Remy"
+ ]
+ },
+ {
+ "query": "too many feature requests and no idea what to build",
+ "group": "leap",
+ "expect": [
+ "Priya",
+ "Alex"
+ ]
+ },
+ {
+ "query": "the numbers in our report don't add up",
+ "group": "leap",
+ "expect": [
+ "Quinn",
+ "Daniel"
+ ]
+ },
+ {
+ "query": "I'm paying for software we don't use",
+ "group": "leap",
+ "expect": [
+ "Vera"
+ ]
+ },
+ {
+ "query": "we keep losing deals at the proposal stage",
+ "group": "leap",
+ "expect": [
+ "Jordan"
+ ]
+ },
+ {
+ "query": "need a demo video for our product launch",
+ "group": "leap",
+ "expect": [
+ "Clip"
+ ]
+ },
+ {
+ "query": "our processes break whenever someone is out",
+ "group": "leap",
+ "expect": [
+ "James"
+ ]
+ },
+ {
+ "query": "the new hire starts monday",
+ "group": "leap",
+ "expect": [
+ "Ines"
+ ]
+ },
+ {
+ "query": "I signed a contract without reading it",
+ "group": "leap",
+ "expect": [
+ "Ellis"
+ ]
+ },
+ {
+ "query": "we want to co-sell with a bigger company",
+ "group": "leap",
+ "expect": [
+ "Anika"
+ ]
+ },
+ {
+ "query": "we don't know when we'll run out of cash",
+ "group": "leap",
+ "expect": [
+ "Daniel",
+ "Theo"
+ ]
+ },
+ {
+ "query": "convert this PDF to text",
+ "group": "miss",
+ "expect": []
+ },
+ {
+ "query": "what's the weather in Paris",
+ "group": "miss",
+ "expect": []
+ },
+ {
+ "query": "create a Linear issue",
+ "group": "miss",
+ "expect": []
+ },
+ {
+ "query": "send a Slack message to the team channel",
+ "group": "miss",
+ "expect": []
+ },
+ {
+ "query": "add a row to my google sheet",
+ "group": "miss",
+ "expect": []
+ },
+ {
+ "query": "run this python script",
+ "group": "miss",
+ "expect": []
+ },
+ {
+ "query": "http request to an API",
+ "group": "miss",
+ "expect": []
+ },
+ {
+ "query": "search the web for the latest news",
+ "group": "miss",
+ "expect": []
+ },
+ {
+ "query": "resize an image",
+ "group": "miss",
+ "expect": []
+ },
+ {
+ "query": "transcribe this audio file",
+ "group": "miss",
+ "expect": []
+ },
+ {
+ "query": "translate this text into Spanish",
+ "group": "miss",
+ "expect": []
+ },
+ {
+ "query": "read a file from my workspace",
+ "group": "miss",
+ "expect": []
+ },
+ {
+ "query": "create a GitHub pull request",
+ "group": "miss",
+ "expect": []
+ },
+ {
+ "query": "get the current time",
+ "group": "miss",
+ "expect": []
+ },
+ {
+ "query": "list my google calendar events",
+ "group": "miss",
+ "expect": []
+ },
+ {
+ "query": "fetch a webpage",
+ "group": "miss",
+ "expect": []
+ },
+ {
+ "query": "generate an image of a cat",
+ "group": "miss",
+ "expect": []
+ },
+ {
+ "query": "summarize this document",
+ "group": "miss",
+ "expect": []
+ },
+ {
+ "query": "post a tweet",
+ "group": "miss",
+ "expect": []
+ },
+ {
+ "query": "upload a file to google drive",
+ "group": "miss",
+ "expect": []
+ },
+ {
+ "query": "query my postgres database",
+ "group": "miss",
+ "expect": []
+ },
+ {
+ "query": "create a notion page",
+ "group": "miss",
+ "expect": []
+ },
+ {
+ "query": "send an SMS",
+ "group": "miss",
+ "expect": []
+ },
+ {
+ "query": "unzip this archive",
+ "group": "miss",
+ "expect": []
+ },
+ {
+ "query": "schedule this agent to run daily",
+ "group": "miss",
+ "expect": []
+ },
+ {
+ "query": "extract text from a website",
+ "group": "miss",
+ "expect": []
+ },
+ {
+ "query": "make a QR code",
+ "group": "miss",
+ "expect": []
+ },
+ {
+ "query": "calculate a math expression",
+ "group": "miss",
+ "expect": []
+ },
+ {
+ "query": "send a discord message",
+ "group": "miss",
+ "expect": []
+ },
+ {
+ "query": "check the stock price of apple",
+ "group": "miss",
+ "expect": []
+ }
+ ]
+}
diff --git a/autogpt_platform/backend/backend/copilot/capabilities/eval/expert_roster.json b/autogpt_platform/backend/backend/copilot/capabilities/eval/expert_roster.json
new file mode 100644
index 0000000000..e6539ffd23
--- /dev/null
+++ b/autogpt_platform/backend/backend/copilot/capabilities/eval/expert_roster.json
@@ -0,0 +1,900 @@
+{
+ "source": "https://backend.agpt.co/api/experts/templates (prod, public), fetched 2026-10-02: 33 templates, only the fields the expert capability entries index; skills are the bundled Skills Hub titles",
+ "templates": [
+ {
+ "id": "45e32e73-99da-4a31-ba81-a02557a007fd",
+ "name": "Alex",
+ "role": "Product",
+ "job_title": "Product Manager",
+ "tagline": "Scores the backlog, writes the spec, and never commits your team to a date without your yes.",
+ "categories": [
+ "development",
+ "research"
+ ],
+ "workflows": [],
+ "skills": [
+ "Getting started",
+ "Product metrics and instrumentation",
+ "Product experiment design",
+ "AI feature scoping and evals",
+ "Product launch plan",
+ "Product market and competitor read",
+ "Customer insight research",
+ "Product research synthesis",
+ "Product requirements writing",
+ "Product roadmap planning",
+ "Product strategy canvas",
+ "Product metrics dashboard design",
+ "Product assumption testing",
+ "Product stakeholder update",
+ "Competitor profiling"
+ ]
+ },
+ {
+ "id": "03aafc1f-3338-4ec7-ad62-c08c03901ace",
+ "name": "Anika",
+ "role": "Partnerships",
+ "job_title": "Partnerships Manager",
+ "tagline": "Sources partners, structures the deal, and runs the alliance from first touch to the P&L.",
+ "categories": [
+ "sales",
+ "operations"
+ ],
+ "workflows": [
+ "Lead Finder",
+ "Decision Maker Lead Finder",
+ "Email Scout - Contact Finder Assistant",
+ "Smart Meeting Prep"
+ ],
+ "skills": [
+ "Partnerships getting started",
+ "Define the partner ICP",
+ "Source and qualify partners",
+ "Partner first-touch outreach",
+ "Structure the partner agreement",
+ "Onboard and enable partners",
+ "Run the partner co-sell cadence",
+ "Track partner pipeline",
+ "Prep the partner QBR",
+ "Handle partner conflict and churn",
+ "Design the partner program",
+ "Map the partner ecosystem",
+ "Plan the multi-year partnership",
+ "Govern the strategic alliance",
+ "Model the partnership commercials",
+ "Scope the tech partnership",
+ "Run the partner marketing engine",
+ "Scale the partner channel",
+ "Run hyperscaler marketplace co-sell",
+ "Run partner strategy and operations",
+ "Assure partner-led delivery",
+ "Manage partner renewals and exits",
+ "Build partner academies at scale",
+ "Orchestrate multi-party partner bids",
+ "Run regulated partnership motions",
+ "Source partners via investor ecosystems",
+ "Build data and R&D alliances",
+ "Run creator and affiliate partner programs",
+ "Run brand, OEM, and supply partnerships",
+ "Set board-level alliance strategy",
+ "Own the alliance P&L",
+ "Run global partner executive councils",
+ "Drive alliance M&A and strategic investments",
+ "Build partner-led category creation",
+ "Partner co marketing",
+ "Sales enablement content"
+ ]
+ },
+ {
+ "id": "ec96d664-9d4b-40a4-95c5-e6b8d6fd2803",
+ "name": "Casey",
+ "role": "Code Review & QA",
+ "job_title": "QA Engineer",
+ "tagline": "Reviews pull requests, plans tests, and writes bug reports engineers can act on.",
+ "categories": [
+ "development"
+ ],
+ "workflows": [],
+ "skills": [
+ "Code quality getting started",
+ "Test plan draft",
+ "Flaky test triage",
+ "Regression risk review",
+ "Release readiness checklist",
+ "Code review quality",
+ "Software debugging",
+ "Software test planning",
+ "Verification before completion",
+ "Software incident response"
+ ]
+ },
+ {
+ "id": "36630f6c-6af7-44de-b5e7-f8d8812f2fbc",
+ "name": "Clip",
+ "role": "Motion Graphics and Video Creation",
+ "job_title": "Video Producer",
+ "tagline": "Builds showreel-grade video ads in code for software and AI products, from your website's real assets.",
+ "categories": [
+ "marketing",
+ "content"
+ ],
+ "workflows": [],
+ "skills": [
+ "Code motion ad 15s"
+ ]
+ },
+ {
+ "id": "ebbd8503-781c-42b1-b237-b18e7dc83eb2",
+ "name": "Daniel",
+ "role": "Finance",
+ "job_title": "Financial Analyst",
+ "tagline": "Keeps your numbers honest: budget pacing, variance with owners, 13-week cash, unit economics, and a board pack that ties out.",
+ "categories": [
+ "finance",
+ "research"
+ ],
+ "workflows": [],
+ "skills": [
+ "Getting started",
+ "Budget vs actuals and reforecast",
+ "Cash, treasury and FX",
+ "Unit economics and ROI",
+ "SaaS and GTM finance",
+ "Deal economics and pricing guardrails",
+ "Automate finance reporting",
+ "Portfolio company performance review",
+ "Financial statement preparation",
+ "Account reconciliation",
+ "Month end close management",
+ "Board deck builder"
+ ]
+ },
+ {
+ "id": "78684d78-6abc-42f0-8259-80cba86c42f1",
+ "name": "Devon",
+ "role": "Dependency & Security Hygiene",
+ "job_title": "Application Security Engineer",
+ "tagline": "Finds dependency risk, proves what affects your stack, and drafts safe upgrades.",
+ "categories": [
+ "development"
+ ],
+ "workflows": [],
+ "skills": [
+ "Dependency security getting started",
+ "Dependency inventory",
+ "Outdated dependency review",
+ "Vulnerability triage",
+ "CVE stack relevance",
+ "Dependency upgrade plan",
+ "Dependency upgrade PR",
+ "Dependency change risk review",
+ "Supply chain risk auditor",
+ "Code change security review"
+ ]
+ },
+ {
+ "id": "be944bfd-1a00-4c20-b4a3-bdcc3f027b41",
+ "name": "Ellis",
+ "role": "Contracts (Non-Advisory)",
+ "job_title": "Contract Manager",
+ "tagline": "Compares contracts with your playbook, extracts key terms, and sends every decision to counsel.",
+ "categories": [
+ "operations"
+ ],
+ "workflows": [],
+ "skills": [
+ "Contract operations getting started",
+ "NDA playbook review",
+ "MSA playbook review",
+ "Contract clause comparison",
+ "Contract key-term extraction",
+ "Contract deviation triage",
+ "Contract obligation tracker",
+ "Counsel escalation brief",
+ "Nda risk review",
+ "Contract amendment history"
+ ]
+ },
+ {
+ "id": "6288a1e2-5141-4ad9-b666-6bcdf546ec8d",
+ "name": "Frankie",
+ "role": "Ops",
+ "job_title": "Executive Assistant",
+ "tagline": "Starts your day briefed: meeting prep, support email, and a morning digest.",
+ "categories": [
+ "operations",
+ "support"
+ ],
+ "workflows": [
+ "Smart Meeting Prep",
+ "Automated Support Agent",
+ "Personal Newsletter"
+ ],
+ "skills": [
+ "Multi source research synthesis",
+ "Project status report",
+ "Operational risk assessment",
+ "Task list management",
+ "Workplace memory management",
+ "Productivity setup",
+ "Productivity task sync",
+ "Legal meeting briefing"
+ ]
+ },
+ {
+ "id": "2feadc1c-e25b-4466-97b7-a676f448e95c",
+ "name": "Harper",
+ "role": "Recruiting & Hiring",
+ "job_title": "Recruiter",
+ "tagline": "Turns an open role into a fair hiring process and drafts every candidate touchpoint.",
+ "categories": [
+ "operations"
+ ],
+ "workflows": [],
+ "skills": [
+ "Recruiting getting started",
+ "Role intake and job description",
+ "Hiring rubric design",
+ "Resume screening",
+ "Interview plan and scorecard",
+ "Candidate interview debrief",
+ "Candidate rejection email",
+ "Candidate offer draft",
+ "Candidate interview planning",
+ "Recruiting pipeline",
+ "Employment offer drafting"
+ ]
+ },
+ {
+ "id": "73694976-7bd6-4109-877a-b24c8e83c24b",
+ "name": "Ines",
+ "role": "People Ops & HR (Non-Advisory)",
+ "job_title": "People Operations Specialist",
+ "tagline": "Builds onboarding plans, policy drafts, and review prep, with HR and counsel handoffs.",
+ "categories": [
+ "operations"
+ ],
+ "workflows": [],
+ "skills": [
+ "People ops getting started",
+ "Handbook policy draft",
+ "One-to-one agenda",
+ "Performance review prep",
+ "Engagement survey readout",
+ "Offboarding checklist",
+ "HR escalation brief",
+ "Employee onboarding planning",
+ "Company policy lookup",
+ "Employee performance review",
+ "People analytics reporting"
+ ]
+ },
+ {
+ "id": "9747104e-4995-4a8e-b735-babb2e041c00",
+ "name": "James",
+ "role": "Operations",
+ "job_title": "Operations Manager",
+ "tagline": "Runs your operating rhythm, SOPs, vendors, capacity, and controls — and never changes a live process without your yes.",
+ "categories": [
+ "operations",
+ "finance"
+ ],
+ "workflows": [],
+ "skills": [
+ "Getting started",
+ "Run the operating rhythm",
+ "Build the ops scorecard",
+ "Write an SOP",
+ "Map and improve a process",
+ "Automate a workflow",
+ "Run vendor and procurement ops",
+ "Plan capacity and headcount",
+ "Run controls and escalations",
+ "Govern a program",
+ "Business process documentation",
+ "Business process optimization",
+ "Team capacity planning",
+ "Project status report",
+ "Operational risk assessment",
+ "Vendor evaluation",
+ "Operational runbook writing",
+ "Compliance evidence tracking"
+ ]
+ },
+ {
+ "id": "40f41fb9-59ef-4e2c-be64-cd39fdb673a9",
+ "name": "Jordan",
+ "role": "Deal Desk & Proposal Support",
+ "job_title": "Deal Desk Manager",
+ "tagline": "Turns deal evidence into proposals, SOW drafts, and approval-ready briefs.",
+ "categories": [
+ "sales"
+ ],
+ "workflows": [],
+ "skills": [
+ "Deal desk getting started",
+ "Deal risk review",
+ "Renewal negotiation brief",
+ "Pricing and terms approval brief",
+ "Proposal quality check",
+ "Sales pipeline review",
+ "Client proposal writing"
+ ]
+ },
+ {
+ "id": "6a2b2123-7a5e-49e4-89db-4f4916a514da",
+ "name": "Jules",
+ "role": "Social & Content Repurposing",
+ "job_title": "Social Media Manager",
+ "tagline": "Cuts one piece of work into posts that belong on each platform.",
+ "categories": [
+ "marketing",
+ "content"
+ ],
+ "workflows": [
+ "LinkedIn Post Generator",
+ "YouTube to LinkedIn Post Converter",
+ "AI Video Generator"
+ ],
+ "skills": [
+ "Product marketing context",
+ "Social media management",
+ "Marketing copy editing"
+ ]
+ },
+ {
+ "id": "e6358ec2-f539-4b58-a4c2-2388fa8a28e7",
+ "name": "Kai",
+ "role": "Executive Assistant",
+ "job_title": "Executive Assistant",
+ "tagline": "Sorts your inbox, preps your meetings, and keeps follow-ups from slipping.",
+ "categories": [
+ "support",
+ "operations"
+ ],
+ "workflows": [],
+ "skills": [
+ "Executive assistant getting started",
+ "Inbox triage",
+ "Reply draft in your voice",
+ "Meeting prep brief",
+ "Meeting follow-up draft",
+ "Calendar conflict review",
+ "Travel plan",
+ "Weekly priorities review",
+ "Productivity setup",
+ "Task list management",
+ "Workplace memory management",
+ "Productivity task sync",
+ "Multi source research synthesis"
+ ]
+ },
+ {
+ "id": "445d7b1b-e332-4e14-9f95-e76908fc9a0d",
+ "name": "Lena",
+ "role": "Privacy & Compliance (Non-Advisory)",
+ "job_title": "Compliance Operations Analyst",
+ "tagline": "Answers security questionnaires and keeps data maps current, with clear counsel handoffs.",
+ "categories": [
+ "operations"
+ ],
+ "workflows": [],
+ "skills": [
+ "Compliance ops getting started",
+ "Security questionnaire answers",
+ "Personal data map",
+ "Subprocessor register",
+ "DPA checklist review",
+ "Policy gap review",
+ "Data subject request draft",
+ "Compliance escalation brief",
+ "Compliance evidence tracking",
+ "Vendor contract status",
+ "Legal response drafting"
+ ]
+ },
+ {
+ "id": "573ffea3-6841-4440-b4a1-96a5f73b3952",
+ "name": "Marco",
+ "role": "Paid Ads & Performance",
+ "job_title": "Performance Marketer",
+ "tagline": "Plans campaigns, writes ad variants, and finds wasted spend in your ad accounts.",
+ "categories": [
+ "marketing"
+ ],
+ "workflows": [],
+ "skills": [
+ "Paid ads getting started",
+ "Campaign structure plan",
+ "Ad copy variants",
+ "Wasted spend audit",
+ "Budget pacing review",
+ "Creative test readout",
+ "Paid performance report",
+ "Conversion rate optimization"
+ ]
+ },
+ {
+ "id": "d91d9897-5c65-45c6-ba16-0dd5c24404ac",
+ "name": "Maria",
+ "role": "SEO & Content",
+ "job_title": "SEO Content Manager",
+ "tagline": "Takes a keyword from brief to article draft for review, and reworks page copy to rank.",
+ "categories": [
+ "marketing",
+ "content"
+ ],
+ "workflows": [
+ "Automated SEO Blog Writer",
+ "AI Webpage Copy Improver",
+ "YouTube Video to SEO Blog Writer"
+ ],
+ "skills": [
+ "SEO content brief",
+ "On-page SEO audit",
+ "Product marketing context",
+ "Marketing content strategy",
+ "Marketing copywriting",
+ "Marketing copy editing",
+ "Website seo audit",
+ "Seo report generation"
+ ]
+ },
+ {
+ "id": "7a25f32e-26e4-4a4e-9902-aed163e61c1d",
+ "name": "Max",
+ "role": "Sales",
+ "job_title": "Account Executive",
+ "tagline": "Researches prospects, drafts outreach, and helps coordinate deals through signature.",
+ "categories": [
+ "sales",
+ "operations"
+ ],
+ "workflows": [
+ "Lead Finder",
+ "Decision Maker Lead Finder",
+ "Email Scout - Contact Finder Assistant"
+ ],
+ "skills": [
+ "Sales getting started",
+ "Build the target list",
+ "Find the decision makers",
+ "Draft a first touch",
+ "Draft a follow up",
+ "Handle a reply",
+ "Discovery and qualification",
+ "Objection and negotiation",
+ "Next step and handoff",
+ "Multithread and stakeholder maps",
+ "Business case and ROI selling",
+ "Quarterback the deal team",
+ "Enterprise deal desk close plans",
+ "RFP and competitive bid response",
+ "Pipeline review and forecast",
+ "Territory and account planning",
+ "Renewal expansion and QBR",
+ "Signature to launch and account ops",
+ "Exec engagement and sponsorship",
+ "Sales team leadership",
+ "Sales ops coverage and quota",
+ "Enablement playbooks certification",
+ "Regional category GTM strategy",
+ "Partner and channel co-sell",
+ "Alliance co-commercialization",
+ "Voice of customer loop",
+ "Compliance gated deal execution",
+ "Cloud commit and marketplace selling",
+ "Marketplace partner revenue growth",
+ "Credit term sheet structuring",
+ "Industrial pursuit tender handover",
+ "Media plan measure optimize",
+ "Regulated access and clinical selling",
+ "Retail JBP trade and sellout",
+ "Showroom FI and internet BDC",
+ "Field call route discipline",
+ "Sales account research",
+ "Sales outreach drafting",
+ "Sales call preparation",
+ "Sales pipeline review",
+ "Sales enablement content",
+ "Client proposal writing",
+ "Customer insight research",
+ "Partner co marketing",
+ "Go to market strategy"
+ ]
+ },
+ {
+ "id": "5e338d7f-02f6-47ca-a284-2baca006cf5c",
+ "name": "Maya",
+ "role": "Marketing",
+ "job_title": "Marketing Manager",
+ "tagline": "Runs the marketing engine end to end — campaigns, content calendar, messaging, and the weekly read — all drafted for your yes.",
+ "categories": [
+ "marketing",
+ "content"
+ ],
+ "workflows": [
+ "Automated SEO Blog Writer",
+ "LinkedIn Post Generator",
+ "AI Webpage Copy Improver"
+ ],
+ "skills": [
+ "Marketing getting started",
+ "Messaging and tone matrix",
+ "Campaign brief and asset plan",
+ "Content brief writer handoff",
+ "Editorial calendar ops",
+ "Channel draft shapes",
+ "Nurture sequence build and readout",
+ "Weekly marketing read",
+ "Product marketing context",
+ "Marketing content strategy",
+ "Marketing copywriting",
+ "Lifecycle email marketing"
+ ]
+ },
+ {
+ "id": "d0fa2aaa-595f-4b3b-951b-711d07cec450",
+ "name": "Mina",
+ "role": "Finance, Invoicing & Bookkeeping",
+ "job_title": "Bookkeeper",
+ "tagline": "Keeps invoices, expenses, statements, and month-end records clear and review-ready.",
+ "categories": [
+ "finance",
+ "operations"
+ ],
+ "workflows": [],
+ "skills": [
+ "Bookkeeping getting started",
+ "Expense categorization",
+ "Invoice drafting and issue",
+ "Accounts receivable follow-up",
+ "Bookkeeping exception escalation",
+ "Account reconciliation",
+ "Month end close management",
+ "Financial statement preparation"
+ ]
+ },
+ {
+ "id": "37c3a89a-fdef-44a7-8c62-9c4962c5e403",
+ "name": "Nadia",
+ "role": "Market & Competitor Intelligence",
+ "job_title": "Market Research Analyst",
+ "tagline": "Takes your competitors apart and tells you what to do about it.",
+ "categories": [
+ "research",
+ "marketing"
+ ],
+ "workflows": [
+ "Personal Newsletter",
+ "YouTube Transcription Scraper"
+ ],
+ "skills": [
+ "Competitor teardown",
+ "Customer insight research",
+ "Competitor profiling",
+ "Product marketing context"
+ ]
+ },
+ {
+ "id": "ec7aca5e-d1a5-48d9-9ef6-509b1e55563d",
+ "name": "Noor",
+ "role": "PR & Communications",
+ "job_title": "Communications Manager",
+ "tagline": "Writes press releases, pitches, and launch plans from facts you can stand behind.",
+ "categories": [
+ "marketing",
+ "content"
+ ],
+ "workflows": [],
+ "skills": [
+ "Communications getting started",
+ "News angle and key messages",
+ "Press release draft",
+ "Media list research",
+ "Media pitch email",
+ "Launch communications plan",
+ "Holding statement draft",
+ "Spokesperson briefing",
+ "Product launch marketing",
+ "Marketing copy editing"
+ ]
+ },
+ {
+ "id": "8ccaa87f-69c7-441f-82a7-31fa619649e4",
+ "name": "Omar",
+ "role": "RevOps & CRM Hygiene",
+ "job_title": "Revenue Operations Analyst",
+ "tagline": "Cleans CRM data, defines pipeline stages, and builds forecasts you can trace.",
+ "categories": [
+ "sales",
+ "operations"
+ ],
+ "workflows": [],
+ "skills": [
+ "RevOps getting started",
+ "CRM field audit",
+ "CRM duplicate review",
+ "Pipeline stage definitions",
+ "Lead routing rules",
+ "Sales forecast rollup",
+ "Lost deal analysis",
+ "CRM hygiene report",
+ "Dataset exploration",
+ "Sales pipeline review"
+ ]
+ },
+ {
+ "id": "8b4458c3-fe4c-43e2-bdf7-bb75266cad18",
+ "name": "Priya",
+ "role": "Product Management",
+ "job_title": "Product Manager",
+ "tagline": "Turns feedback and data into clear problems, priorities, specs, and release notes.",
+ "categories": [
+ "research",
+ "operations"
+ ],
+ "workflows": [],
+ "skills": [
+ "Product getting started",
+ "Release notes draft",
+ "Customer insight research",
+ "Product research synthesis",
+ "Product requirements writing",
+ "Product roadmap planning",
+ "Product stakeholder update"
+ ]
+ },
+ {
+ "id": "2c931f0e-e233-40af-bda9-0e1501e8bf67",
+ "name": "Quinn",
+ "role": "Research, Data & KPI Analysis",
+ "job_title": "Data Analyst",
+ "tagline": "Checks the data, explains metric changes, and turns them into a weekly decision brief.",
+ "categories": [
+ "research",
+ "finance"
+ ],
+ "workflows": [],
+ "skills": [
+ "KPI analysis getting started",
+ "Metric definition and data quality",
+ "Weekly KPI digest",
+ "Metric anomaly detection",
+ "Metric movement analysis",
+ "Cohort and retention analysis",
+ "Funnel conversion analysis",
+ "Experiment readout",
+ "Dataset exploration",
+ "Data visualization",
+ "User cohort analysis"
+ ]
+ },
+ {
+ "id": "87192844-0ce6-433b-bee5-43747594721f",
+ "name": "Remy",
+ "role": "Email & Lifecycle",
+ "job_title": "Email Marketing Manager",
+ "tagline": "Maps which emails should exist, then writes them.",
+ "categories": [
+ "marketing"
+ ],
+ "workflows": [],
+ "skills": [
+ "Email deliverability guardrails",
+ "Product marketing context",
+ "Lifecycle email marketing",
+ "Marketing copy editing"
+ ]
+ },
+ {
+ "id": "57b06a80-4f35-40eb-8ed2-270c6992a3c1",
+ "name": "Riley",
+ "role": "Customer Success & Retention",
+ "job_title": "Customer Success Manager",
+ "tagline": "Turns account signals into onboarding, renewal, and retention plans.",
+ "categories": [
+ "support"
+ ],
+ "workflows": [],
+ "skills": [
+ "Customer success getting started",
+ "Customer onboarding plan",
+ "Customer health score",
+ "Churn risk review",
+ "Renewal readiness review",
+ "Expansion opportunity brief",
+ "Customer success plan",
+ "Customer support research",
+ "Customer response drafting",
+ "Customer escalation",
+ "Customer insight research"
+ ]
+ },
+ {
+ "id": "428ebaf0-c0ef-47b3-9c37-72a9e6ac427f",
+ "name": "Robin",
+ "role": "Customer Support",
+ "job_title": "Customer Support Specialist",
+ "tagline": "Senior support rep who triages, drafts, and owns every case to closure.",
+ "categories": [
+ "support",
+ "operations"
+ ],
+ "workflows": [
+ "Automated Support Agent",
+ "Smart Meeting Prep"
+ ],
+ "skills": [
+ "Support getting started",
+ "Triage and prioritize",
+ "Troubleshoot and resolve",
+ "Own to closure",
+ "Billing refunds and exceptions",
+ "Escalations and incidents",
+ "Orders, returns and warranty",
+ "Live-channel queue operations",
+ "Voice and phone support",
+ "Technical diagnostics with tools",
+ "Service recovery and goodwill",
+ "Onboarding and adoption",
+ "VIP and white-glove care",
+ "Social and community support",
+ "Knowledge centered service",
+ "Voice of customer and feedback",
+ "Quality, CSAT and coaching",
+ "Sensitive data safe handling",
+ "Fraud and chargeback defense",
+ "Trust and safety escalations",
+ "Compliance and regulated support",
+ "Enterprise identity SSO support",
+ "Upsell and retention offers",
+ "Account health and QBRs",
+ "Support ops improvement program",
+ "Workforce and capacity planning",
+ "BPO vendor quality ops",
+ "Mass recovery and bulk comms",
+ "Marketplace two-sided mediation",
+ "Travel disruption and rebooking",
+ "Logistics shipment and customs",
+ "Member benefits and claims",
+ "Customer support research",
+ "Customer response drafting",
+ "Customer escalation",
+ "Knowledge base article writing",
+ "Product research synthesis",
+ "Software debugging",
+ "Support ticket triage"
+ ]
+ },
+ {
+ "id": "0887df62-f69f-46c5-8f83-7192128bc7b1",
+ "name": "Sasha",
+ "role": "Support & Help Desk",
+ "job_title": "Support Specialist",
+ "tagline": "Triages tickets, drafts replies, and turns repeat questions into help articles.",
+ "categories": [
+ "support"
+ ],
+ "workflows": [],
+ "skills": [
+ "Support getting started",
+ "Support macro library",
+ "Bug report handoff",
+ "Refund and exception brief",
+ "Customer support research",
+ "Customer response drafting",
+ "Customer escalation",
+ "Knowledge base article writing",
+ "Product research synthesis",
+ "Support ticket triage"
+ ]
+ },
+ {
+ "id": "9524e68a-bd8f-4408-a7a2-acb55d67246c",
+ "name": "Sofia",
+ "role": "Recruiting",
+ "job_title": "Recruiter",
+ "tagline": "Scopes the role, sources and screens, runs the loop, and drafts the offer.",
+ "categories": [
+ "operations"
+ ],
+ "workflows": [],
+ "skills": [
+ "Recruiting getting started",
+ "Role intake and scorecard",
+ "Job description drafting",
+ "Candidate sourcing strategy",
+ "Passive candidate outreach",
+ "Resume screening",
+ "Interview kit design",
+ "Interview coordination",
+ "Hiring debrief and decision",
+ "Job offer and close plan",
+ "Hiring pipeline analytics",
+ "Candidate interview planning",
+ "Recruiting pipeline",
+ "Employment offer drafting"
+ ]
+ },
+ {
+ "id": "97634455-aba0-4bf6-a52a-2bb40501b518",
+ "name": "Theo",
+ "role": "Finance, Fundraising & Investor Relations",
+ "job_title": "Investor Relations Manager",
+ "tagline": "Turns fundraising facts into a clear deck, clean records, and investor-ready updates.",
+ "categories": [
+ "finance",
+ "operations"
+ ],
+ "workflows": [],
+ "skills": [
+ "Investor relations getting started",
+ "Fundraising data-room checklist",
+ "Investor targeting and research",
+ "Fundraising pipeline review",
+ "Cap-table hygiene",
+ "Financial statement preparation",
+ "Board deck builder",
+ "Multi source research synthesis"
+ ]
+ },
+ {
+ "id": "32bd6bbd-049c-49bb-8c8b-3b77b784cc47",
+ "name": "Vera",
+ "role": "Vendor & Procurement",
+ "job_title": "Procurement Specialist",
+ "tagline": "Compares vendors, tracks renewals, and surfaces spend risks without committing company money.",
+ "categories": [
+ "operations",
+ "finance"
+ ],
+ "workflows": [],
+ "skills": [
+ "Procurement getting started",
+ "Vendor requirements brief",
+ "Vendor quote comparison",
+ "Vendor due diligence",
+ "Spend anomaly review",
+ "Vendor evaluation",
+ "Vendor contract status",
+ "Operational risk assessment"
+ ]
+ },
+ {
+ "id": "53bd6841-2286-49c7-a79c-58d709a59f22",
+ "name": "Zara",
+ "role": "Go-to-Market",
+ "job_title": "GTM Strategist",
+ "tagline": "Designs who you sell to, why they buy, what it costs, and how you win.",
+ "categories": [
+ "marketing",
+ "sales"
+ ],
+ "workflows": [
+ "AI Webpage Copy Improver",
+ "Smart Meeting Prep"
+ ],
+ "skills": [
+ "GTM getting started",
+ "Positioning and messaging",
+ "ICP and segmentation",
+ "Commercial launch strategy",
+ "Competitive intelligence",
+ "GTM performance diagnostics",
+ "GTM planning and market entry",
+ "Opportunity sizing and business case",
+ "Sales-marketing alignment and SLA",
+ "Vertical industry plays",
+ "Developer and API motion",
+ "Product marketing context",
+ "Pricing and packaging strategy",
+ "Go to market strategy",
+ "Market size estimation",
+ "Sales enablement content",
+ "Competitor profiling",
+ "Product launch marketing"
+ ]
+ }
+ ]
+}
diff --git a/autogpt_platform/backend/backend/copilot/capabilities/eval/experts.py b/autogpt_platform/backend/backend/copilot/capabilities/eval/experts.py
new file mode 100644
index 0000000000..3d576f7edb
--- /dev/null
+++ b/autogpt_platform/backend/backend/copilot/capabilities/eval/experts.py
@@ -0,0 +1,264 @@
+"""Expert-hire retrieval benchmark: does ``find_capability`` surface the roster
+expert a user is asking for, and stay quiet when they are not asking for one?
+
+``expert_hire_dataset.json`` holds hand-written queries in four groups:
+``plain`` names the role ("social media manager"), ``near`` describes the job
+as a task ("someone to run my LinkedIn"), ``leap`` gives only the symptom ("I
+need more followers"), and ``miss`` asks for something to run now, where no
+expert belongs on top. Labels are roster template names; any one of them
+counts. ``expert_roster.json`` is the roster snapshot the queries were
+written against. "Today" is the platform registry alone; "registry" layers
+the roster on top the way a session does. The model writes the actual
+query, and when the user asked to hire it writes it the way Toran's session
+did ("hire expert social media manager"), so each case is also scored with
+that prefix.
+"""
+
+import argparse
+import json
+from pathlib import Path
+from typing import Literal
+
+from pydantic import BaseModel, Field
+
+from backend.api.features.experts.models import (
+ ExpertBundledSkill,
+ ExpertTemplate,
+ ExpertWorkflowRef,
+)
+from backend.copilot.capabilities.index import CapabilityIndex, SearchResult
+from backend.copilot.capabilities.registry import build_entries
+from backend.copilot.capabilities.sources import expert_entries
+from backend.copilot.tools import TOOL_GROUPS, TOOL_REGISTRY
+
+DATASET_PATH = Path(__file__).with_name("expert_hire_dataset.json")
+ROSTER_PATH = Path(__file__).with_name("expert_roster.json")
+Group = Literal["plain", "near", "leap", "miss"]
+GROUPS: tuple[Group, ...] = ("plain", "near", "leap", "miss")
+TOP_K = 5
+HIRE_PREFIX = "hire expert "
+
+
+class Case(BaseModel):
+ query: str
+ group: Group
+ expect: list[str] = Field(default_factory=list)
+
+
+class Stratum(BaseModel):
+ n: int = 0
+ hit1: int = 0
+ hit3: int = 0
+ hit5: int = 0
+ # Miss cases only: an expert ranked first / anywhere in the top five.
+ fp1: int = 0
+ fp5: int = 0
+
+ def rate(self, field: str) -> float:
+ return getattr(self, field) / self.n if self.n else 0.0
+
+
+class Failure(BaseModel):
+ query: str
+ group: Group
+ expect: list[str]
+ got: list[str]
+
+
+class Report(BaseModel):
+ today: dict[str, Stratum]
+ registry: dict[str, Stratum]
+ # ``find_capability(kind="expert")``: retrieval among experts alone.
+ experts_only: dict[str, Stratum]
+ # The query as the model writes it for a hire: ``HIRE_PREFIX`` + query.
+ hire_phrased: dict[str, Stratum]
+ failures: list[Failure]
+ # Templates no plain-role query puts in the top five.
+ unreachable: list[str]
+
+
+def load_cases(path: Path = DATASET_PATH) -> list[Case]:
+ data = json.loads(path.read_text(encoding="utf-8"))
+ return [Case.model_validate(item) for item in data["items"]]
+
+
+def load_roster(path: Path = ROSTER_PATH) -> list[ExpertTemplate]:
+ """The snapshot as the templates ``with_bundled_skills`` returns, with the
+ fields the entries never read left empty."""
+ data = json.loads(path.read_text(encoding="utf-8"))
+ return [_template(item) for item in data["templates"]]
+
+
+def platform_index() -> CapabilityIndex:
+ # Same catalogue as the registry benchmark, so a machine without provider
+ # secrets competes the roster against every block CI sees.
+ return CapabilityIndex(
+ build_entries(TOOL_REGISTRY, TOOL_GROUPS, include_disabled_blocks=True)
+ )
+
+
+def evaluate(
+ today: CapabilityIndex, templates: list[ExpertTemplate], cases: list[Case]
+) -> Report:
+ registry = today.with_entries(expert_entries(templates, hired=[]))
+ report = Report(
+ today={g: Stratum() for g in GROUPS},
+ registry={g: Stratum() for g in GROUPS},
+ experts_only={g: Stratum() for g in GROUPS},
+ hire_phrased={g: Stratum() for g in GROUPS},
+ failures=[],
+ unreachable=[],
+ )
+ reached: set[str] = set()
+ for case in cases:
+ result = registry.search(case.query, context="direct")
+ _score(report.today[case.group], today.search(case.query), case)
+ _score(report.registry[case.group], result, case)
+ _score(
+ report.experts_only[case.group],
+ registry.search(case.query, context="direct", kind="expert"),
+ case,
+ )
+ _score(
+ report.hire_phrased[case.group],
+ registry.search(HIRE_PREFIX + case.query, context="direct"),
+ case,
+ )
+ if case.group == "plain":
+ reached |= set(_expert_names(result)[:TOP_K]) & set(case.expect)
+ if _failed(result, case):
+ report.failures.append(
+ Failure(
+ query=case.query,
+ group=case.group,
+ expect=case.expect,
+ got=[_label(hit.entry) for hit in result.hits[:TOP_K]],
+ )
+ )
+ report.unreachable = sorted({t.name for t in templates} - reached)
+ return report
+
+
+def format_report(report: Report) -> str:
+ lines = [
+ "| group | n | today h@5 | registry h@1 | registry h@3 | registry h@5 "
+ "| kind=expert h@1 | kind=expert h@5 | hire-phrased h@1 | hire-phrased h@5 |",
+ "|---|---|---|---|---|---|---|---|---|---|",
+ ]
+ for group in GROUPS[:-1]:
+ t, r, e, h = (
+ report.today[group],
+ report.registry[group],
+ report.experts_only[group],
+ report.hire_phrased[group],
+ )
+ lines.append(
+ f"| {group} | {r.n} | {_pct(t, 'hit5')} | {_pct(r, 'hit1')} "
+ f"| {_pct(r, 'hit3')} | {_pct(r, 'hit5')} | {_pct(e, 'hit1')} "
+ f"| {_pct(e, 'hit5')} | {_pct(h, 'hit1')} | {_pct(h, 'hit5')} |"
+ )
+ t, r = report.today["miss"], report.registry["miss"]
+ lines.append(
+ f"miss (n={r.n}): an expert ranked first {_pct(r, 'fp1')}, in the top "
+ f"{TOP_K} {_pct(r, 'fp5')} (today {_pct(t, 'fp5')})"
+ )
+ lines.append(
+ "templates no plain query reaches at 5: "
+ + (", ".join(report.unreachable) or "none")
+ )
+ lines += [
+ f" FAIL [{f.group}] {f.query!r} wanted {f.expect or 'no expert'} got {f.got}"
+ for f in report.failures
+ ]
+ return "\n".join(lines)
+
+
+def _score(stratum: Stratum, result: SearchResult, case: Case) -> None:
+ stratum.n += 1
+ if case.group == "miss":
+ stratum.fp1 += bool(result.hits) and result.hits[0].entry.kind == "expert"
+ stratum.fp5 += any(h.entry.kind == "expert" for h in result.hits[:TOP_K])
+ return
+ rank = _rank(result, case)
+ if rank is not None:
+ stratum.hit1 += rank < 1
+ stratum.hit3 += rank < 3
+ stratum.hit5 += rank < TOP_K
+
+
+def _rank(result: SearchResult, case: Case) -> int | None:
+ for rank, hit in enumerate(result.hits):
+ if hit.entry.kind == "expert" and hit.entry.name in case.expect:
+ return rank
+ return None
+
+
+def _failed(result: SearchResult, case: Case) -> bool:
+ if case.group == "miss":
+ return any(h.entry.kind == "expert" for h in result.hits[:TOP_K])
+ rank = _rank(result, case)
+ return rank is None or rank >= TOP_K
+
+
+def _expert_names(result: SearchResult) -> list[str]:
+ return [h.entry.name if h.entry.kind == "expert" else "" for h in result.hits]
+
+
+def _label(entry) -> str:
+ return f"expert:{entry.name}" if entry.kind == "expert" else entry.name
+
+
+def _pct(stratum: Stratum, field: str) -> str:
+ return f"{100 * stratum.rate(field):.0f}%"
+
+
+def _template(item: dict) -> ExpertTemplate:
+ return ExpertTemplate(
+ id=item["id"],
+ name=item["name"],
+ avatar_url=None,
+ role=item["role"],
+ job_title=item.get("job_title"),
+ tagline=item.get("tagline"),
+ bio=None,
+ skills=[],
+ categories=item.get("categories") or [],
+ identity="",
+ voice_preferences="",
+ boundaries="",
+ protected_soul_rules=[],
+ is_template=True,
+ source_template_id=None,
+ is_archived=False,
+ workflows=[
+ ExpertWorkflowRef(
+ id=f"{item['id']}-wf-{i}",
+ store_listing_version_id=None,
+ library_agent_id=None,
+ graph_id=None,
+ name=name,
+ description=None,
+ )
+ for i, name in enumerate(item.get("workflows") or [])
+ ],
+ bundled_skills=[
+ ExpertBundledSkill(
+ id=f"{item['id']}-skill-{i}", slug="", title=title, description=""
+ )
+ for i, title in enumerate(item.get("skills") or [])
+ ],
+ )
+
+
+def main() -> None:
+ parser = argparse.ArgumentParser(description=__doc__)
+ parser.add_argument("--json", type=Path, help="also write the full report here")
+ args = parser.parse_args()
+ report = evaluate(platform_index(), load_roster(), load_cases())
+ print(format_report(report))
+ if args.json:
+ args.json.write_text(report.model_dump_json(indent=1), encoding="utf-8")
+
+
+if __name__ == "__main__":
+ main()
diff --git a/autogpt_platform/backend/backend/copilot/capabilities/eval/experts_test.py b/autogpt_platform/backend/backend/copilot/capabilities/eval/experts_test.py
new file mode 100644
index 0000000000..f54c6fa418
--- /dev/null
+++ b/autogpt_platform/backend/backend/copilot/capabilities/eval/experts_test.py
@@ -0,0 +1,96 @@
+"""Expert-hire gate: ``find_capability`` must surface the roster expert a user
+asks for and keep experts off searches for something to run. Floors are the
+first measured run (2026-10-02) less a query or two, so a ranking or entry
+change that loses ground fails here; ``python -m
+backend.copilot.capabilities.eval.experts`` prints the full report and every
+failing query."""
+
+from collections import Counter
+
+import pytest
+
+from backend.copilot.capabilities.index import CapabilityIndex
+from backend.copilot.capabilities.sources import expert_entries
+
+from .experts import (
+ GROUPS,
+ TOP_K,
+ Report,
+ evaluate,
+ format_report,
+ load_cases,
+ load_roster,
+ platform_index,
+)
+
+# The slack is the catalogue: which tools load differs by environment, and
+# leaps scored 47% from the CLI and 40% under pytest on the same commit.
+# Lexical search cannot bridge a symptom to a role ("more followers" never
+# names social media), so leaps hold a floor rather than a target.
+MIN_HIT5 = {"plain": 0.95, "near": 0.85, "leap": 0.35}
+MIN_HIRE_PHRASED_HIT5 = {"plain": 0.95, "near": 0.90, "leap": 0.60}
+MIN_EXPERTS_ONLY_HIT5 = {"plain": 0.95, "near": 0.90, "leap": 0.65}
+MAX_MISS_EXPERT_FIRST = 0.07
+MAX_MISS_EXPERT_IN_TOP5 = 0.15
+# Must hit at 5 whatever the floors allow: Toran's own query (SECRT-2814), and
+# requests naming a service, which restrict the list to that service's entries.
+PINNED = {
+ "hire expert social media manager": {"Jules"},
+ "someone to run my LinkedIn": {"Jules", "Maya"},
+ "find wasted spend in google ads": {"Marco"},
+}
+
+
[email protected](scope="module")
+def platform() -> CapabilityIndex:
+ return platform_index()
+
+
[email protected](scope="module")
+def report(platform: CapabilityIndex) -> Report:
+ result = evaluate(platform, load_roster(), load_cases())
+ print("\n" + format_report(result))
+ return result
+
+
+def test_dataset_covers_every_template_and_group():
+ cases = load_cases()
+ names = {t.name for t in load_roster()}
+ plain = Counter(n for c in cases if c.group == "plain" for n in c.expect)
+ assert {n for c in cases for n in c.expect} <= names
+ assert min(plain[n] for n in names) >= 2
+ assert Counter(c.group for c in cases) == {
+ "plain": 66,
+ "near": 40,
+ "leap": 30,
+ "miss": 30,
+ }
+ assert all(not c.expect for c in cases if c.group == "miss")
+
+
+def test_platform_registry_alone_finds_no_expert(report: Report):
+ assert all(report.today[g].hit5 == 0 for g in GROUPS)
+
+
[email protected]("group", MIN_HIT5)
+def test_expert_hit_rate(report: Report, group: str):
+ assert report.registry[group].rate("hit5") >= MIN_HIT5[group], format_report(report)
+ assert report.hire_phrased[group].rate("hit5") >= MIN_HIRE_PHRASED_HIT5[group]
+ assert report.experts_only[group].rate("hit5") >= MIN_EXPERTS_ONLY_HIT5[group]
+
+
+def test_searches_for_something_to_run_keep_experts_off_the_top(report: Report):
+ miss = report.registry["miss"]
+ assert miss.rate("fp1") <= MAX_MISS_EXPERT_FIRST, format_report(report)
+ assert miss.rate("fp5") <= MAX_MISS_EXPERT_IN_TOP5, format_report(report)
+
+
+def test_every_template_is_reachable_by_its_role(report: Report):
+ assert report.unreachable == []
+
+
[email protected]("query", PINNED)
+def test_pinned_requests_find_their_expert(platform: CapabilityIndex, query: str):
+ index = platform.with_entries(expert_entries(load_roster(), hired=[]))
+ top = [hit.entry for hit in index.search(query).hits[:TOP_K]]
+ assert {e.name for e in top if e.kind == "expert"} & PINNED[query], top
diff --git a/autogpt_platform/backend/backend/copilot/capabilities/index.py b/autogpt_platform/backend/backend/copilot/capabilities/index.py
index 7bba02ec67..862845b8ca 100644
--- a/autogpt_platform/backend/backend/copilot/capabilities/index.py
+++ b/autogpt_platform/backend/backend/copilot/capabilities/index.py
@@ -167,11 +167,13 @@ class CapabilityIndex:
fallback: list[SearchHit] = []
if service_indices is not None:
# A skill is not a service, but the one written for the named
- # service is the best answer there is, so skills stay in.
+ # service is the best answer there is, so skills stay in; so do
+ # experts, since "someone to run my LinkedIn" names one.
main = [
idx
for idx in rest
- if idx in service_indices or self.entries[idx].kind == "skill"
+ if idx in service_indices
+ or self.entries[idx].kind in ("skill", "expert")
]
others = [idx for idx in rest if idx not in main]
fallback = _ranked(
@@ -232,6 +234,14 @@ class CapabilityIndex:
and SKILL_TOOL not in allowed_tools
):
continue
+ # An expert runs as the tool it dispatches to (hire or
+ # delegate), and is shown only where that tool may run.
+ if (
+ entry.kind == "expert"
+ and allowed_tools is not None
+ and entry.implementations[0].ref not in allowed_tools
+ ):
+ continue
allowed.add(idx)
return allowed
diff --git a/autogpt_platform/backend/backend/copilot/capabilities/models.py b/autogpt_platform/backend/backend/copilot/capabilities/models.py
index 3052a6a59a..0e03277100 100644
--- a/autogpt_platform/backend/backend/copilot/capabilities/models.py
+++ b/autogpt_platform/backend/backend/copilot/capabilities/models.py
@@ -2,7 +2,8 @@
One :class:`CapabilityEntry` describes one thing the copilot can do: a
platform tool, a block, an MCP server from the catalog, a skill of the
-session's owner, or (phase 2) a library agent. The registry indexes
+session's owner, an expert to hire or already hired, or (phase 2) a library
+agent. The registry indexes
entries by name, description and tags; argument schemas are fetched on
demand and never indexed.
"""
@@ -14,7 +15,7 @@ from typing import Literal
from pydantic import BaseModel, Field
CapabilityKindName = Literal[
- "tool", "block", "mcp_server", "mcp_tool", "agent", "skill"
+ "tool", "block", "mcp_server", "mcp_tool", "agent", "skill", "expert"
]
CapabilityClass = Literal["service", "primitive"]
CapabilityContext = Literal["direct", "graph", "both"]
@@ -87,6 +88,8 @@ class CapabilityEntry(BaseModel):
# Blocks the platform hides for a reason (disabled / graph-only) keep an
# entry for graph context but stay out of direct results.
sensitive: bool = False
+ # An expert already on the user's team, as opposed to a roster template.
+ hired: bool = False
def listing(self) -> dict[str, object]:
"""Compact form for a search result (about 40-60 tokens)."""
@@ -102,6 +105,8 @@ class CapabilityEntry(BaseModel):
out["connected"] = self.connection.connected
if self.eager:
out["eager"] = True
+ if self.kind == "expert":
+ out["hired"] = self.hired
return out
def available_in(self, context: CapabilityContext) -> bool:
diff --git a/autogpt_platform/backend/backend/copilot/capabilities/sources/__init__.py b/autogpt_platform/backend/backend/copilot/capabilities/sources/__init__.py
index f0f6e14749..341c0365b8 100644
--- a/autogpt_platform/backend/backend/copilot/capabilities/sources/__init__.py
+++ b/autogpt_platform/backend/backend/copilot/capabilities/sources/__init__.py
@@ -1,19 +1,34 @@
"""Capability sources: each yields ``CapabilityEntry`` objects from one backing
registry (platform tools, blocks, the MCP catalog, the session owner's
-skills). The first three make the process-wide registry; skills are per
-session and layered on top by ``tools.session_registry``."""
+skills, the expert roster and team). The first three make the process-wide
+registry; skills and experts are per session and layered on top by
+``tools.session_registry``."""
from .blocks import block_entries
+from .experts import (
+ DELEGATE_TOOL,
+ EXPERT_ID_PREFIX,
+ HIRE_TOOL,
+ TEAMMATE_ID_PREFIX,
+ expert_dispatch,
+ expert_entries,
+)
from .mcp_catalog import mcp_catalog_entries
from .skills import SKILL_ID_PREFIX, SKILL_TOOL, skill_entries, skill_name
from .static_tools import EAGER_CORE, RETIRED_TOOLS, tool_entries
__all__ = [
+ "DELEGATE_TOOL",
"EAGER_CORE",
+ "EXPERT_ID_PREFIX",
+ "HIRE_TOOL",
+ "TEAMMATE_ID_PREFIX",
"RETIRED_TOOLS",
"SKILL_ID_PREFIX",
"SKILL_TOOL",
"block_entries",
+ "expert_dispatch",
+ "expert_entries",
"mcp_catalog_entries",
"skill_entries",
"skill_name",
diff --git a/autogpt_platform/backend/backend/copilot/capabilities/sources/experts.py b/autogpt_platform/backend/backend/copilot/capabilities/sources/experts.py
new file mode 100644
index 0000000000..b7e62cf263
--- /dev/null
+++ b/autogpt_platform/backend/backend/copilot/capabilities/sources/experts.py
@@ -0,0 +1,105 @@
+"""Roster templates and the user's hired experts as capability entries.
+
+A template is someone the user can hire: ``expert:<template_id>`` runs as
+``hire_expert`` with the template bound, so hiring goes through the approval
+card that tool always returns. A hired expert is already on the team:
+``teammate:<expert_id>`` runs as ``delegate_to_expert`` with the expert bound.
+Both depend on the user, so ``tools.session_registry`` layers them on per
+call, as it does skills; the roster never reaches the injected prompt.
+"""
+
+from collections.abc import Iterable
+from typing import TYPE_CHECKING
+
+from backend.copilot.capabilities.models import (
+ CapabilityEntry,
+ Implementation,
+ clip_purpose,
+ normalize_text,
+)
+
+if TYPE_CHECKING:
+ from backend.api.features.experts.models import Expert, ExpertTemplate
+
+EXPERT_ID_PREFIX = "expert:"
+TEAMMATE_ID_PREFIX = "teammate:"
+HIRE_TOOL = "hire_expert"
+DELEGATE_TOOL = "delegate_to_expert"
+
+_DISPATCH = (
+ (EXPERT_ID_PREFIX, HIRE_TOOL, "template_id"),
+ (TEAMMATE_ID_PREFIX, DELEGATE_TOOL, "expert_id"),
+)
+
+
+def expert_entries(
+ templates: "Iterable[ExpertTemplate]", hired: "Iterable[Expert]"
+) -> list[CapabilityEntry]:
+ """Templates the user has not hired, then the hired experts themselves:
+ re-hiring an active template is a no-op, so it is offered once, as the
+ teammate."""
+ hired = list(hired)
+ hired_templates = {expert.source_template_id for expert in hired}
+ return [
+ *(
+ _entry(
+ template,
+ hired=False,
+ skills=[skill.title for skill in template.bundled_skills],
+ )
+ for template in templates
+ if template.id not in hired_templates
+ ),
+ *(_entry(expert, hired=True, skills=[]) for expert in hired),
+ ]
+
+
+def expert_dispatch(capability_id: str) -> tuple[str, dict[str, str]] | None:
+ """The tool an expert or teammate id runs as and the argument it binds,
+ or None for any other id."""
+ key = capability_id.strip()
+ for prefix, tool, argument in _DISPATCH:
+ if key.lower().startswith(prefix):
+ ref = key[len(prefix) :].strip()
+ return (tool, {argument: ref}) if ref else None
+ return None
+
+
+def _entry(expert: "Expert", *, hired: bool, skills: list[str]) -> CapabilityEntry:
+ prefix, tool = (
+ (TEAMMATE_ID_PREFIX, DELEGATE_TOOL)
+ if hired
+ else (
+ EXPERT_ID_PREFIX,
+ HIRE_TOOL,
+ )
+ )
+ title = expert.job_title or expert.role
+ workflows = ", ".join(w.name for w in expert.workflows if w.name)
+ # Skill titles say what the expert does in the words a request uses; the
+ # bio is left out because its prose put experts on unrelated searches.
+ description = " ".join(
+ part
+ for part in (
+ expert.role,
+ expert.job_title,
+ expert.tagline,
+ f"Workflows: {workflows}." if workflows else "",
+ f"Skills: {', '.join(skills)}." if skills else "",
+ )
+ if part
+ )
+ return CapabilityEntry(
+ id=f"{prefix}{expert.id}",
+ kind="expert",
+ klass="service",
+ name=expert.name,
+ purpose=clip_purpose(f"{title}: {expert.tagline}" if expert.tagline else title),
+ description=normalize_text(description),
+ tags=[*expert.categories, "expert", "hired" if hired else "hire"],
+ context="direct",
+ implementations=[
+ Implementation(kind="tool", ref=tool, name=tool, context="direct")
+ ],
+ hired=hired,
+ )
diff --git a/autogpt_platform/backend/backend/copilot/tools/capability_tools_test.py b/autogpt_platform/backend/backend/copilot/tools/capability_tools_test.py
index 53d0fac273..83e5f32757 100644
--- a/autogpt_platform/backend/backend/copilot/tools/capability_tools_test.py
+++ b/autogpt_platform/backend/backend/copilot/tools/capability_tools_test.py
@@ -61,6 +61,17 @@ def _clean_context():
set_execution_context(None, None)
[email protected](autouse=True)
+def _no_experts():
+ """Expert entries are per user and read from the database; with
+ hire-experts off the layer is empty (``expert_capabilities_test`` covers it)."""
+ with patch(
+ "backend.copilot.tools.session_registry.is_feature_enabled",
+ AsyncMock(return_value=False),
+ ):
+ yield
+
+
@pytest.fixture(autouse=True)
def skills():
"""The session's skill list is per user and read through Redis and the
diff --git a/autogpt_platform/backend/backend/copilot/tools/describe_capability.py b/autogpt_platform/backend/backend/copilot/tools/describe_capability.py
index 0af5c9e6aa..f18821289b 100644
--- a/autogpt_platform/backend/backend/copilot/tools/describe_capability.py
+++ b/autogpt_platform/backend/backend/copilot/tools/describe_capability.py
@@ -7,6 +7,7 @@ from typing import Any
from backend.copilot.capabilities.models import SKILL_TOOL, CapabilityEntry
from backend.copilot.capabilities.registry import configured_tool
from backend.copilot.capabilities.schema_trim import collapse_large_enums
+from backend.copilot.capabilities.sources import expert_dispatch
from backend.copilot.capabilities.sources.mcp_catalog import setup_hint
from backend.copilot.model import ChatSession
from backend.copilot.permissions import BLOCK_GATE, MCP_GATE
@@ -28,7 +29,7 @@ logger = logging.getLogger(__name__)
UNKNOWN_ID_HINT = (
"Unknown capability id. Use the exact 'id' from a find_capability result "
- "(tool:<name>, block:<uuid>, mcp:<host>, skill:<name>)."
+ "(tool:<name>, block:<uuid>, mcp:<host>, skill:<name>, expert:<id>)."
)
# A skill takes no input: running it is loading it.
@@ -117,6 +118,8 @@ class DescribeCapabilityTool(BaseTool):
if gate_denied(SKILL_TOOL):
return gate_denied_error(SKILL_TOOL, session_id)
return describe_skill(entry, session_id)
+ if entry.kind == "expert":
+ return describe_expert(entry, session_id)
if entry.kind == "tool":
name = entry.implementations[0].ref
if gate_denied(name):
@@ -165,6 +168,43 @@ def describe_skill(entry: CapabilityEntry, session_id: str) -> ToolResponseBase:
).from_outside()
+def describe_expert(entry: CapabilityEntry, session_id: str) -> ToolResponseBase:
+ """What running an expert id does: propose hiring a roster template, or
+ hand a teammate a task. The id carries the expert, so the input is the
+ rest of that tool's parameters."""
+ dispatch = expert_dispatch(entry.id)
+ tool = configured_tool(dispatch[0]) if dispatch else None
+ if dispatch is None or tool is None:
+ return ErrorResponse(
+ message=UNKNOWN_ID_HINT, session_id=session_id
+ ).from_outside()
+ name, bound = dispatch
+ if gate_denied(name):
+ return gate_denied_error(name, session_id)
+ action = "On the user's team" if entry.hired else "On the roster, not yet hired"
+ return CapabilityDetailsResponse(
+ message=(
+ f"{entry.name} — {entry.purpose} {action}: run_capability("
+ f"id='{entry.id}', input={{...}}) calls {name}. {tool.description}"
+ ),
+ capability=entry.listing(),
+ parameters=_without_properties(tool.parameters, set(bound)),
+ session_id=session_id,
+ ).from_outside()
+
+
+def _without_properties(schema: dict[str, Any], names: set[str]) -> dict[str, Any]:
+ return {
+ **schema,
+ "properties": {
+ key: value
+ for key, value in (schema.get("properties") or {}).items()
+ if key not in names
+ },
+ "required": [key for key in schema.get("required") or [] if key not in names],
+ }
+
+
def _describe_tool(
entry: CapabilityEntry, session_id: str, expand: bool
) -> ToolResponseBase:
diff --git a/autogpt_platform/backend/backend/copilot/tools/expert_capabilities_test.py b/autogpt_platform/backend/backend/copilot/tools/expert_capabilities_test.py
new file mode 100644
index 0000000000..83623d3d5c
--- /dev/null
+++ b/autogpt_platform/backend/backend/copilot/tools/expert_capabilities_test.py
@@ -0,0 +1,236 @@
+"""Experts in capability search: the roster a session can hire from and the
+team it can hand work to, found through ``find_capability`` and run as
+``hire_expert`` / ``delegate_to_expert``."""
+
+from unittest.mock import AsyncMock, MagicMock, patch
+
+import pytest
+
+from backend.api.features.experts.models import (
+ Expert,
+ ExpertBundledSkill,
+ ExpertTemplate,
+)
+from backend.copilot.capabilities.dispatch import resolve_tool_dispatch
+from backend.copilot.capabilities.ranking import ConnectionState
+from backend.copilot.capabilities.registry import get_registry
+from backend.copilot.capabilities.sources import expert_entries
+from backend.copilot.gate import review as review_store
+from backend.copilot.gate.content import ContentVerdict
+from backend.copilot.model import ChatSessionMetadata
+from backend.copilot.permissions import CopilotPermissions
+from backend.copilot.tools import (
+ expert_tool_disabled_groups,
+ origin_disabled_tools,
+ tool_names_in_groups,
+)
+
+from ._test_data import make_session
+from .base import BaseTool
+from .describe_capability import DescribeCapabilityTool
+from .find_capability import FindCapabilityTool
+from .hire_expert import HireExpertTool
+from .models import CapabilityDetailsResponse, CapabilityListResponse
+from .run_capability import RunCapabilityTool
+from .session_registry import _hireable_roster, may_hire, session_expert_entries
+
+USER = "user-1"
+_SR = "backend.copilot.tools.session_registry"
+
+
+def _expert(expert_id: str, name: str, role: str, **extra) -> Expert:
+ fields = {
+ "avatar_url": None,
+ "tagline": None,
+ "bio": None,
+ "skills": [],
+ "identity": "",
+ "voice_preferences": "",
+ "boundaries": "",
+ "protected_soul_rules": [],
+ "is_template": False,
+ "source_template_id": None,
+ "is_archived": False,
+ "workflows": [],
+ }
+ return Expert(id=expert_id, name=name, role=role, **(fields | extra))
+
+
+JULES = ExpertTemplate(
+ **_expert(
+ "tpl-jules",
+ "Jules",
+ "Social & Content Repurposing",
+ job_title="Social Media Manager",
+ is_template=True,
+ ).model_dump(),
+ bundled_skills=[
+ ExpertBundledSkill(
+ id="s1", slug="social", title="Social media management", description=""
+ )
+ ],
+)
+VERA = ExpertTemplate(
+ **_expert("tpl-vera", "Vera", "Vendor & Procurement", is_template=True).model_dump()
+)
+HIRED_VERA = _expert(
+ "exp-vera", "Vera", "Vendor & Procurement", source_template_id="tpl-vera"
+)
+
+
+def team():
+ """Hire-experts on, Vera hired, Jules and Vera on the roster."""
+ db = MagicMock()
+ db.list_experts = AsyncMock(return_value=[HIRED_VERA])
+ db.list_templates = AsyncMock(return_value=[JULES, VERA])
+ db.with_bundled_skills = AsyncMock(side_effect=lambda templates, _user: templates)
+ _hireable_roster.cache_clear()
+ with (
+ patch(f"{_SR}.is_feature_enabled", AsyncMock(return_value=True)),
+ patch(f"{_SR}.experts_db", MagicMock(return_value=db)),
+ patch(f"{_SR}.is_skills_feature_enabled", AsyncMock(return_value=False)),
+ patch(
+ "backend.copilot.tools.find_capability.load_connection_state",
+ AsyncMock(return_value=ConnectionState()),
+ ),
+ ):
+ yield db
+ _hireable_roster.cache_clear()
+
+
+async def test_find_capability_offers_the_roster_expert_toran_asked_for(team):
+ result = await FindCapabilityTool()._execute(
+ USER, make_session(USER), query="hire expert social media manager"
+ )
+
+ assert isinstance(result, CapabilityListResponse)
+ experts = [c for c in result.capabilities if c["kind"] == "expert"]
+ assert experts[0] == {
+ "id": "expert:tpl-jules",
+ "name": "Jules",
+ "purpose": "Social Media Manager",
+ "kind": "expert",
+ "hired": False,
+ }
+ assert "kind=expert" in result.message
+
+
+async def test_a_hired_template_is_offered_as_the_teammate_only(team):
+ result = await FindCapabilityTool()._execute(
+ USER, make_session(USER), query="vendor procurement", kind="expert"
+ )
+
+ assert isinstance(result, CapabilityListResponse)
+ assert [(c["id"], c["hired"]) for c in result.capabilities] == [
+ ("teammate:exp-vera", True)
+ ]
+
+
+ "capability_id, tool, bound",
+ [
+ ("expert:tpl-jules", "hire_expert", {"template_id": "tpl-jules"}),
+ ("teammate:exp-vera", "delegate_to_expert", {"expert_id": "exp-vera"}),
+ ],
+)
+def test_running_an_expert_id_is_the_call_it_names(capability_id, tool, bound):
+ # The model's input cannot point the call at a different expert.
+ call = resolve_tool_dispatch(
+ "run_capability",
+ {"id": capability_id, "input": {**dict.fromkeys(bound, "other"), "x": 1}},
+ )
+
+ assert call is not None
+ assert call.name == tool
+ assert call.args == {"x": 1, **bound}
+
+
+async def test_describe_expert_asks_only_for_what_the_id_does_not_carry(team):
+ result = await DescribeCapabilityTool()._execute(
+ USER, make_session(USER), id="expert:tpl-jules"
+ )
+
+ assert isinstance(result, CapabilityDetailsResponse)
+ assert "calls hire_expert" in result.message
+ assert set(result.parameters["properties"]) == {"name"}
+ assert result.parameters["required"] == []
+
+
[email protected]("validate_only", [True, False])
+async def test_run_capability_itself_describes_an_expert_and_hires_no_one(
+ team, validate_only
+):
+ # The engines dispatch an expert id to hire_expert; a call that reaches
+ # run_capability undispatched must not hire past the approval card.
+ with patch.object(HireExpertTool, "_execute", AsyncMock()) as hire:
+ result = await RunCapabilityTool()._execute(
+ USER,
+ make_session(USER),
+ id="expert:tpl-jules",
+ input={},
+ validate_only=validate_only,
+ )
+
+ assert isinstance(result, CapabilityDetailsResponse)
+ assert "calls hire_expert" in result.message
+ hire.assert_not_awaited()
+
+
+async def test_an_expert_ids_validate_only_answer_is_not_held_by_the_judge(team):
+ # The answer quotes hire_expert's own instructions to the model; judged
+ # whole, the content judge would hold the platform's words as a page's.
+ session = make_session(USER)
+ session.metadata.autopilot_mode = "auto"
+ judge = AsyncMock(return_value=ContentVerdict(held=False))
+ with (
+ patch("backend.copilot.gate.is_feature_enabled", AsyncMock(return_value=True)),
+ patch.object(review_store, "find_review", AsyncMock(return_value=None)),
+ patch.object(BaseTool, "_gate", AsyncMock(return_value=(None, False))),
+ patch("backend.copilot.gate.reads.judge_content", judge),
+ ):
+ result = await RunCapabilityTool().execute(
+ USER,
+ session,
+ "call-1",
+ id="expert:tpl-jules",
+ input={},
+ validate_only=True,
+ )
+
+ assert result.success and "calls hire_expert" in result.output
+ judge.assert_not_awaited()
+
+
[email protected]("expert_id", [None, "exp-1"])
[email protected]("origin", ["interactive", "automation", None])
+def test_the_roster_shows_exactly_where_the_engines_let_hire_expert_run(
+ expert_id, origin
+):
+ session = make_session(USER, expert_id=expert_id)
+ session.metadata = ChatSessionMetadata(origin=origin)
+ hidden = tool_names_in_groups(
+ expert_tool_disabled_groups(experts_enabled=True, expert_id=expert_id)
+ ) | origin_disabled_tools(origin)
+
+ assert may_hire(session) == ("hire_expert" not in hidden)
+ # Teammates show whenever the flag is on, as delegate_to_expert does.
+ assert "delegate_to_expert" not in hidden
+
+
+async def test_an_expert_session_sees_its_teammates_and_no_roster(team):
+ team.list_experts.return_value = [HIRED_VERA, _expert("exp-me", "Me", "Self")]
+
+ entries = await session_expert_entries(USER, make_session(USER, expert_id="exp-me"))
+
+ assert [e.id for e in entries] == ["teammate:exp-vera"]
+ team.list_templates.assert_not_called()
+
+
+async def test_experts_are_hidden_when_the_turn_may_not_run_their_tool():
+ index = get_registry().with_entries(expert_entries([JULES], [HIRED_VERA]))
+ deny_hire = CopilotPermissions(tools=["hire_expert"])
+
+ ids = index.search("social media vendor", kind="expert", permissions=deny_hire).ids
+
+ assert ids == ["teammate:exp-vera"]
diff --git a/autogpt_platform/backend/backend/copilot/tools/find_capability.py b/autogpt_platform/backend/backend/copilot/tools/find_capability.py
index 740bb857e3..4cf313f385 100644
--- a/autogpt_platform/backend/backend/copilot/tools/find_capability.py
+++ b/autogpt_platform/backend/backend/copilot/tools/find_capability.py
@@ -1,5 +1,5 @@
"""Search the capability registry: integrations, blocks, MCP servers,
-platform tools and the session owner's skills behind one query."""
+platform tools, the session owner's skills and experts behind one query."""
import asyncio
import logging
@@ -27,12 +27,13 @@ from .session_registry import session_registry
logger = logging.getLogger(__name__)
CONTEXTS = ("direct", "graph")
-KINDS = ("tool", "block", "mcp_server", "skill")
+KINDS = ("tool", "block", "mcp_server", "skill", "expert")
_KIND_ARG: dict[str, CapabilityKindName] = {
"tool": "tool",
"block": "block",
"mcp_server": "mcp_server",
"skill": "skill",
+ "expert": "expert",
}
@@ -50,7 +51,8 @@ class FindCapabilityTool(BaseTool):
def description(self) -> str:
return (
"Search everything the platform can do: integrations, blocks, MCP "
- "servers, platform tools and skills, by service name or action. "
+ "servers, platform tools, skills and experts to hire, by service, "
+ "action or role. "
"Results are ranked and show whether the user has connected each "
"one. Call this before saying something is not possible. Then "
"describe_capability(id) to see inputs, and run_capability(id, "
@@ -149,6 +151,7 @@ class FindCapabilityTool(BaseTool):
len(result.hits),
len(result.fallback),
skills=any(hit.entry.kind == "skill" for hit in result.hits),
+ experts=any(hit.entry.kind == "expert" for hit in result.hits),
needs_grant=any(
c.get("connected") == NEEDS_EXPERT_GRANT
for c in capabilities + fallback
@@ -180,6 +183,7 @@ def _message(
fallback: int,
*,
skills: bool = False,
+ experts: bool = False,
needs_grant: bool = False,
) -> str:
parts = [f"Found {hits} capabilit{'y' if hits == 1 else 'ies'}"]
@@ -207,4 +211,10 @@ def _message(
"run_capability(id, input={}) loads its body and package files; "
"read it before acting."
)
+ if experts:
+ text += (
+ " A kind=expert result is an AI expert: hired=false is on the "
+ "roster and running it proposes the hire on an approval card; "
+ "hired=true is on the user's team and running it delegates a task."
+ )
return text
diff --git a/autogpt_platform/backend/backend/copilot/tools/hire_expert.py b/autogpt_platform/backend/backend/copilot/tools/hire_expert.py
index 27ae90af81..9eb5bf706b 100644
--- a/autogpt_platform/backend/backend/copilot/tools/hire_expert.py
+++ b/autogpt_platform/backend/backend/copilot/tools/hire_expert.py
@@ -109,7 +109,7 @@ class HireExpertTool(BaseTool):
return ErrorResponse(
message=(
f"No expert template with id {template_id.strip()} is on "
- "the roster. List the roster and pick a current one."
+ 'the roster. Find one with find_capability(kind="expert").'
),
session_id=session_id,
)
diff --git a/autogpt_platform/backend/backend/copilot/tools/run_capability.py b/autogpt_platform/backend/backend/copilot/tools/run_capability.py
index f6fc861e49..7b0db122c4 100644
--- a/autogpt_platform/backend/backend/copilot/tools/run_capability.py
+++ b/autogpt_platform/backend/backend/copilot/tools/run_capability.py
@@ -33,7 +33,12 @@ from backend.data.activity_event import ActivityEventDraft
from .base import GATE_APPROVED, BaseTool
from .capability_gates import gate_denied, gate_denied_error
-from .describe_capability import MCP_RUN_PARAMETERS, UNKNOWN_ID_HINT, describe_skill
+from .describe_capability import (
+ MCP_RUN_PARAMETERS,
+ UNKNOWN_ID_HINT,
+ describe_expert,
+ describe_skill,
+)
from .helpers import (
prepare_block_for_execution,
required_input_keys,
@@ -203,6 +208,10 @@ class RunCapabilityTool(BaseTool):
return await _describe_tool(entry, session)
if entry.kind == "skill":
return await _run_skill(entry, user_id, session, validate_only)
+ if entry.kind == "expert":
+ # The engines run an expert id as the hire or delegate call it is
+ # (``capabilities/dispatch.py``), so this answers validate_only.
+ return describe_expert(entry, session_id)
if entry.kind == "mcp_server":
server_url = entry.implementations[0].ref
if not server_url:
diff --git a/autogpt_platform/backend/backend/copilot/tools/session_registry.py b/autogpt_platform/backend/backend/copilot/tools/session_registry.py
index 840294a68f..8ffb966d83 100644
--- a/autogpt_platform/backend/backend/copilot/tools/session_registry.py
+++ b/autogpt_platform/backend/backend/copilot/tools/session_registry.py
@@ -1,27 +1,42 @@
"""The capability index a session searches: the platform registry plus the
-session owner's skills.
+session owner's skills and the experts the session can hire or delegate to.
Skills belong to a user, and within a user to one owner folder — the
expert's, or personal Otto's — so they cannot sit in the process-wide
registry. They are layered on per call from the same cached list that
builds ``<available_skills>``, so a search costs no extra storage reads.
+Experts depend on the user too: the roster minus who they hired, plus the
+team itself.
"""
+import asyncio
import logging
import time
from collections import OrderedDict
+from backend.api.features.experts.models import ExpertTemplate
from backend.copilot.capabilities.index import CapabilityIndex
from backend.copilot.capabilities.models import CapabilityEntry
from backend.copilot.capabilities.registry import get_registry
from backend.copilot.capabilities.resolve import resolve_entry
-from backend.copilot.capabilities.sources import skill_entries, skill_name
+from backend.copilot.capabilities.sources import (
+ expert_dispatch,
+ expert_entries,
+ skill_entries,
+ skill_name,
+)
from backend.copilot.model import ChatSession
+from backend.data.db_accessors import experts_db
+from backend.util.cache import cached
+from backend.util.feature_flag import Flag, is_feature_enabled
from .skills import SKILLS_INDEX_CACHE_TTL_S, is_skills_feature_enabled, list_all_skills
logger = logging.getLogger(__name__)
+# The roster changes only when a deploy publishes the skills catalog.
+ROSTER_CACHE_TTL_S = 300
+
# Layering reuses the platform documents but BM25 re-derives its corpus
# statistics over all of them: some 40 ms of CPU on the event loop per
# search. A skill list changes rarely and is itself cached for
@@ -35,24 +50,28 @@ _layered: OrderedDict[
async def session_registry(user_id: str, session: ChatSession) -> CapabilityIndex:
- """The platform index with this session's skills layered on."""
- return layered_index(get_registry(), await session_skill_entries(user_id, session))
+ """The platform index with this session's skills and experts layered on."""
+ skills, experts = await asyncio.gather(
+ session_skill_entries(user_id, session),
+ session_expert_entries(user_id, session),
+ )
+ return layered_index(get_registry(), skills + experts)
def layered_index(
- base: CapabilityIndex, skills: list[CapabilityEntry]
+ base: CapabilityIndex, entries: list[CapabilityEntry]
) -> CapabilityIndex:
- """*base* with *skills* layered on, reused within the skill-cache window
- for the same platform index and the same skills."""
- if not skills:
+ """*base* with *entries* layered on, reused within the skill-cache window
+ for the same platform index and the same entries."""
+ if not entries:
return base
- key = (id(base), len(base), tuple((e.id, e.description) for e in skills))
+ key = (id(base), len(base), tuple((e.id, e.description) for e in entries))
now = time.monotonic()
cached = _layered.get(key)
if cached is not None and cached[0] > now:
_layered.move_to_end(key)
return cached[1]
- index = base.with_entries(skills)
+ index = base.with_entries(entries)
_layered[key] = (now + SKILLS_INDEX_CACHE_TTL_S, index)
_layered.move_to_end(key)
while len(_layered) > _LAYERED_MAX:
@@ -64,12 +83,22 @@ async def resolve_session_entry(
user_id: str, session: ChatSession, capability_id: str
) -> CapabilityEntry | None:
"""``resolve_entry`` over the platform registry, plus the session's
- skills by ``skill:<name>`` id.
+ skills by ``skill:<name>`` id and experts by ``expert:``/``teammate:`` id.
- A skill id is looked up among the skills only: falling through to the
- registry's name match would let ``skill:web_search`` resolve to the
+ A skill or expert id is looked up among those only: falling through to
+ the registry's name match would let ``skill:web_search`` resolve to the
platform tool of that name.
"""
+ if expert_dispatch(capability_id) is not None:
+ key = capability_id.strip().lower()
+ return next(
+ (
+ entry
+ for entry in await session_expert_entries(user_id, session)
+ if entry.id.lower() == key
+ ),
+ None,
+ )
name = skill_name(capability_id)
if name is None:
return resolve_entry(get_registry(), capability_id)
@@ -97,3 +126,35 @@ async def session_skill_entries(
logger.warning("Could not load skills for capability search", exc_info=True)
return []
return skill_entries(skills)
+
+
+async def session_expert_entries(
+ user_id: str, session: ChatSession
+) -> list[CapabilityEntry]:
+ """Roster templates this session may hire and the teammates it may hand
+ work to; ``[]`` when hire-experts is off or a read fails, so an experts
+ hiccup never takes capability search down with it."""
+ try:
+ if not await is_feature_enabled(Flag.HIRE_EXPERTS, user_id, default=False):
+ return []
+ team = await experts_db().list_experts(user_id, with_metrics=False)
+ templates = await _hireable_roster(user_id) if may_hire(session) else []
+ except Exception:
+ logger.warning("Could not load experts for capability search", exc_info=True)
+ return []
+ return expert_entries(
+ templates, [expert for expert in team if expert.id != session.expert_id]
+ )
+
+
+def may_hire(session: ChatSession) -> bool:
+ """Whether ``hire_expert`` runs in this session: the engines hide it from
+ expert sessions (``expert_admin``) and from origins nobody is driving
+ (``origin_disabled_tools``); ``expert_capabilities_test`` holds them equal."""
+ return session.expert_id is None and session.metadata.origin == "interactive"
+
+
+@cached(ttl_seconds=ROSTER_CACHE_TTL_S, maxsize=1024)
+async def _hireable_roster(user_id: str) -> list[ExpertTemplate]:
+ db = experts_db()
+ return await db.with_bundled_skills(await db.list_templates(), user_id)
diff --git a/autogpt_platform/backend/backend/copilot/tools/tool_schema_test.py b/autogpt_platform/backend/backend/copilot/tools/tool_schema_test.py
index a33a6d7381..34fc1a72f1 100644
--- a/autogpt_platform/backend/backend/copilot/tools/tool_schema_test.py
+++ b/autogpt_platform/backend/backend/copilot/tools/tool_schema_test.py
@@ -448,7 +448,12 @@ def test_total_schema_char_budget() -> None:
# the plus-one ceiling above. Same headroom, for the same reason.
# merged tree 69,183
# + headroom +300 69,483
-_SESSION_WIRE_BUDGET = 69_483
+#
+# Re-measured on #15149 merged with dev f2c683cf2b, which itself measured
+# 69,461, 22 under the line above; find_capability's expert kind adds 27.
+# merged tree 69,488
+# + headroom +300 69,788
+_SESSION_WIRE_BUDGET = 69_788
def test_largest_declared_session_wire_budget() -> None: