| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
A teaching assistant AI designed specifically for the xv6 operating system labs. The agent helps students learn OS concepts by providing contextual help, analyzing build errors, suggesting fixes, and guiding through implementation—all while maintaining a pedagogical approach that promotes learning over giving direct answers.
| Feature | Description |
|---|---|
| 🔍 Intelligent Help | Context-aware assistance that understands xv6 code structure |
| 🛠️ Build Interception | Wraps make to capture and analyze build errors |
| 🔧 Smart Fix Suggestions | AI-powered error analysis with pedagogical explanations |
| 📸 Snapshot & Undo | Session-based file tracking with rollback capability |
| 👁️ File Watching | Real-time monitoring of code changes |
| 🎯 Task Tracking | Progress monitoring for lab assignments |
| 🔐 Consent-Based Fixes | Always asks before modifying your code |
Clone into your xv6 directory:
cd /path/to/xv6-public
git clone https://github.com/your-username/xv6-agent.git .xv6_agentRun the installer:
bash .xv6_agent/install_agent.shActivate and use:
source .venv/bin/activate
./agent help "How do I add a new system call?"# Create virtual environment
python3 -m venv .venv
source .venv/bin/activate
# Install dependencies
pip install tree-sitter tree-sitter-c networkx chromadb \
sentence-transformers watchdog click rich pyyaml \
python-dotenv groq openai anthropic
# Configure API key
echo "GROQ_API_KEY=your_key_here" > .xv6_agent/.env
# Initialize
./agent init| Command | Description |
|---|---|
| ./agent init | Initialize the agent workspace |
| ./agent help "query" | Get pedagogical help for your question |
| ./agent make [args] | Run make with error interception |
| ./agent status | Show current task/FSM state |
| Command | Description |
|---|---|
| ./agent fix | Analyze recent errors and propose fixes |
| ./agent fix --apply | Apply fix immediately (turbo mode) |
| ./agent undo | Undo the last applied change |
| ./agent snapshots | List available file snapshots |
| ./agent restore <id> | Restore a specific snapshot |
| Command | Description |
|---|---|
| ./agent watch | Start file watcher daemon |
| ./agent debug | Show debug information |
# Ask about xv6 concepts
./agent help "What is the difference between fork() and exec()?"
# Understanding code
./agent help "Explain how the scheduler works"
# Implementation guidance
./agent help "How do I implement a priority scheduler?"# Build with error interception
./agent make qemu
# If build fails, analyze and fix
./agent fix
# Or apply fixes automatically
./agent fix --apply# View available snapshots
./agent snapshots
# Undo last change
./agent undo
# Restore specific version
./agent restore abc123xv6-agent/
├── agent # CLI wrapper script
├── install_agent.sh # Quick installer
├── pyproject.toml # Python package config
└── src/xv6_agent/
├── cli.py # Command-line interface
├── cpg_builder.py # Code Property Graph builder
├── vector_store.py # Semantic search with ChromaDB
├── context_assembler.py # Context preparation for LLM
├── llm_client.py # LLM integration (Groq/OpenAI)
├── diff_engine.py # Diff generation and application
├── shadow_workspace.py # Safe testing environment
├── session_context.py # Session & snapshot management
├── file_sentinel.py # File change monitoring
├── error_recovery.py # Error analysis & recovery
├── pedagogical_validator.py # Educational response validation
├── task_tracker.py # Lab progress tracking
└── security.py # Safety guards
Create .xv6_agent/.env or set in your shell:
# Required - Choose one LLM provider
GROQ_API_KEY=gsk_...
# OPENAI_API_KEY=sk-...
# ANTHROPIC_API_KEY=sk-ant-...
# Optional
XV6_AGENT_DEBUG=false
XV6_AGENT_LOG_LEVEL=INFOEdit .xv6_agent/config.yaml for advanced settings:
llm:
provider: groq
model: llama-3.1-70b-versatile
pedagogical:
hint_level: medium # minimal, medium, detailed
explain_reasoning: true
safety:
require_consent: true
max_files_per_fix: 3The agent includes multiple safety guards:
Contributions are welcome! Please feel free to submit issues and pull requests.
This project is licensed under the MIT License - see the LICENSE file for details.
| Back | FazBrowse Home | New Git URL |