# Technical Document Extraction of Image
## Overview
This diagram depicts a system architecture for processing strategy data from StarCraft II using Large Language Models (LLMs). The system integrates game state observation extraction, memory management, and LLM-driven strategy generation. Key components include:
1. **Left Column (Input Pipeline)**
- **LLM-PySC2**:
- Observation Extractor
- Obs-Text Converter (→ StarCraft II Game)
- Text-Action Converter (→ Action Extractor)
- **StarCraft II Game**:

2. **Center (Memory System)**
- **Memory**:
- `get_latest Strategy`
- `memory.db` storage:
- `{step1: [Tactic: ...]}`
- `{step2: [Tactic: ...]}`
- **Strategy Extractor**: Processes memory data
3. **Right Column (LLM Processing)**
- **LLM Input**:
- **Textual Observation**: Game state data
- **State Machine Prompt**: Visual node-based diagram with:
- Red node: "state"
- Blue node: "action"
- **Last Strategy States**:
- `[Tactic]:<defensive>`
- `[PriorityUnit]:<Voidray>`
- **LLM Output**:
- **Textual Reasoning**: Analysis of game state
- **New Strategy States**:
- `[Tactic]:<aggressive>`
- `[PriorityUnit]:<Carrier>`
- **Textual Analysis**: Strategic recommendations
- **Executable Actions**:
- `<Train_Carrier()>`
- `<All_Units_Attack()>`
4. **LLM Services**:
- Hexagonal node icon (Input)
- Whale icon (Output)
## Textual Data Flow
1. **Observation Extraction**:
- Raw game data → Observation Extractor → Textual representation via Obs-Text Converter
2. **Memory Integration**:
- Textual observation → Memory System → Last Strategy States
3. **LLM Processing**:
- State Machine Prompt + Last Strategy States → LLM → New Strategy States + Executable Actions
4. **Output Generation**:
- LLM → Strategy Extractor → Executable Actions (green-highlighted)
## Component Relationships
- **Bidirectional Flow**: Game observation <-> LLM-generated strategies
- **Memory Buffering**: Historical tactics stored in `memory.db`
- **Action Generation**: Executable Actions directly interface with game engine
## Color Coding
- Green arrows: Observation conversion flow
- Blue arrows: Strategy extraction/memory processing
- Black arrows: LLM input/output
## Critical Textual Elements
- `get_latest Strategy`: Primary memory query function
- `memory.db`: Persistent strategy storage
- `Executable Actions`: Direct API calls to game engine
- `State Machine Prompt`: Visual state transition model
## System Architecture