Architecture Overview
Splat is built as a three-stage pipeline that transforms Python errors into actionable debugging insights using LLM-powered analysis.Pipeline Stages
Stage 1: CLI Entry Point
The main entry point (module.py:13-31) orchestrates the entire pipeline:
- Accept user command with optional flags (
-rfor relational analysis) - Coordinate between error parsing and LLM processing
- Return structured results to CLI
Stage 2: Error Parsing & Context Collection
The relational parsing layer (relational.py:13-30) handles error capture and context gathering:
- Traceback: Raw error stack trace
- Error info: Structured error details
- Repopack: Contextual file contents
Stage 3: LLM Analysis
The process layer (process/process.py:10-39) transforms error data into actionable fixes using Groq’s LLM API.
Data Flow Diagram
Flag Behavior
Splat supports different levels of context gathering:No Flag (Basic Mode)
-r Flag (Relational Mode)
Component Interaction
| Component | File | Responsibility |
|---|---|---|
| Pipeline Orchestrator | module.py | Coordinates stages |
| Error Parser | relational.py | Captures runtime errors |
| Stack Parser | utils.py:47-74 | Extracts file paths from traces |
| Graph Builder | utils.py:130-189 | Creates dependency adjacency list |
| Context Collector | utils.py:81-100 | Reads file contents |
| LLM Processor | process/process.py | Generates solutions |
Key Design Patterns
1. Intentional Error Catching
Splat deliberately runs failing code to capture errors:relational.py:14-19.
2. Graph-Based Context Collection
The-r flag triggers recursive dependency resolution:
3. AST-Powered Import Detection
The system uses Python’sast module to parse imports without executing code:
utils.py:146-151.
Performance Characteristics
Basic Mode (-r not used):
- Minimal file reading
- Fast execution
- Limited context
-r flag):
- Full dependency traversal
- Higher token usage
- Comprehensive context
- Better LLM accuracy
Next Steps
Error Pipeline
Deep dive into error parsing stages
LLM Integration
Learn about prompt engineering