How harishbabu2007/kapexai works
KapexAI is a business-consulting chatbot whose main workflow takes a user from business-profile setup through questionnaire and conversation to research, inline analysis, or a dashboard report. The frontend manages chat sessions and renders streamed results; the FastAPI backend authenticates users, accepts chat jobs, and streams worker output. The worker plans each turn, dispatches registered subagents, and composes results. The README documents the broader analysis capabilities; some agent implementations were not sampled, so those branches are shown without inferred internal call details.
Main entry points: main.py Chat API and WebSocket · orchestrator.py Turn orchestrator · useChatSession.ts Session state · client.py Queue and stream store
Components 23
User experience
- App routes
frontend/src/App.tsx - Business profile
frontend/src/pages/BusinessProfilePage.tsx - Chat workspace
frontend/src/pages/ChatPage.tsx - Session state
frontend/src/hooks/useChatSession.ts - API client
frontend/src/lib/api.ts - Message and dashboard views
frontend/src/components/messages/index.tsx
API and streaming
- Chat API and WebSocket
backend/main.py - Google authentication
backend/routers/auth.py - Request authentication
backend/middleware/auth.py
Worker orchestration
- Job consumer
worker/main.py - Job processing
worker/agent.py - Turn orchestrator
worker/orchestrator/orchestrator.py - Mode planner
worker/orchestrator/planner.py - Response composer
worker/orchestrator/composer.py - Dashboard builder
worker/orchestrator/dashboard_builder.py
Consulting capabilities
- Subagent registry
worker/agents/registry.py - Consulting subagents
worker/agents - LLM provider
worker/llm.py
Persistence and services
- Conversation database
services/database/db_service/client.py - Queue and stream store
services/redis-service/redis_service/client.py
Other components
- Business user
- Business idea
- LLM and search providers
Connections 30
- Business user → App routes: opens
- App routes → Business profile: routes to
frontend/src/App.tsx - App routes → Chat workspace: routes to
frontend/src/App.tsx - Business user → Business idea: describes
- Chat workspace → Session state: uses
frontend/src/pages/ChatPage.tsx - Session state → API client: requests
frontend/src/hooks/useChatSession.ts - API client → Chat API and WebSocket: calls
- Chat API and WebSocket → Google authentication: routes authentication
backend/main.py - Chat API and WebSocket → Conversation database: reads and writes
backend/main.py - Chat API and WebSocket → Queue and stream store: queues jobs
backend/main.py - Queue and stream store → Job consumer: delivers jobs
- Job consumer → Job processing: processes job
worker/main.py - Job processing → Turn orchestrator: handles turn
worker/agent.py - Turn orchestrator → Mode planner: plans turn
worker/orchestrator/orchestrator.py - Turn orchestrator → Subagent registry: dispatches subagents
worker/orchestrator/orchestrator.py - Turn orchestrator → Response composer: commits response
worker/orchestrator/orchestrator.py - Turn orchestrator → Dashboard builder: builds dashboard
worker/orchestrator/orchestrator.py - Mode planner → Subagent registry: selects capabilities
worker/orchestrator/planner.py - Subagent registry → Consulting subagents: registers
- Consulting subagents → LLM provider: uses model
worker/agents/web_search_agent.py - LLM provider → LLM and search providers: calls provider
worker/llm.py - Consulting subagents → LLM and search providers: searches web
- Response composer → Conversation database: persists messages
- Response composer → Queue and stream store: publishes frames
- Chat API and WebSocket → Queue and stream store: reads stream frames
backend/main.py - Chat API and WebSocket → Session state: streams results
- Session state → Message and dashboard views: renders results
- Message and dashboard views → Business user: shows analysis
- Google authentication → Conversation database: loads user
backend/routers/auth.py - Request authentication → Conversation database: validates user
backend/middleware/auth.py