All B-Agent apps Home
Case study · B-Agent

B-Agent Research

Chat with your company's documents and data, securely.

Built it end to end: the React front end, the Azure Functions backend, the connectors, the MCP server, the VS Code bridge and the code Lab.

17connector types
11slide layouts the AI deck planner picks from
190 sdeck build budget under a 230 s HTTP cap
5review lenses in the code Lab
The problem

Company knowledge sits in SharePoint, OneDrive, Outlook, Power BI and databases, and each has its own search and its own permissions. Teams wanted one place to ask questions, without an AI that can see more than the person asking.

The approach

Index every source through one resumable pipeline into Azure AI Search, and filter every answer through the same access rule, whether the question comes from chat, a scheduled task or an MCP client. People connect their own Microsoft data with delegated consent, so a source reaches only what that person can already open.

How it works

From request to answer, step by step.

  1. 01Connectors17 source types: Microsoft 365, databases, GitHub, uploads, web
  2. 02Queued extractA Storage Queue job splits documents into chunks in Cosmos DB
  3. 03Embed and indexChunks embedded with Azure OpenAI, uploaded idempotently to Azure AI Search
  4. 04Permission filterSame access rule for chat, scheduled tasks and MCP clients
  5. 05Model with toolsRetrieval, text-to-SQL on databases, optional web search
  6. 06Cited sources onlyOnly documents the answer cites are listed, plus follow-up suggestions
  7. 07Encrypted storageChats sealed per user with AES-256-GCM before reaching Cosmos DB

What it does

  • Ask across SharePoint, OneDrive, Outlook, Power BI, databases and uploads.
  • Answers list only the sources they actually cite.
  • Schedule questions to run on their own; answers land in your chat.
  • Turn any answer into a designed PowerPoint deck.
  • Code in the browser with an AI assistant, on GitHub repos or your own computer.

Under the hood

  • 17 connector types feed a resumable three-step indexing pipeline: extract, embed, search.
  • Chats are encrypted per user (AES-256-GCM). Admins see usage counts, never message text.
  • An MCP server brings the same knowledge into VS Code and Claude Code, with the same permission filter.
  • A background Lab reviews codebases: 7,298 findings across 4 repos so far.
Hard problems

What took real engineering.

Problem 1

The pipeline stuck at 0%

Indexing phases used to chain through a fire-and-forget HTTP call to the app itself, which dropped the admin's token and relied on an internal key that was never configured, so the embed phase got a 401 and progress froze at 0%. I replaced the self-calls with Storage Queue messages, one per phase and continuation. When a slow batch later overran the host timeout, document ids keyed by source and position made uploads idempotent, so a job resumes from its last batch without re-extracting.

Problem 2

Refresh tokens that quietly rotate

Delegated connectors index in a background worker with nobody signed in, so they keep an encrypted refresh token. Entra rotates refresh tokens: the old one keeps working for days, then fails without explanation, so every refresh now writes the new token back to the source. The OAuth callback cannot carry a bearer token either, so an HMAC-signed, 10-minute state value proves the redirect came from a connect call the app issued.

Problem 3

Letting a website touch your disk

Research's AI can work on files on a person's own computer through a small bridge app. The server never relays file contents; it only mints Web PubSub tokens that pair a device with its owner, and the safety rules (a folder jail, a secrets list, a protected-branch confirmation) live on the PC. The model proposes, and every write, commit or command needs a click.

Built with
ReactTypeScriptAzure FunctionsCosmos DBAzure AI SearchAzure OpenAIMCP