Skip to content

d-cryptic/paladinai

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ›‘οΈ Paladin AI

AI-Powered Monitoring & Incident Response Platform

Paladin AI is an intelligent monitoring and incident response platform that integrates with existing monitoring infrastructure (Prometheus, Grafana, Loki, Alertmanager) to provide automated incident analysis, intelligent querying, and proactive system insights.

🌟 Key Features

  • πŸ€– AI-Powered Analysis: Advanced workflow orchestration using LangGraph
  • πŸ“Š Monitoring Integration: Native support for Prometheus, Loki, Grafana, and Alertmanager
  • πŸ’¬ Multi-Interface Access: Web UI, CLI, and API interfaces
  • 🧠 Intelligent Memory: Long-term context and learning capabilities
  • πŸ“„ Document Processing: RAG-based document ingestion and retrieval
  • πŸ”„ Session Persistence: Robust checkpoint and recovery system
  • ⚑ Real-time Processing: Live monitoring and instant incident response

πŸ—οΈ Architecture Overview

graph TB
    subgraph "User Interfaces"
        WEB[Web Frontend<br/>Next.js]
        CLI[CLI Client<br/>Python]
        API[REST API<br/>FastAPI]
    end
    
    subgraph "Core Platform"
        SERVER[Paladin Server<br/>LangGraph + FastAPI]
        MEMORY[Memory System<br/>Mem0AI + Neo4j]
        RAG[RAG Engine<br/>Qdrant + OpenAI]
    end
    
    subgraph "Data Layer"
        MONGO[(MongoDB<br/>Checkpoints)]
        VECTOR[(Qdrant<br/>Embeddings)]
        GRAPH[(Neo4j<br/>Memory Graph)]
    end
    
    subgraph "Monitoring Stack"
        PROM[Prometheus]
        LOKI[Loki]
        GRAFANA[Grafana]
        ALERT[Alertmanager]
    end
    
    subgraph "External Services"
        DISCORD[Discord Bot<br/>MCP Integration]
        WEBHOOK[Webhook Server<br/>External Alerts]
    end
    
    WEB --> SERVER
    CLI --> SERVER
    API --> SERVER
    
    SERVER --> MEMORY
    SERVER --> RAG
    SERVER --> MONGO
    
    MEMORY --> GRAPH
    RAG --> VECTOR
    
    SERVER <--> PROM
    SERVER <--> LOKI
    SERVER <--> GRAFANA
    SERVER <--> ALERT
    
    DISCORD --> SERVER
    WEBHOOK --> SERVER
Loading

πŸš€ Quick Start

Prerequisites

  • Python 3.13+ with UV package manager
  • Node.js 18+ with npm/yarn
  • Docker & Docker Compose (for infrastructure)
  • MongoDB (for checkpoints)
  • OpenAI API Key (for AI features)

1. Clone and Setup

# Clone the repository
git clone https://github.com/your-org/paladin-ai.git
cd paladin-ai

# Install all dependencies
make install-dev

2. Environment Configuration

# Copy environment template
cp .env.example .env

# Configure required variables
export OPENAI_API_KEY="your-openai-api-key"
export MONGODB_URL="mongodb://localhost:27017"

3. Start Core Services

# Start the infrastructure stack
make infra-up

# Start the main server
make run-server

# In another terminal, start the frontend
make run-frontend

4. Access the Platform

πŸ“š Documentation

Documentation Description
Installation Guide Complete setup and configuration
Architecture System design and components
API Reference REST API documentation
CLI Guide Command-line interface usage
Frontend Guide Web interface documentation
Monitoring Integration Prometheus, Loki, Grafana setup
Memory System AI memory and learning capabilities
RAG System Document processing and retrieval
Workflows LangGraph workflow system
Discord Integration Discord bot and MCP setup
Deployment Production deployment guide
Troubleshooting Common issues and solutions

πŸ› οΈ Development

Project Structure

paladin-ai/
β”œβ”€β”€ πŸ“ server/          # Python FastAPI backend
β”œβ”€β”€ πŸ“ frontend/        # Next.js React frontend  
β”œβ”€β”€ πŸ“ cli/             # Python CLI client
β”œβ”€β”€ πŸ“ webhook/         # Webhook server
β”œβ”€β”€ πŸ“ mcp/             # Discord MCP integration
β”œβ”€β”€ πŸ“ infra/           # Infrastructure configs
β”œβ”€β”€ πŸ“ tests/           # Integration tests
└── πŸ“ docs/            # Documentation

Development Commands

# Development setup
make install-dev        # Install all dependencies
make dev               # Start full development environment

# Individual services
make run-server        # Start FastAPI server
make run-frontend      # Start Next.js frontend
make run-cli           # Interactive CLI session

# Discord integration
make mcp-server        # Start Discord MCP server
make mcp-worker        # Start message worker

# Testing and quality
make test              # Run all tests
make format            # Format code
make lint              # Run linting
make type-check        # Type checking

# Infrastructure
make infra-up          # Start infrastructure stack
make infra-down        # Stop infrastructure stack
make infra-logs        # View infrastructure logs

πŸ”§ Core Components

Server (Python FastAPI)

  • LangGraph Workflows: Complex AI reasoning chains
  • Tool Integration: Monitoring system connectors
  • Memory System: Long-term context and learning
  • RAG Engine: Document processing and retrieval
  • Session Management: MongoDB checkpointing

Frontend (Next.js)

  • Real-time Chat: WebSocket-based communication
  • Session Management: Persistent conversation history
  • Document Upload: Drag-and-drop file processing
  • Dark/Light Themes: Modern responsive design
  • Command Interface: CLI-style commands in web UI

CLI (Python)

  • Interactive Chat: Rich terminal interface
  • Command History: Persistent session management
  • File Upload: Document processing from CLI
  • Monitoring Queries: Direct monitoring system access

Infrastructure

  • Mock Environment: Complete testing stack
  • Monitoring Stack: Prometheus, Grafana, Loki, Alertmanager
  • Database Systems: MongoDB, PostgreSQL, Neo4j
  • Caching Layer: Valkey (Redis-compatible)

🎯 Use Cases

1. Incident Investigation

# Web UI or CLI
"Investigate high CPU usage in production cluster"

# AI analyzes metrics, logs, and provides insights
# Suggests remediation actions
# Creates incident timeline

2. Proactive Monitoring

# Set up intelligent alerts
"Monitor memory usage patterns and predict capacity issues"

# AI learns normal patterns
# Detects anomalies early
# Provides recommendations

3. Knowledge Management

# Upload runbooks and documentation
"Search for kubernetes troubleshooting steps"

# RAG system finds relevant docs
# Contextual answers from knowledge base
# Learning from previous incidents

4. Discord Integration

# Discord channel monitoring
@paladin "Check status of payment service"

# Bot responds with real-time metrics
# Provides analysis and recommendations
# Escalates critical issues

πŸ” Security

  • API Key Management: Secure credential handling
  • CORS Configuration: Controlled cross-origin requests
  • Request Timeouts: Configurable timeout middleware
  • Error Handling: Comprehensive error boundaries
  • Session Security: Encrypted session management

🀝 Contributing

  1. Fork the repository
  2. Create feature branch: git checkout -b feature/amazing-feature
  3. Install dev dependencies: make install-dev
  4. Make changes and test: make test
  5. Format code: make format
  6. Commit changes: git commit -m 'Add amazing feature'
  7. Push to branch: git push origin feature/amazing-feature
  8. Open Pull Request

Development Guidelines

  • Code Quality: Use type hints and follow PEP 8
  • Testing: Write tests for new features
  • Documentation: Update docs for new functionality
  • Commits: Use conventional commit messages

πŸ“„ License

This project is licensed under Apache 2.0 with Commons Clause License Condition v1.0 - see the LICENSE file for details.

πŸ†˜ Support

πŸ™ Acknowledgments

  • LangChain & LangGraph: Workflow orchestration
  • OpenAI: AI capabilities
  • Mem0AI: Memory management
  • FastAPI: High-performance API framework
  • Next.js: Modern React framework
  • Prometheus Ecosystem: Monitoring infrastructure

Built with ❀️ for DevOps and SRE teams

Website β€’ Documentation β€’ Community

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published