A self-hosted AI agent for server management and troubleshooting that combines RAG (Retrieval Augmented Generation) with secure file access.
- Secure file reading with Redis caching
- RAG-based document retrieval with vector search
- Asynchronous operations
- SSH-based file access with security controls
- Web interface for easy interaction
- Comprehensive file search and analysis
The agent uses a layered architecture that separates concerns:
-
File Access Layer
- Secure SSH connections
- Redis caching
- Path filtering and security controls
-
Knowledge Layer
- FAISS vector store
- Document processing
- Similarity search
-
Intelligence Layer
- Claude API integration
- Context building
- Response generation
-
Interface Layer
- Gradio web UI
- Async request handling
- Session management
/src
├── core/ # Core agent logic and query handling
├── tools/ # File reading and caching services
├── knowledge_base/ # Vector store and document processing
├── rag/ # Retrieval and context generation
├── server_management/ # SSH and file operations
└── ui/ # Web interface
-
System Requirements:
- Python 3.10+
- Redis server
- SSH access to target servers
-
Setup:
# Clone repository git clone [repository-url] # Create virtual environment python -m venv venv source venv/bin/activate # Install dependencies pip install -r requirements.txt # Configure environment cp .env.example .env # Edit .env with your settings
Required environment variables:
ANTHROPIC_API_KEY
: Your Claude API key- Server configurations (in .env):
SERVERS='[ { "name": "server1", "ip": "xxx.xxx.xxx.xxx", "search_paths": ["/path1", "/path2"] } ]'
-
Start Redis server:
redis-server
-
Configure SSH keys:
ssh-keygen -t ed25519 ssh-copy-id user@server
-
Start the agent:
python src/ui/app.py
-
Access web interface at http://localhost:7860
- No direct LLM access to servers
- File content cached in Redis
- SSH key-based authentication
- Configurable excluded paths
- Path filtering and validation
- Access logging and monitoring
See CONTRIBUTING.md for guidelines.
MIT