These packages give you a complete multi-agent orchestrator that routes user requests to the right agent based on intent confidence, manages multi-turn sessions, and isolates failing agents with circuit breakers. You would adopt them to build a production system where multiple specialized AI agents handle different tasks (like password resets, HR queries, or IT support) behind a single API endpoint, with automatic fallback and clarification when the intent is unclear. The most distinctive thing is how the packages compose around a confidence-gated decision tree—Gemini Flash classifies intent, a 5-rule engine decides whether to route, clarify, or fall back, and per-agent circuit breakers with Firestore persistence prevent cascading failures across Cloud Run instances.
A Zod-schema and TypeScript type package that defines the core domain entities, request/response shapes, and environment configuration for the agent-mesh multi-agent orchestrator ecosystem. It exports 15+ validated schemas and types (e.g., `IncomingRequestSchema`, `ContextPacketSchema`, `CircuitBreakerStateSchema`) along with shared constants, with `zod` as its only runtime dependency.
A Gemini Flash intent classifier that maps user requests to registered agents, returning a `ClassifierOutput` with agent ID, confidence score, and detected language. It dynamically builds prompts from an agent registry and falls back to a keyword-based mock classifier when Gemini is unavailable.
A decision engine that evaluates classifier output against agent thresholds using a 5-rule decision tree to route requests, ask for clarification, or fall back to a default agent. It exports `evaluateConfidenceGate` (the main routing function), `generateClarificationQuestion`, and a singleton `clarificationCache` with LRU/TTL semantics, and is designed to work with the agent-mesh orchestrator's agent registry.
An Express middleware pipeline that provides a `/v1/request` endpoint for orchestrating agent dispatch, including authentication, rate limiting, TLS enforcement, health checks, and Slack profile resolution.
Exposes the agent-mesh orchestrator as an MCP-compliant agent by providing Express middleware (`mcpMiddleware`), JSON-RPC 2.0 handlers, and SSE transport for legacy client compatibility. Depends on `@reaatech/agent-mesh` and Express at runtime.
A structured observability layer for the agent-mesh orchestrator, providing Winston-powered JSON logging with automatic PII redaction, OpenTelemetry tracing and metrics (histograms, counters), and audit event logging for compliance. Exports a default `logger`, a `createChildLogger` factory for request-scoped context, and metric recording functions like `recordSessionLookupDuration` and `recordAgentDispatchDuration`.
A YAML-based agent registry loader that parses, validates (with Zod), and hot-reloads agent configurations via SIGHUP, exposing a thread-safe singleton with atomic-swap semantics and SSRF-safe URL validation.
A Zod-validated MCP dispatch layer that routes requests to registered agents via StreamableHTTP transport, managing connection pooling, circuit breakers, retries, and timeouts per agent. Exports `dispatchToAgent` as the main entry point, along with turn-history helpers and a singleton MCP client factory.
Firestore-backed session management for the agent-mesh orchestrator, providing functions (`createSession`, `getActiveSession`, `appendTurn`, `closeSession`, `resumeSession`) to create, persist, and resume multi-turn conversation state with sliding TTL, turn history, and workflow state passthrough.
A per-agent circuit breaker with Firestore-backed persistence and leader-elected cross-instance state synchronization, exposed as a singleton object with synchronous methods (`canCall`, `recordSuccess`, `recordFailure`) plus async persistence lifecycle functions (`startCircuitBreakerPersistence`, `stopCircuitBreakerPersistence`). Depends on Firestore at runtime for distributed state coordination across Cloud Run instances.