Apollo Agent
AI-powered coding agent with semantic code understanding and structured reasoning
Ask AI about Apollo Agent
Powered by Claude Β· Grounded in docs
I know everything about Apollo Agent. Ask me about installation, configuration, usage, or troubleshooting.
0/500
Reviews
Documentation
Apollo Agent
ββββββ βββββββ βββββββ βββ βββ βββββββ
ββββββββββββββββββββββββββββ βββ βββββββββ
βββββββββββββββββββ ββββββ βββ βββ βββ
βββββββββββββββ βββ ββββββ βββ βββ βββ
βββ ββββββ ββββββββββββββββββββββββββββββββββ
βββ ββββββ βββββββ ββββββββββββββββ βββββββ
AI-powered coding agent with semantic code understanding and structured reasoning
Apollo Agent integrates cutting-edge MCP (Model Context Protocol) servers with OpenRouter LLMs to provide intelligent, context-aware assistance for software development tasks. It combines semantic code analysis (Serena), structured problem-solving (Sequential Thinking), and powerful language models to understand and manipulate codebases at a deep level.
π― Features
- π Semantic Code Analysis - Understands code structure, symbols, and relationships via Serena MCP
- π§ Structured Reasoning - Plans and executes multi-step tasks systematically
- π Knowledge Base - Maintains context and learnings across sessions
- π§ Terminal Integration - Execute commands with smart sudo handling
- π Symbol Indexing - Fast code navigation and search
- π¨ Rich CLI Interface - Beautiful, informative terminal output
π Quick Start
Prerequisites
Required:
- Node.js β₯18.0.0 (install)
- uv - Python package manager (install)
- Linux or macOS (primary development platform)
Optional:
- OpenRouter API key (get one)
Installation
# Clone the repository
git clone https://github.com/AlexandrosLiaskos/apollo-agent.git
cd apollo-agent
# Install dependencies
npm install
# Configure environment
cp .env.example .env
nano .env # Add your OPENROUTER_API_KEY
# Start Apollo
npm start
First Run
On first startup, Apollo will:
- Initialize Serena MCP server (via
uvx) - Initialize Sequential Thinking MCP server
- Connect to OpenRouter
- Create a terminal session
- Load available tools (30+ from MCP servers)
ββββββ βββββββ βββββββ βββ βββ βββββββ
ββββββββββββββββββββββββββββ βββ βββββββββ
βββββββββββββββββββ ββββββ βββ βββ βββ
βββββββββββββββ βββ ββββββ βββ βββ βββ
βββ ββββββ ββββββββββββββββββββββββββββββββββ
βββ ββββββ βββββββ ββββββββββββββββ βββββββ
AI Agent with MCP Integration
β OpenRouter initialized (model: anthropic/claude-sonnet-4)
β Connected to all MCP servers
β Loaded 30 tools from MCP servers
? π Task (or "exit" to quit):
π Usage
Interactive Mode
Apollo provides an interactive CLI where you can:
Give tasks:
? π Task: Refactor the UserService class to use async/await
Use commands:
status - Show agent status
tasks - View current task list
knowledge - List knowledge entries
symbols - Show symbol index stats
search <name> - Search for symbols
help - Show all commands
exit - Quit Apollo
Example Tasks
Code Analysis:
? Task: Find all uses of the calculateTotal function
? Task: Show me the structure of the UserController class
? Task: List all API endpoints in this project
Code Modification:
? Task: Add error handling to the login method
? Task: Convert all var declarations to const/let
? Task: Add TypeScript types to user.js
System Operations:
? Task: Install and configure the axios package
? Task: Update all dependencies to latest versions
? Task: Set up ESLint with standard config
π οΈ Configuration
Environment Variables
Edit .env:
# OpenRouter Configuration (REQUIRED)
OPENROUTER_API_KEY=your_api_key_here
# Model Selection (optional)
OPENROUTER_MODEL=anthropic/claude-sonnet-4
# Sudo Configuration (see below)
SUDO_MODE=auto # auto | nopasswd | interactive | password
Sudo Commands
Apollo can execute sudo commands. Configure via SUDO_MODE:
Option 1: Auto (Default)
SUDO_MODE=auto
Tries passwordless sudo first, falls back to interactive if needed.
Option 2: Passwordless Sudo (Recommended)
# Configure system for passwordless package management
sudo visudo
# Add (replace 'user' with your username):
user ALL=(ALL) NOPASSWD: /usr/bin/pacman
user ALL=(ALL) NOPASSWD: /usr/bin/apt-get
user ALL=(ALL) NOPASSWD: /usr/bin/dnf
# Then in .env:
SUDO_MODE=nopasswd
Option 3: Interactive
SUDO_MODE=interactive
Apollo pauses and prompts for password when needed.
Option 4: Password in Env (β οΈ Less Secure)
SUDO_MODE=password
SUDO_PASSWORD=your_password
Only for personal development with disk encryption.
π Architecture
Core Components
Agent Core (src/agent/apollo-agent.js)
- Main agent orchestration
- Task planning and execution
- Tool coordination
MCP Integration (src/mcp/serena-client.js)
- Connects to Serena (semantic code analysis)
- Connects to Sequential Thinking (structured reasoning)
- Tool registry and execution
LLM Provider (src/providers/openrouter.js)
- OpenRouter API integration
- Streaming support
- Multiple model support
Terminal Tool (src/tools/terminal-tool.js)
- Command execution
- Sudo handling
- Session management
Knowledge Base (src/agent/knowledge-base.js)
- Persistent memory storage
- Context accumulation
- Cross-session learning
Symbol Index (src/agent/symbol-index.js)
- Fast code symbol search
- File indexing
- Symbol relationships
MCP Servers
Serena MCP (oraios/serena)
- Semantic code operations
- Symbol navigation
- Intelligent code editing
- Memory management
Sequential Thinking MCP (@modelcontextprotocol/server-sequential-thinking)
- Step-by-step reasoning
- Plan validation
- Structured problem solving
π§ Development
Project Structure
apollo-agent/
βββ src/
β βββ index.js # Entry point
β βββ agent/
β β βββ apollo-agent.js # Main agent
β β βββ task-manager.js # Task tracking
β β βββ knowledge-base.js # Memory system
β β βββ symbol-index.js # Code indexing
β βββ mcp/
β β βββ serena-client.js # MCP client manager
β βββ providers/
β β βββ openrouter.js # LLM provider
β βββ session/
β β βββ session-manager.js # Session persistence
β βββ tools/
β β βββ api-tools.js # Tool registry
β β βββ terminal-tool.js # Command execution
β βββ ui/
β βββ rich-output.js # CLI interface
βββ package.json
βββ .env.example
βββ README.md
Running in Development
# Watch mode (auto-restart on changes)
npm run dev
# Standard mode
npm start
Adding Custom Tools
- Implement tool in
src/tools/ - Register in
ToolRegistry(src/tools/api-tools.js) - Add to agent tool list
Extending LLM Providers
- Create provider class in
src/providers/ - Implement
chat()andchatStream()methods - Update agent initialization
π Troubleshooting
"Serena MCP failed to connect"
Cause: uv not installed or not in PATH
Fix:
# Install uv
curl -LsSf https://astral.sh/uv/install.sh | sh
# Verify
uv --version
"OpenRouter API error"
Cause: Invalid or missing API key
Fix:
# Get API key from https://openrouter.ai/keys
# Add to .env:
echo "OPENROUTER_API_KEY=sk-or-..." >> .env
"Command not found: apollo"
Cause: Not installed globally
Fix:
# Option 1: Use npm start
npm start
# Option 2: Install globally
npm install -g .
apollo
"sudo: a password is required"
Cause: Passwordless sudo not configured
Fix:
# Configure in .env:
SUDO_MODE=interactive
# Or setup passwordless sudo (see Configuration section)
π System Requirements
| Component | Minimum | Recommended |
|---|---|---|
| OS | Linux, macOS | Arch Linux, Ubuntu 22.04+ |
| Node.js | 18.0.0 | 20.0.0+ |
| RAM | 2GB | 4GB+ |
| Storage | 500MB | 1GB+ |
| Network | Required | High-speed |
π€ Contributing
Contributions welcome! Please:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit changes (
git commit -m 'Add amazing feature') - Push to branch (
git push origin feature/amazing-feature) - Open a Pull Request
π License
MIT License - see LICENSE file for details
π Acknowledgments
- Serena MCP - Semantic code operations
- Model Context Protocol - MCP specification
- OpenRouter - LLM API aggregation
- Anthropic Claude - Default language model
π Support
- Issues: GitHub Issues
- Discussions: GitHub Discussions
Built with β€οΈ by Alexandros Liaskos
