An autonomous AI agent that can improve your codebase. Gets work to do via GitHub issues. This project provides a flexible foundation for creating AI agents that can understand issues, generate solutions, and manage pull requests.
- 🤖 Autonomous Operation: Monitors GitHub issues and automatically handles tasks based on labels
- 🧠 Local LLM Support: Primary support for Ollama models, with optional OpenAI integration
- 📚 RAG Pipeline: Efficient context retrieval using ChromaDB for better task understanding
- 🔄 Feedback Loop: Built-in feedback collection and learning mechanisms
- 🛠️ Modular Architecture: Easy to extend and customize for specific use cases
- 🔒 Type Safety: Full TypeScript support with Zod schema validation
-
Clone the repository:
git clone https://github.com/yourusername/ai-agent-scaffold.git cd ai-agent-scaffold -
Install dependencies:
bun install
-
Copy the environment variables template:
cp .env.example .env
-
Configure your environment variables in
.env
The agent can be configured through environment variables:
-
GitHub Configuration
GITHUB_TOKEN: Personal Access Token with repo scopeGITHUB_OWNER: Repository owner (username or organization)GITHUB_REPO: Repository name
-
LLM Configuration
LLM_PROVIDER: LLM provider ('ollama' or 'openai')LLM_MODEL: Model name (e.g., 'mistral' for Ollama)OLLAMA_BASE_URL: Ollama API URLOPENAI_API_KEY: OpenAI API Key (optional)
-
Storage Configuration
REDIS_URL: Redis connection URL (optional)CHROMA_DB_PATH: ChromaDB storage path (optional)
-
Agent Configuration
MAX_ITERATIONS: Maximum iterations for the planning loopPOLL_INTERVAL: GitHub polling interval in millisecondsAPPROVED_LABELS: Labels that trigger agent actionPORT: HTTP server portAUTO_START: Whether to start automatically
-
Start the agent:
bun run dev
-
The agent will start monitoring GitHub issues with the configured labels.
-
Access the API endpoints:
- Health check:
GET /health - Agent control:
- Start:
POST /agent/start - Stop:
POST /agent/stop - Status:
GET /agent/status
- Start:
- Task management:
- Get task:
GET /tasks?id=<task_id> - Add feedback:
POST /tasks/:id/feedback
- Get task:
- Health check:
The project follows a modular architecture with the following components:
- Agent Core: Central orchestrator that manages the autonomous workflow
- GitHub Watcher: Monitors repository issues and creates tasks
- Task Manager: Handles task lifecycle and persistence
- LLM Client: Manages interactions with language models
- RAG Pipeline: Provides relevant context for task understanding
- Feedback System: Collects and processes feedback for improvement
- Learning Module: Adapts agent behavior based on feedback
-
Run in development mode:
bun run dev
-
Run tests:
bun test -
Build for production:
bun run build
- Fork the repository
- Create your feature branch:
git checkout -b feature/amazing-feature - Commit your changes:
git commit -m 'Add amazing feature' - Push to the branch:
git push origin feature/amazing-feature - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.