AGENT PLATFORM

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
KNOWLEDGE MAINTENANCE

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
KNOWLEDGE GAP PROPOSAL
GAP DETECTED
24 users asked about "how to handle webhook retries" — no doc found above threshold.
PROPOSED DOC SECTION
Webhook Retry Behavior
BeforeQuery retries failed webhook deliveries with exponential backoff: 1s, 5s, 30s, 5m, 30m. After 5 failures the webhook is marked inactive...
OPEN PROTOCOLS

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.

@beforequery/agents SDK

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
@beforequery/agents — EXAMPLE
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

A coordinator agent is the entry point of a multi-agent graph. It receives the user input, decides which specialist agents to invoke (and in what order), assembles their outputs, and returns a final answer. You define the routing logic — BeforeQuery executes the graph and handles context passing between agents.
You insert an approval gate node anywhere in your agent graph. When execution reaches that node, the run pauses and notifiers are sent via Slack, email, or webhook. The approver sees the full context — the original question, retrieved documents, and the proposed agent action — and chooses to approve, reject, or modify. Execution resumes only after a decision. Configurable auto-expiry applies a default action (approve or reject) if no response arrives within the timeout.
Each BeforeQuery project exposes an MCP-compatible endpoint at POST https://api.beforequery.com/mcp/projects/:projectId. Authenticate with your X-Client-Key header. Any MCP-aware AI application — IDEs like Cursor and Windsurf, Claude Desktop, or custom LLM wrappers — can list and call your project's knowledge as structured MCP tools.
It is an open-source TypeScript package (npm install @beforequery/agents) that provides typed primitives to define and run agent graphs in code. It includes runAgent for single executions, defineAgent for graph declarations, and built-in MCP and A2A clients. It runs in Node.js 18+, Vercel Edge, Cloudflare Workers, and standard serverless environments.
BeforeQuery continuously monitors questions that returned low-confidence answers. The knowledge maintenance agent groups related gaps, proposes new doc sections to address them, and queues proposals in the dashboard for your review. When you accept a proposal, the content is immediately indexed and begins answering questions. You can also auto-accept proposals above a quality threshold if you prefer a fully automated flow.
Basic agent features including the MCP server and @beforequery/agents SDK are available on Pro and above. Human-approval workflows, multi-agent graphs, and observability traces are Enterprise features. Contact sales for custom pricing based on your agent run volume.

Ready to build your first agent?

Start with the MCP server — connect your IDE to your docs in five minutes.