Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 63 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
</span>

# 🤖 Devr.AI - AI-Powered Developer Relations Assistant

[![License:MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
![GitHub Org's stars](https://img.shields.io/github/stars/AOSSIE-Org/Devr.AI?style=social)
[![Discord](https://img.shields.io/discord/1022871757289422898?color=7289da&logo=discord&logoColor=white)](https://discord.gg/BjaG8DJx2G)
Expand All @@ -18,24 +18,28 @@ Devr.AI is revolutionizing open-source community management with advanced AI-pow
## 🚀 Features

### 🧠 LangGraph Agent-Based Intelligence
- **ReAct Reasoning Pattern** - Think → Act → Observe workflow for intelligent decision making

- **ReAct Reasoning Pattern** - Think → Act → Observe workflow for intelligent decision-making
- **Conversational Memory** - Persistent context across Discord sessions with automatic summarization
- **Multi-Tool Orchestration** - Dynamic tool selection including web search, FAQ, and GitHub operations
- **Self-Correcting Capabilities** - Iterative problem-solving with intelligent context awareness

### 💬 Discord Community Integration

- **Intelligent Message Processing** - Real-time classification and context-aware responses
- **GitHub Account Verification** - OAuth-based account linking for enhanced personalization
- **Command Interface** - Comprehensive bot commands for verification and management
- **Thread Management** - Organized conversation flows with persistent memory

### 🔗 GitHub Integration

- **OAuth Authentication** - Secure GitHub account linking and verification
- **User Profiling** - Automatic repository and contribution analysis
- **Repository Operations** - Read access and basic GitHub toolkit functionality
- **Cross-Platform Identity** - Unified profiles across Discord and GitHub

### 🏗️ Advanced Architecture

- **Asynchronous Processing** - RabbitMQ message queue with priority-based processing
- **Multi-Database System** - Supabase (PostgreSQL) + Weaviate (Vector DB) integration
- **Real-Time AI Responses** - Google Gemini LLM with Tavily web search capabilities
Expand All @@ -44,28 +48,33 @@ Devr.AI is revolutionizing open-source community management with advanced AI-pow
## 💻 Technologies Used

### Backend Services

- **LangGraph** - Multi-agent orchestration and workflow management
- **FastAPI** - High-performance async web framework
- **RabbitMQ** - Message queuing and asynchronous processing
- **Google Gemini** - Advanced LLM for reasoning and response generation

### AI & LLM Services

- **Gemini 2.5 Flash** - Primary reasoning and conversation model
- **Tavily Search API** - Real-time web information retrieval
- **Text Embeddings** - Semantic search and knowledge retrieval
- **ReAct Pattern** - Reasoning and Acting workflow implementation

### Data Storage

- **Supabase** - PostgreSQL database with authentication
- **Weaviate** - Vector database for semantic search
- **Agent Memory** - Persistent conversation context and state management

### Platform Integrations

- **Discord.py (py-cord)** - Modern Discord bot framework
- **PyGithub** - GitHub API integration and repository access
- **OAuth Integration** - Secure account linking and verification

### Frontend Dashboard

- **React + Vite** - Modern web interface with TypeScript
- **Tailwind CSS** - Responsive design system
- **Framer Motion** - Interactive UI animations
Expand All @@ -81,6 +90,7 @@ Devr.AI is revolutionizing open-source community management with advanced AI-pow
Devr.AI utilizes a complex multi-service architecture with AI agents, message queues, and multiple databases. Setting up can be challenging, but we've streamlined the process.

**Quick Start:**

1. Clone the repository
2. Follow our comprehensive [Installation Guide](./docs/INSTALL_GUIDE.md)
3. Configure your environment variables (Discord bot, GitHub OAuth, API keys)
Expand All @@ -106,7 +116,7 @@ For detailed setup instructions, troubleshooting, and deployment guides, please
## 📱 Screenshots

<div align="center">

| Discord Integration | GitHub Verification | Agent Dashboard |
| :----------------------------------------------------------------------------------------------------------------------- | :---------------------------------------------------------------------------------------------------------------------- | :---------------------------------------------------------------------------------------------------------------------- |
| <img src="[TO BE FILLED - DISCORD SCREENSHOT]" width="260" height="auto" /> | <img src="[TO BE FILLED - GITHUB SCREENSHOT]" width="250" height="auto" /> | <img src="[TO BE FILLED - DASHBOARD SCREENSHOT]" width="250" height="auto" /> |
Expand All @@ -124,6 +134,7 @@ For detailed setup instructions, troubleshooting, and deployment guides, please
Thank you for considering contributing to Devr.AI! Contributions are highly appreciated and welcomed. To ensure a smooth collaboration, please refer to our [Contribution Guidelines](./CONTRIBUTING.md).

### Development Setup

1. Fork the repository
2. Create a feature branch
3. Follow our coding standards and testing guidelines
Expand Down Expand Up @@ -160,4 +171,52 @@ Thanks a lot for spending your time helping Devr.AI grow. Keep rocking 🥂

<div align="center">
Built with ❤️ for the open-source developer community
</div>
</div>

## 🐳 Docker Compose Setup

Devr.AI includes a Docker setup for the GitHub MCP server to streamline local development.

### Running the GitHub MCP Server

1. **Configure Environment**: Ensure your `.env` file in the root directory has the required variables:

```bash
GITHUB_TOKEN=your_token
GITHUB_ORG=your_org
SUPABASE_URL=your_supabase_url
SUPABASE_KEY=your_supabase_key
REDIS_URL=redis://redis:6379/0 # For Docker
```

2. **Start the Service**:
Run the following command from the **root** directory:

```bash
docker-compose up --build
```

The service will be available at `http://localhost:5001`.

3. **Verify Health**:
```bash
curl http://localhost:5001/health
# Expected: {"status": "healthy", "service": "github-mcp"}
```

### Running Backend Infrastructure

The database logic and message queues (Weaviate, RabbitMQ, FalkorDB) are managed by a separate Docker Compose file in the `backend` directory.

To start infrastructure services:

```bash
cd backend
docker-compose up -d
```

### Troubleshooting

- **Port Conflicts**: The MCP server maps internal port `8001` to external port `5001`. If `5001` is in use, modify `docker-compose.yml`.
- **Environment Variables**: If the container fails to start, check `docker-compose logs github-mcp` to see if tokens are missing.
- **Hot Reloading**: The `backend` directory is mounted to `/app` in the container, so code changes will reload the server automatically.
4 changes: 4 additions & 0 deletions backend/app/core/config/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ class Settings(BaseSettings):
# RabbitMQ configuration
rabbitmq_url: Optional[str] = None

# Redis configuration
# Default is for Docker network (redis:6379). Override with localhost for local dev.
redis_url: str = "redis://redis:6379/0"

# Backend URL
backend_url: str = ""

Expand Down
48 changes: 48 additions & 0 deletions backend/app/core/redis.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import redis.asyncio as redis
import asyncio
from app.core.config import settings
import logging
from typing import Optional

logger = logging.getLogger(__name__)

class RedisClient:
_instance: Optional[redis.Redis] = None
_lock = asyncio.Lock()

@classmethod
async def get_client(cls) -> redis.Redis:
if cls._instance is None:
async with cls._lock:
if cls._instance is None:
# Mask credentials for logging
log_url = settings.redis_url
if "@" in log_url:
try:
schema, rest = log_url.split("://", 1)
userinfo, sep, host = rest.rpartition("@")
if sep:
log_url = f"{schema}://****:****@{host}"
else:
log_url = f"{schema}://****:****@..."
except ValueError:
log_url = "redis://****:****@..."

logger.info(f"Initializing Redis client connecting to {log_url}")
cls._instance = redis.from_url(
settings.redis_url,
encoding="utf-8",
decode_responses=True
)
return cls._instance

@classmethod
async def close(cls):
if cls._instance:
await cls._instance.close()
cls._instance = None
logger.info("Redis client closed.")

async def get_redis_client() -> redis.Redis:
"""Dependency to get the Redis client instance."""
return await RedisClient.get_client()
Loading