How mgomez1023/destinycopilot works
Guardian Copilot turns a player’s question into read-only Destiny 2 guidance. The user connects a Bungie account, after which the backend retrieves profile data, normalizes it into GuardianContext, and exposes bounded account tools to the recommendation service; the chat response then returns through the API to the React client. Separate knowledge providers support Manifest-backed facts, detailed guides, and live information. The README documents these major capabilities; some provider and tool wiring is not shown in the sampled source, so those links are omitted where their caller is uncertain.
Main entry points: ai.py Recommendation loop · client.py Bungie API client · manifest.py Manifest resolver · api.ts API client
Components 27
Web client
- Companion UI
frontend/src/App.tsx - API client
frontend/src/api.ts - Chat streaming
frontend/src/chatStream.ts
API and recommendations
- Chat endpoint
backend/app/routes/chat.py - Service registry
backend/app/dependencies.py - Recommendation loop
backend/app/ai.py - Stream formatting
backend/app/chat_stream.py - Guardian tools
backend/app/guardian_tools.py - Session planning
backend/app/session_planning.py - Session preferences
backend/app/session_preferences.py - Response quality
backend/app/response_quality.py - Build analysis
backend/app/build_analysis.py - Title progress
backend/app/title_progress.py
Account and Bungie data
- OAuth endpoints
backend/app/routes/auth.py - OAuth sessions
backend/app/bungie/oauth.py - Guardian endpoints
backend/app/routes/guardian.py - Guardian refresh
backend/app/guardian_refresh.py - Context normalization
backend/app/bungie/guardian.py - Bungie API client
backend/app/bungie/client.py
Destiny knowledge
- Manifest resolver
backend/app/bungie/manifest.py - Manifest knowledge
backend/app/destiny_knowledge.py - Guide knowledge
backend/app/guide_knowledge.py - Live Destiny data
backend/app/live_destiny.py - Live knowledge
backend/app/live_knowledge.py
Other components
- Player
- Bungie Platform
- OpenAI API
Connections 30
- Player → Companion UI: asks for guidance
- Companion UI → API client: requests API
frontend/src/App.tsx - API client → Chat streaming: streams chat
frontend/src/api.ts - API client → Chat endpoint: calls API
- Chat endpoint → Service registry: gets services
backend/app/routes/chat.py - Service registry → Recommendation loop: provides
backend/app/dependencies.py - Chat endpoint → Stream formatting: uses stream
backend/app/routes/chat.py - Recommendation loop → Guardian tools: dispatches tools
backend/app/ai.py - Recommendation loop → OpenAI API: requests completions
- Recommendation loop → Session planning: uses planning
backend/app/ai.py - Recommendation loop → Session preferences: uses preferences
backend/app/ai.py - Recommendation loop → Response quality: checks responses
backend/app/ai.py - Recommendation loop → Build analysis: uses analysis
backend/app/ai.py - Recommendation loop → Title progress: uses progress
backend/app/ai.py - Player → OAuth endpoints: connects account
- OAuth endpoints → OAuth sessions: exchanges tokens
backend/app/routes/auth.py - OAuth endpoints → Bungie Platform: redirects OAuth
backend/app/routes/auth.py - Guardian endpoints → Guardian refresh: refreshes context
backend/app/routes/guardian.py - Guardian refresh → Context normalization: loads and normalizes
backend/app/guardian_refresh.py - Context normalization → Bungie API client: retrieves profile
backend/app/bungie/guardian.py - Context normalization → Manifest resolver: resolves definitions
backend/app/bungie/guardian.py - Bungie API client → Bungie Platform: reads account data
- Manifest resolver → Bungie API client: fetches manifest
backend/app/bungie/manifest.py - Recommendation loop → Manifest knowledge: queries knowledge
backend/app/ai.py - Manifest knowledge → Manifest resolver: resolves facts
backend/app/destiny_knowledge.py - Recommendation loop → Guide knowledge: uses guides
- Recommendation loop → Live knowledge: uses live provider
backend/app/ai.py - Live knowledge → Live Destiny data: delegates provider
backend/app/live_knowledge.py - Live Destiny data → Bungie API client: reads live data
backend/app/live_destiny.py - Live Destiny data → Manifest resolver: resolves definitions
backend/app/live_destiny.py