-
Notifications
You must be signed in to change notification settings - Fork 0
Phase 1 Foundation
Status: β Complete and Production-Ready
Phase 1 establishes the foundation of Adastrea Director with a context-aware RAG (Retrieval-Augmented Generation) system that enables intelligent Q&A about project documentation.
The primary goals of Phase 1 were to:
- β Build a robust document ingestion pipeline
- β Implement vector database storage for efficient retrieval
- β Create a natural language query interface
- β Provide accurate answers with source citations
- β Support multiple document formats and sources
Document Ingestion Pipeline:
Documents β Loader β Splitter β Embeddings β Vector DB
Query Processing Pipeline:
User Query β Embedding β Similarity Search β Context Retrieval β LLM β Answer
- ChromaDB: Vector database for efficient similarity search
- LangChain: Document processing and chunking
- Sentence Transformers: Default embedding model (all-MiniLM-L6-v2)
- OpenAI/Gemini: LLM providers for answer generation
- Python: Core implementation language
Capabilities:
- β Multiple file format support (.md, .txt, .rst, .py, .cpp, .h)
- β Recursive directory scanning
- β GitHub repository ingestion
- β Incremental updates
- β Metadata preservation
Usage:
# Basic ingestion
python ingest.py --docs-dir /path/to/docs
# Game repository ingestion
python ingest_game_repo.py
# Update existing database
python ingest.py --docs-dir /path/to/docs --updateFeatures:
- β Persistent storage
- β Fast similarity search
- β Metadata filtering
- β Efficient indexing
Storage Location:
- Default:
./chroma_db - Configurable via settings
CLI Mode:
python main.py
> What is the main gameplay loop?GUI Mode:
python gui_director.pySingle Query:
python main.py --query "Your question here"Features:
- β Context-aware responses
- β Source citations
- β Multi-document synthesis
- β Natural language understanding
Example Output:
Q: How do I implement player movement?
A: The player movement system uses a character controller with input-driven velocity...
Sources:
- PlayerMovement.md (lines 23-45)
- InputSystem.md (lines 67-89)
Features:
- β Modern dark theme
- β Conversation history
- β Settings management
- β API key configuration
- β Knowledge base viewer
- β Export conversations
Documents are split into chunks with overlap for context preservation:
chunk_size = 1000 # tokens
chunk_overlap = 200 # tokens overlap between chunksThis ensures:
- Manageable context windows for LLMs
- Preserved context across chunk boundaries
- Efficient similarity search
Default: HuggingFace Sentence Transformers
- Model:
all-MiniLM-L6-v2 - Dimensions: 384
- Speed: Fast
- Quality: Good for general use
- Advantage: No API key required, works offline
Alternative: OpenAI Embeddings
- Model:
text-embedding-ada-002 - Dimensions: 1536
- Speed: API-dependent
- Quality: Excellent
- Advantage: Higher quality for complex queries
Supports multiple LLM providers:
Google Gemini (Recommended):
- Free tier available
- Fast response times
- Good quality
OpenAI GPT:
- Multiple models (GPT-3.5, GPT-4)
- High quality
- Pay-per-use
Ollama (Local):
- Completely local
- No API costs
- Privacy-focused
- 27 GUI Tests: Complete UI testing
- Integration Tests: End-to-end workflows
- Unit Tests: Component testing
- 88% Code Coverage: High test coverage
- β 100% test pass rate
- β Zero known critical bugs
- β Stable API
- β Production-ready
- First Query: 5-10 seconds (model loading)
- Subsequent Queries: 1-3 seconds
- Factors: LLM API latency, document count, query complexity
- Speed: ~100 documents/minute
- Factors: Document size, file types, embedding model
- Storage: ~1MB per 1000 chunks
- Search: Sub-second for most queries
- Scalability: Tested with 10,000+ chunks
Help new team members quickly understand the project:
> What is the overall architecture?
> Where is the player movement implemented?
> What are the coding standards?
Get quick answers while coding:
> How do I implement feature X?
> What dependencies does module Y have?
> Where is error handling implemented?
Find information without manual searching:
> Show me all information about the combat system
> What documentation exists for networking?
> Where are build instructions documented?
Understand context during code reviews:
> What design patterns are used in this module?
> How should new features be structured?
> What are the testing requirements?
-
HuggingFace Default Embeddings
- Eliminated API key requirement
- Faster onboarding for new users
- Sufficient quality for most use cases
-
ChromaDB Selection
- Easy to use
- Fast performance
- Persistent storage out-of-the-box
-
Flexible LLM Support
- Users can choose based on needs
- Easy to add new providers
- Local option (Ollama) important for privacy
-
Comprehensive Testing
- Caught bugs early
- Enabled confident refactoring
- Improved code quality
-
Document Chunking
- Challenge: Finding optimal chunk size
- Solution: Experimented with 500, 1000, 1500 tokens; settled on 1000
-
Context Window Management
- Challenge: Balancing context size vs. relevance
- Solution: Implemented top-k retrieval with similarity thresholds
-
Platform Compatibility
- Challenge: Different dependencies on macOS, Windows, Linux
- Solution: Created smart installer with platform detection
-
API Key Management
- Challenge: Secure storage without repository commits
- Solution: Machine-specific encryption in user directory
Phase 1 provided the foundation for subsequent phases:
Enables Phase 2 (Planning):
- RAG system retrieves relevant code examples for planning
- Document understanding informs task decomposition
Enables Phase 3 (Agents):
- Agents use RAG to understand codebase context
- Same LLM infrastructure powers agent reasoning
Enables Phase 4 (Creative Partner):
- Content generation benefits from project context
- Creative suggestions grounded in project documentation
- β
ingest.py- Document ingestion script - β
ingest_game_repo.py- Game repository ingestion - β
main.py- CLI application - β
gui_director.py- GUI application - β
llm_config.py- LLM provider management - β
config_manager.py- Configuration management
- β Installation guides
- β Usage tutorials
- β API reference
- β Troubleshooting guides
- β 27 GUI tests
- β Integration tests
- β Unit tests
- β 88% code coverage
While Phase 1 is complete, potential future improvements include:
-
Advanced Retrieval:
- Hybrid search (vector + keyword)
- Re-ranking of retrieved chunks
- Query expansion
-
More File Formats:
- PDF support
- Word documents (.docx)
- Code notebooks (.ipynb)
-
Better Context Management:
- Sliding window for long conversations
- Conversation memory across sessions
- Context summarization
-
Performance Optimizations:
- Caching for frequent queries
- Batch processing for ingestion
- GPU acceleration
- Installation - Install Adastrea Director
- Quick Start - Your first query
- Usage Guide - Comprehensive guide
- Document Ingestion - Populate knowledge base
Next Phase: Phase 2: The Planner β
Adastrea Director | GitHub | Issues | Discussions
Building tomorrow's game development tools, today.