How nikhil0o1/datanitiv-concierge works
CAP-ABILITY is a full-stack capacity-planning application: users explore portfolio plans, analyze staffing and shrinkage, and create or execute plan actions; the agent adds chat, voice, and streamed scenario workflows. A separate Concierge subsystem monitors operational events and produces incidents, recommendations, and nudges. The graph reflects documented routes and sampled imports/calls; unsampled details are represented at directory level, and optional integrations are marked dashed.
Main entry points: main.py FastAPI application · incident_pipeline.py Incident pipeline · PlanningApp.jsx Planning workspace · agent.py Agent and voice APIs
Components 32
Planning interface
- React application
frontend/src/App.jsx - Planning workspace
frontend/src/components/PlanningApp.jsx - Plan tabs
frontend/src/components/plan/PlanTabs.jsx - Scenario workflow
frontend/src/hooks/useScenarioEngine.js - Plan actions
frontend/src/hooks/scenarioActions.js - Agent chat
frontend/src/hooks/useAgentChat.js - Scenario streaming
frontend/src/hooks/useAgentWebSocket.js - API client
frontend/src/api/client.js
Planning API
- FastAPI application
backend/app/main.py - Planning routes
backend/app/routers - Plan data and DTOs
backend/app/services/plan_repository.py - Plan actions
backend/app/routers/plan_actions.py - Portfolio analysis
backend/app/services/portfolio_analysis.py
Agent and voice
- Agent and voice APIs
backend/app/routers/agent.py - Agent context
backend/app/services/agent_context.py - Voice services
backend/app/services
Concierge intelligence
- Concierge API
backend/app/concierge/router.py - Concierge endpoints
backend/app/concierge/routers - Event worker
backend/app/concierge/services/worker.py - Incident pipeline
backend/app/concierge/services/incident_pipeline.py - Case similarity
backend/app/concierge/services/cases.py - Incident handling
backend/app/concierge/services/incidents.py - Recommendations
backend/app/concierge/services/recommendations.py - Nudge policy
backend/app/concierge/services/nudges.py - Explanation generation
backend/app/concierge/services/llm.py
Persistence and runtime
- Concierge records
backend/app/concierge/models.py - Planning records
backend/app/models/cape.py - Database sessions
backend/app/database.py
Other components
- Planner
- PostgreSQL
- Anthropic Claude
- ElevenLabs
Connections 34
- Planner → React application: uses
- React application → Planning workspace: renders
frontend/src/App.jsx - Planning workspace → Plan tabs: displays
- Planning workspace → Scenario workflow: runs scenarios
- Scenario workflow → Plan actions: dispatches actions
frontend/src/hooks/useScenarioEngine.js - Planning workspace → Agent chat: offers chat
- Agent chat → API client: streams chat
frontend/src/hooks/useAgentChat.js - Planning workspace → Scenario streaming: supports streaming
- Scenario streaming → Plan actions: dispatches actions
frontend/src/hooks/useAgentWebSocket.js - API client → FastAPI application: HTTP requests
frontend/src/api/client.js - FastAPI application → Planning routes: registers routes
backend/app/main.py - FastAPI application → Agent and voice APIs: registers routes
backend/app/main.py - FastAPI application → Concierge API: registers optionally
backend/app/main.py - FastAPI application → Event worker: starts worker
backend/app/main.py - Planning routes → Plan data and DTOs: reads plan data
backend/app/routers/plan_actions.py - Plan actions → Plan data and DTOs: uses repository
backend/app/routers/plan_actions.py - FastAPI application → Portfolio analysis: analyzes portfolio
backend/app/main.py - Agent and voice APIs → Agent context: builds context
- Agent and voice APIs → Voice services: handles voice
- Agent and voice APIs → Anthropic Claude: requests language model
- Voice services → ElevenLabs: optional voice services
- Concierge API → Concierge endpoints: includes endpoints
backend/app/concierge/router.py - Event worker → Incident pipeline: processes incidents
backend/app/concierge/services/worker.py - Incident pipeline → Case similarity: finds similar cases
backend/app/concierge/services/incident_pipeline.py - Incident pipeline → Recommendations: generates recommendations
backend/app/concierge/services/incident_pipeline.py - Incident pipeline → Incident handling: marks available
backend/app/concierge/services/incident_pipeline.py - Incident pipeline → Nudge policy: creates nudge
backend/app/concierge/services/incident_pipeline.py - Incident pipeline → Explanation generation: generates explanation
backend/app/concierge/services/incident_pipeline.py - Explanation generation → Anthropic Claude: optional model call
- Event worker → Concierge records: processes event records
backend/app/concierge/services/worker.py - Plan data and DTOs → Planning records: reads planning records
backend/app/services/plan_repository.py - Database sessions → PostgreSQL: connects
backend/app/database.py - Planning records → Database sessions: uses ORM base
backend/app/models/cape.py - Concierge records → Database sessions: uses ORM base
backend/app/concierge/models.py