Install
Client setup
- Browser (public key)
- Node.js (client credentials)
clientKey (browser/RN) or clientId + clientSecret (server), plus optional baseUrl (default https://api.agents.beforequery.com).
Run an agent
MCP tools
Typed wrappers over the project MCP server; the JSON-RPCinitialize handshake happens lazily:
A2A protocol
defineAgent — graph as code
Define and validate agent graphs in TypeScript; the output matches the backend JSON format:coordinator; unique node ids; edges must reference existing nodes; self-loops rejected. Violations throw AgentGraphError.
Error handling
Self-hosted agent runtime
The package ships an HTTP runtime server so you can execute agent graphs on your own infrastructure (credentials still authenticate against the BeforeQuery API for retrieval and LLM calls)..json files in the mounted directory — either a named manifest with remoteAgentId (proxies to a cloud agent) or a bare graph (filename stem becomes the agent ID, validated by defineAgent at startup).
Runtime endpoints:
GET /healthz, GET /agents, POST /run/:agentId with body { input, context? }.