-
Notifications
You must be signed in to change notification settings - Fork 0
Document Ingestion
Learn how to populate Adastrea Director's knowledge base with your project documentation.
Document ingestion is the process of loading your project documentation into the vector database so Adastrea Director can provide context-aware answers about your project.
# Basic ingestion
python ingest.py --docs-dir /path/to/your/docs
# For Adastrea game developers
python ingest_game_repo.pyBy default, these file types are ingested:
-
.md- Markdown -
.txt- Plain text -
.rst- reStructuredText
-
.py- Python -
.cpp,.h,.hpp- C++ -
.cs- C# -
.js,.ts- JavaScript/TypeScript
Specify custom types with --file-types:
python ingest.py --docs-dir /path/to/docs --file-types .md .txt .pdf .docx# Ingest from a directory
python ingest.py --docs-dir /path/to/docs
# Ingest recursively (default)
python ingest.py --docs-dir /path/to/docs --recursive
# Non-recursive ingestion
python ingest.py --docs-dir /path/to/docs --no-recursive# Update database (only process new/changed files)
python ingest.py --docs-dir /path/to/docs --update# Custom chunk size
python ingest.py --docs-dir /path/to/docs --chunk-size 1500
# Custom chunk overlap
python ingest.py --docs-dir /path/to/docs --chunk-overlap 200
# Specify embedding model
python ingest.py --docs-dir /path/to/docs --embedding-model sentence-transformers/all-mpnet-base-v2For Mittenzx/Adastrea game developers:
# Set GitHub token
export GITHUB_TOKEN="ghp_your_token_here"
# Ingest game repository
python ingest_game_repo.py- Go to Repository Settings β Secrets
- Add
GAME_REPO_TOKENsecret with your GitHub token - Go to Actions
- Select "Populate Database with Adastrea Game Repository"
- Click "Run workflow"
The game repository ingestion includes:
- Game design documents
- C++ source files
- Blueprint documentation
- Architecture documents
- System documentation
- Configuration files
Structure your docs for optimal ingestion:
docs/
βββ README.md
βββ architecture/
β βββ overview.md
β βββ components.md
βββ guides/
β βββ getting-started.md
β βββ api-reference.md
βββ design/
βββ gameplay.md
βββ systems.md
Re-ingest regularly to keep knowledge base updated:
# Weekly or after major documentation changes
python ingest.py --docs-dir /path/to/docs --updateWell-commented code provides valuable context:
/**
* PlayerCharacter handles all player-related functionality.
*
* Key responsibilities:
* - Movement and physics
* - Input handling
* - Ability management
*/
class APlayerCharacter : public ACharacter {
// Implementation
};Descriptive file names help with retrieval:
β Good:
player-movement-system.mdinventory-design-doc.mdcombat-mechanics.md
β Avoid:
doc1.mdtemp.mdnotes.txt
Include metadata in your documents:
---
title: Player Movement System
author: John Doe
date: 2025-01-15
tags: gameplay, movement, physics
---
# Player Movement System
Content here...Via GUI:
- Open
python gui_director.py - Go to "Ingest List" tab
- View all ingested documents with statistics
Via CLI:
# Query the database
python main.py --query "What documents are in the database?"After ingestion, you'll see:
Ingesting documents...
β Processed 45 documents
β Created 1,234 chunks
β Generated embeddings
β Stored in vector database
Ingestion complete!
Time elapsed: 2m 34s
Solution:
- Check directory path is correct
- Verify file types match (default: .md, .txt, .py, .cpp, .h)
- Use
--file-typesto specify custom types
Solution:
- Reduce chunk size:
--chunk-size 500 - Process fewer files at once
- Close other applications
- Increase system RAM
Solution:
- Ensure internet connection (first-time download)
- Check available disk space (models need ~500MB)
- Try alternative model:
--embedding-model all-MiniLM-L6-v2
Solution:
# Create new token at https://github.com/settings/tokens
# Required scopes: repo (for private repos)
export GITHUB_TOKEN="ghp_new_token_here"For unsupported file types, create custom loaders:
from langchain.document_loaders import BaseLoader
class CustomLoader(BaseLoader):
def load(self, file_path):
# Your custom loading logic
return documents
# Use in ingestion
loader = CustomLoader()
documents = loader.load("custom_file.ext")Understand chunking parameters:
- chunk_size: Maximum tokens per chunk (default: 1000)
- chunk_overlap: Overlapping tokens between chunks (default: 200)
Guidelines:
- Larger chunks: More context, fewer chunks
- Smaller chunks: More precise retrieval, more chunks
- Overlap: Preserves context across boundaries
Choose based on your needs:
Default - all-MiniLM-L6-v2:
- Dimensions: 384
- Speed: Fast
- Quality: Good
- Size: ~90MB
High Quality - all-mpnet-base-v2:
- Dimensions: 768
- Speed: Moderate
- Quality: Excellent
- Size: ~420MB
OpenAI Embeddings:
- Dimensions: 1536
- Speed: API-dependent
- Quality: Excellent
- Cost: Pay-per-use
Ingested documents power the Q&A system:
python ingest.py --docs-dir /path/to/docs
python main.py
> What is the main gameplay loop?Planning uses documentation for context:
python ingest.py --docs-dir /path/to/docs
python planner.py "Add new inventory system"
# Planner references your ingested docsAgents query documentation for insights:
python ingest.py --docs-dir /path/to/docs
python agent_orchestrator_cli.py start --all
# Agents use docs for context-aware monitoringAdastrea Director | GitHub | Issues | Discussions
Building tomorrow's game development tools, today.