Multi-agent workflows
on your knowledge base
Build coordinator-to-specialist agent graphs, insert human-approval steps where needed, and get full trace observability on every run. Open protocols — MCP, A2A, and webhooks — let any AI tool connect to your knowledge base out of the box.
Build, approve, and observe — end to end
Every component a production agent workflow needs
Multi-Agent Builder
Visual + code- Coordinator agent routes tasks to specialist agents
- Each agent has its own tools, persona, and knowledge scope
- Define agent graphs with branches and conditionals
- Handoff context preserved across agent hops
- Retry and fallback policies per agent node
- Export graph as @beforequery/agents TypeScript definition
Human-Approval Workflows
When it matters- Insert approval gates at any step in the agent graph
- Approvers notified via Slack, email, or webhook
- Full context — question, retrieved docs, proposed action — shown at approval
- Approve, reject, or modify before execution continues
- Approval audit log with timestamps and approver identity
- Configurable auto-expire with default action on timeout
Traces & Observability
Full visibility- Per-run agent trace with every step, tool call, and decision
- Latency breakdown per agent node
- Retrieved chunks and retrieval scores logged per step
- LLM token usage and cost per trace
- Filter and search traces by agent, project, or outcome
- Export traces via API for external observability tools
Docs gaps closed automatically
BeforeQuery tracks every question that returned a low-confidence answer. The knowledge maintenance agent analyzes these gaps, proposes new or updated doc sections to fill them, and queues the proposals for your review. Accept a proposal and it is written directly into your knowledge base.
- Detects unanswered questions from analytics automatically
- Groups related gaps into coherent doc sections
- Generates draft content grounded in your existing docs
- Review and accept proposals with a single click
- Accepted docs are indexed and answer questions immediately
- Tracks coverage improvement over time in analytics
BeforeQuery retries failed webhook deliveries with exponential backoff: 1s, 5s, 30s, 5m, 30m. After 5 failures the webhook is marked inactive...
Any AI tool can connect to your knowledge base
MCP, A2A, webhooks, and a TypeScript SDK — open standards so your knowledge base works with your entire AI stack
MCP Server
Every project exposes a per-project MCP (Model Context Protocol) server. Any AI app or IDE — Cursor, Windsurf, Claude Desktop, or your own LLM — can query your docs as structured MCP tools with a single endpoint.
A2A API
Agent-to-agent API lets external agents discover and call BeforeQuery agents. Publish your agent capabilities and accept calls from any A2A-compatible orchestrator.
Webhook Triggers
Trigger agent runs from external events via signed webhooks. Connect any external system — deploys, CRM updates, ticket events — to kick off an agent workflow automatically.
@beforequery/agents SDK
Open TypeScript SDK for building agent graphs in code. runAgent, defineAgent, and built-in MCP and A2A clients. Fully typed, works in Node.js and edge runtimes.
Define agent graphs in TypeScript
The open-source @beforequery/agents package gives you typed primitives to define, run, and compose agent workflows in code. Built-in clients for MCP and A2A mean your agents can call any MCP tool or A2A agent alongside BeforeQuery's own retrieval.
- runAgent — execute a single agent with inputs and get typed outputs
- defineAgent — declare nodes, edges, tools, and approval gates
- mcpClient — call any MCP server as a tool inside your agent
- a2aClient — call external A2A agents from within your graph
- Works in Node.js 18+, edge runtimes, and serverless functions
- MIT licensed, fully open source
import { defineAgent, runAgent } from "@beforequery/agents";
const supportAgent = defineAgent({
projectId: "proj_abc123",
nodes: [
{
id: "retrieve",
type: "retrieval",
collections: ["public-docs", "tickets"],
},
{
id: "draft",
type: "llm",
persona: "support-agent",
after: "retrieve",
},
{
id: "approve",
type: "human-approval",
notifySlack: "#support-review",
after: "draft",
condition: "confidence < 0.85",
},
],
});
const result = await runAgent(supportAgent, {
input: "How do I cancel my subscription?",
});Frequently Asked Questions
Common questions about BeforeQuery Agent Platform
Ready to build your first agent?
Start with the MCP server — connect your IDE to your docs in five minutes.