How team-skyjs/kbap-pm-agent works
K-Bap PM Agent is a web app for product managers: users chat with an agent to investigate product metrics and a codebase, then review and refine experiment or funnel proposals. The frontend routes conversations and settings, while the backend serves the API, runs agent/tool workflows, and persists conversations and usage. The README is empty, so product capabilities are inferred from the provided source index and excerpts; unsampled subsystem behavior and some frontend-to-backend wiring are not independently verified.
Main entry points: agent.py Agent orchestration · main.py HTTP API · db.py Application database · Chat.tsx Conversation chat
Components 21
Web application
- App routing
frontend/src/App.tsx - Conversation chat
frontend/src/Chat.tsx - Proposal review
frontend/src/ProposalCard.tsx - Proposal refinement
frontend/src/refine.ts - Settings screen
frontend/src/SettingsPage.tsx - API client
frontend/src/api.ts
API and conversations
- HTTP API
backend/app/main.py - Conversation workflow
backend/app/conversations.py - Proposal refinement
backend/app/refine.py
Analysis and integrations
- Agent orchestration
backend/app/agent.py - Anthropic runtime
backend/app/agent_anthropic.py - OpenAI runtime
backend/app/agent_openai.py - Codebase analysis
backend/app/code_tools.py - Repository indexing
backend/app/repo.py - Amplitude integration
backend/app/amplitude.py
Persistence and controls
- Application database
backend/app/db.py - LLM budget tracking
backend/app/budget.py - Proposal contracts
backend/app/schemas.py
Other components
- Product manager
- Amplitude MCP
- LLM providers
Connections 32
- Product manager → App routing: uses
frontend/src/App.tsx - App routing → Conversation chat: routes to
frontend/src/App.tsx - App routing → Settings screen: routes to
frontend/src/App.tsx - Conversation chat → API client: requests
frontend/src/Chat.tsx - Conversation chat → Proposal review: renders
frontend/src/Chat.tsx - Conversation chat → Proposal refinement: uses
frontend/src/Chat.tsx - Settings screen → API client: requests
frontend/src/SettingsPage.tsx - API client → HTTP API: sends API requests
- HTTP API → Conversation workflow: routes to
backend/app/main.py - HTTP API → Proposal refinement: routes to
backend/app/main.py - HTTP API → Application database: checks health
backend/app/main.py - Conversation workflow → Agent orchestration: runs agent
backend/app/conversations.py - Conversation workflow → Application database: persists conversations
backend/app/conversations.py - Proposal refinement → Agent orchestration: runs refinement
backend/app/refine.py - Proposal refinement → Application database: reads and writes
backend/app/refine.py - Agent orchestration → Anthropic runtime: dispatches
backend/app/agent.py - Agent orchestration → OpenAI runtime: dispatches
backend/app/agent.py - Agent orchestration → Codebase analysis: invokes tools
backend/app/agent.py - Agent orchestration → Repository indexing: uses repository data
backend/app/agent.py - Agent orchestration → LLM budget tracking: records usage
backend/app/agent.py - Agent orchestration → Proposal contracts: validates answers
backend/app/agent.py - Anthropic runtime → LLM providers: calls
backend/app/agent_anthropic.py - OpenAI runtime → LLM providers: calls
backend/app/agent_openai.py - Codebase analysis → Repository indexing: queries codebase
backend/app/code_tools.py - Codebase analysis → LLM budget tracking: checks budget
backend/app/code_tools.py - Repository indexing → Application database: stores repository state
backend/app/repo.py - LLM budget tracking → Application database: records usage
backend/app/budget.py - Amplitude integration → Application database: stores OAuth state
backend/app/amplitude.py - Amplitude integration → Amplitude MCP: connects and queries
backend/app/amplitude.py - Agent orchestration → Amplitude integration: uses analytics tools
backend/app/amplitude.py - HTTP API → Amplitude integration: mounts routes
backend/app/main.py - HTTP API → Application database: initializes
backend/app/main.py