All answers

We're building three internal agents. Should each get its own retrieval, or should they share one?

Dennis PilarinosDennis Pilarinos·Dec 3, 2026·Context Engine · Engineering Insights

Share one retrieval layer and give each agent its own credential. Three pipelines means three indexes to sync, three permission mappings and three answers to the same question. With Unblocked, all three agents call one context engine over MCP, the CLI or the REST API, each with its own credential: a person's sign-in, or a team token limited to the data sources that agent needs.

Share one retrieval layer, and give each of the three internal agents its own credential and its own instructions. Separate retrieval for each agent means three sets of connectors, sync jobs, permission rules and tests. It also means three answers to the same question once the indexes drift apart. With Unblocked, the platform team connects code, pull requests, issues, docs and Slack once. Each agent then calls the same context engine over MCP, the CLI or the REST API, using its own credential: the sign-in of the person it acts for, or a team token limited to the data sources it needs. Shared retrieval is one index and one ranking layer that several agents query, each under its own scope. Unblocked is one example. Say a coding agent, an on-call agent and a support triage agent each ask why the payments webhook gives up after 30 seconds. All three get the same cited pull request back.

What separate retrieval per agent costs#

Building retrieval for internal agents 3 times triples the plumbing, and the cost grows with every source you add.

3 separate pipelines1 shared layer, 3 credentials
Connectors to build and fix3 per source1 per source
Sync jobs3, on 3 schedules1
Permission mappingCopied and refreshed 3 timesDone once
Answer to the same questionCan differ by agentThe same, with the same citations
What differs per agentEverythingPrompt, tools, output format, scope

Permission mapping is the hardest row. Microsoft's Azure AI Search docs show the work for one system. Chunked documents need permissions written to "every protected chunk." And "permission refresh doesn't provide immediate revocation or a corpus-wide freshness SLA" (Microsoft Learn). Doing that 3 times is 3 chances to get it wrong. Our post on context engines versus RAG covers why ranking across sources is harder than it looks.

Where shared retrieval for internal agents goes wrong#

Over-shared retrieval is a shared index behind one service account. Every agent then sees everything that account can see, so the support bot can quote a private incident channel.

A May 2026 paper on enterprise retrieval names the cause. Retrieval systems "rank documents by relevance," not by who is allowed to read them, so a query "can surface another tenant's confidential data simply because it scores highest." The authors propose "retrieval-time gating" enforced on the server. In their tests, attribute-based gating "eliminates cross-tenant leakage while introducing negligible overhead" (arXiv 2605.05287). A June 2026 benchmark of shared-memory agents found the same risk. Its finding: "retrieval-based and external-memory methods reduce cost yet still leak unauthorized or deleted information" (arXiv 2606.18829).

So share the index and split the identity. Each agent gets its own credential, scoped to the sources its job needs. If your agents reach the shared layer over MCP, the protocol points the same way. The MCP specification says clients "SHOULD follow the principle of least privilege by requesting only the scopes necessary for their intended operations" (MCP specification).

How to scope 3 internal agents on one index#

Decide, for each agent, whose access it runs with.

  1. An agent acting for a person, such as a coding agent in Claude Code or Cursor (now Grok Build), signs in as that person through OAuth. With Data Shield on, answers respect each source's permissions.
  2. An agent running as a service, such as an on-call bot or a nightly report, uses a team token. A team token is a service credential that reads every document in the data sources picked for it. Unblocked's docs say "Team Access Tokens can access every document in the data sources selected when the token is created" (Unblocked API quickstart). Data Shield checks whether "the user posing the question" can see the source material (Unblocked Data Shield docs), so it does not narrow a team token. The token's data source list is the control.
  3. An agent that answers customers gets the narrowest team token, with no private engineering channels in it. A person reviews anything drawn from internal sources.

Give each agent its own token. In Unblocked, each team API key can also carry its own monthly credit limit, so one busy agent cannot use up the shared pool (Unblocked docs). Separate tokens also show up separately in usage, which tells you which agent drives cost.

How Unblocked serves 3 agents from one engine#

Unblocked reads code, pull requests, issues, docs, Slack or Teams and incidents, then reconciles them into one cited answer. Agents reach it 3 ways. The docs put it this way: "Developers can use MCP, CI jobs can use the CLI, and a backend service can send documents through the REST API" (Unblocked docs). The API quickstart says the research endpoint returns "a Markdown summary and the sources that support it," so each agent gets an answer with links it can follow or show.

Say one agent needs a system Unblocked does not connect to. You can push documents into a Public API Collection or connect a Custom MCP server, and all 3 agents see it (Unblocked docs). Wiring MCP tools straight into each agent is a different setup, covered in why MCP connectors are not a context engine. How the engine ranks a merged pull request above an old wiki page is in inside the Unblocked context engine. For bots, agents and people together, see one context source for agents, support bots and Q&A.

When each agent should keep its own retrieval#

Separate retrieval is the better call in 3 cases:

  • The sources don't overlap. An HR policy bot and a coding agent share nothing, so a shared layer buys little.
  • One agent handles data that must never sit in a shared index, such as regulated records with their own retention and audit rules.
  • One agent needs a special index, such as metrics or a product catalog with exact-match lookups, that a general context engine is not built to rank.

Even then, keep the shared layer for what the agents have in common, and add the special source to the one agent that needs it. The same Microsoft doc, updated in November 2026, lists one benefit of native permission checks as "Reduces custom permission code." The same logic applies across agents. For 3 agents that all ask about code, tickets and decisions, one retrieval layer with 3 scoped credentials is less to build and less to keep in sync.