AI Personalities
Enriched Agentic AI Mode & Co-Pilot Spoken Guidance Walkthrough
We have successfully implemented and verified the Enriched Agentic AI Mode & Voice Co-Pilot functionality. This upgrade provides a highly contextual, voice-assistant friendly, and fully autonomous AI gaming companion that is aware of the user's game library, input devices, live gameplay visual feeds (VLM), and is fully capable of executing arbitrary key simulation commands.
๐ ๏ธ Summary of Accomplishments
-
Installed Game Library Context:
- Implemented
get_game_library_contextin decision_maker.py to load all cached games fromGameScannerdatabase. - Formatted scanned game metadata (names, platforms, executables, and supported NVIDIA features like DLSS/RTX/Reflex) and injected it directly into active chat panels (
reply_to_prompt) and autonomous reasoning blocks (_agentic_analyze).
- Implemented
-
Contextual VLM Vision Descriptions:
- Injected real-time screen/VLM descriptors (
vlm_descriptioncontaining details on HUD elements, quest logs, active targets, and hazards) into chat prompts, enabling the voice assistant to "see" gameplay scenes dynamically. - Enhanced Nemotron-Vision / Phi-3 Vision NIM descriptive prompts to produce structured reports detailing HUD stats, hazards, enemies, and actions precisely.
- Injected real-time screen/VLM descriptors (
-
Active Input Device-Aware Guidance:
- Transmitted active input device types (Keyboard/Mouse vs. Xbox/PlayStation Controller) directly into the agent reasoning pass.
- Instructed the AI to recommend specific, device-appropriate key/button prompts (e.g. RT/A/B on controllers vs. Q/Shift/Space on keyboard/mouse) tailored to what the user is actively playing with.
-
Robust Key Simulation Fallback:
- Hardened the action execution loop in pipeline_host.py to wrap abstract
GameActionlookups with a nested try-except pattern. - When the AI generates raw actions or custom key combinations (e.g.,
press_q,key_caps_lock), the coordinator extracts the raw keys, strips prefixes, and fires them directly viainput_manager.execute_key(raw_key, mode="click")cleanly.
- Hardened the action execution loop in pipeline_host.py to wrap abstract
-
Search Query Enrichment:
- Expanded search-routing keywords in
reply_to_promptto intercept questions abouttutorial,predict,forecast,walkthrough,strategy,tactics,mission,quest, andboss. - Lookups are automatically routed to the DuckDuckGo/Wikipedia engines for optimal, real-time strategic assistance.
- Expanded search-routing keywords in
-
Latent Bug Resolution:
- Discovered and fixed a latent
NameErrorin input_manager.py where failing to importpygameorxinputon headless/clean environments left core global guards (_PYGAME_AVAILABLEand_XINPUT_AVAILABLE) completely undefined.
- Discovered and fixed a latent
๐ Verification & Unit Tests
We created and successfully ran a dedicated unit-test suite (test_key_fallback.py) validating the standard action triggers alongside the new raw key fallback simulator.
Test Log Output:
Initializing MockPipelineHost...
[TEST] Processing actions: ['reload']
-> Found in GameAction: GameAction.RELOAD. Executing standard action.
[TEST] Processing actions: ['press_q']
-> Action 'press_q' not in GameAction. Falling back to raw key: 'q'
[TEST] Processing actions: ['key_caps_lock']
-> Action 'key_caps_lock' not in GameAction. Falling back to raw key: 'caps lock'
[TEST] Processing actions: ['space']
-> Action 'space' not in GameAction. Falling back to raw key: 'space'
ALL TEST CASES PASSED SUCCESSFULLY!
All modified Python backend files have been validated with py_compile and build with zero syntax or import errors.
๐จ System Architecture Diagram
Below is the workflow of the enriched AI Agent loop from hardware inputs up to the autonomous action executor:
mermaidgraph TD User[Player Activity] -->|Keyboard/Mouse/Controller| InputMgr[input_manager.py] InputMgr -->|Detect Device State & Active Hardware| Pipeline[pipeline_host.py] Pipeline -->|Inject Game Library Context| Brain[decision_maker.py GameBrain] Pipeline -->|Inject VLM Description| Brain Brain -->|Query NVIDIA NIM / Web Search| Strategy[Strategic Advice & Key Commands] Strategy -->|If Agentic Mode Active| Filter[Confirm Action / Prefix Strip] Filter -->|GameAction Match| ExecAbstract[execute_action] Filter -->|GameAction ValueError Fallback| ExecRaw[execute_key] ExecAbstract -->|Virtual Key Simulation| Game[Active Gameplay] ExecRaw -->|Direct Hardware Input Simulation| Game