How baddieangelasolos-bot/hybrid-ai-agent works
Hybrid AI Agent is a private, installable multi-agent assistant. A user submits a chat message; the chat API plans an agent, selects models through fallback chains, and streams a response. The app also supports thread history, voice transcription, specialist tools and connectors, health/model status, and configurable settings. Browser state and chat data use Drive-first storage with local backup. The graph follows documented capabilities and shown imports/calls; several UI-to-API and optional integration details are not shown in the excerpts, so those links are omitted.
Main entry points: route.ts Chat API · index.ts Tool assembly · AppProviders.tsx App state · auth.ts Session auth
Components 32
User experience
- Chat interface
components/ChatScreen.tsx - App state
components/AppProviders.tsx - History page
app/(app)/history/page.tsx - Agents page
app/(app)/agents/page.tsx - Settings UI
components/SettingsUI.tsx
Agent runtime
- Chat API
app/api/chat/route.ts - Agent planner
lib/orchestrator.ts - Intent routing
lib/router.ts - Agent definitions
lib/agents.ts - Model catalog
lib/models.ts - Model failover
lib/failover.ts - Voice transcription
app/api/transcribe/route.ts
Tools and connectors
- Tool assembly
lib/tools/index.ts - Connector catalog
lib/connectors/registry.ts - GitHub tools
lib/tools/github.ts - Web tools
lib/tools/web.ts - Vercel tools
lib/tools/vercel.ts - Webhook tools
lib/tools/webhook.ts
Persistence and settings
- Storage layer
lib/storage.ts - Google Drive
lib/drive.ts - Storage API
app/api/storage/route.ts - Settings API
app/api/settings/route.ts - Health status
app/api/health/models/route.ts
Access and safety
- Session auth
lib/auth.ts - Security guards
lib/security.ts
Other components
- User
- AI providers
- Drive service
- GitHub service
- Vercel service
- Web services
- Automation webhooks
Connections 36
- User → Chat interface: sends message
README.md - Chat interface → Chat API: submits chat
README.md - Chat API → Session auth: checks session
app/api/chat/route.ts - Chat API → Intent routing: routes intent
app/api/chat/route.ts - Chat API → Agent planner: plans agent
app/api/chat/route.ts - Chat API → Agent definitions: selects agent
app/api/chat/route.ts - Chat API → Model failover: builds model chain
app/api/chat/route.ts - Model failover → Agent definitions: reads chains
lib/failover.ts - Model failover → Model catalog: resolves models
lib/failover.ts - Chat API → AI providers: streams completion
README.md - App state → Chat API: sends chat
README.md - App state → Storage layer: persists threads
components/AppProviders.tsx - History page → App state: loads threads
app/(app)/history/page.tsx - Agents page → Agent definitions: shows agents
app/(app)/agents/page.tsx - Agents page → Health status: reads health
app/(app)/agents/page.tsx - Settings UI → App state: configures app
components/SettingsUI.tsx - User → Voice transcription: submits audio
README.md - Voice transcription → AI providers: transcribes audio
README.md - Agent planner → Tool assembly: assembles tools
- Tool assembly → Connector catalog: reads connector definitions
lib/tools/index.ts - Tool assembly → GitHub tools: registers tools
lib/tools/index.ts - Tool assembly → Web tools: registers tools
lib/tools/index.ts - Tool assembly → Vercel tools: registers tools
lib/tools/index.ts - Tool assembly → Webhook tools: registers tools
lib/tools/index.ts - GitHub tools → GitHub service: calls GitHub
README.md - Vercel tools → Vercel service: checks deployments
README.md - Web tools → Web services: searches and reads
README.md - Webhook tools → Automation webhooks: calls webhook
lib/tools/webhook.ts - Storage layer → Storage API: syncs documents
lib/storage.ts - Storage API → Session auth: checks session
app/api/storage/route.ts - Storage API → Google Drive: uses Drive proxy
app/api/storage/route.ts - Storage layer → Drive service: syncs remotely
lib/storage.ts - Settings API → Session auth: checks session
app/api/settings/route.ts - Settings API → Google Drive: reads Drive settings
app/api/settings/route.ts - Health status → Session auth: checks session
- Chat API → Security guards: applies protections
app/api/chat/route.ts