|
Download README.md from Punit1/Enterprise-AI-Copilot: direct link, hf CLI and curl.
- Browser
- Download file 6.38 kB
-
https://huggingface.co/spaces/Punit1/Enterprise-AI-Copilot/resolve/main/README.md
- Command line
-
hf download hf://spaces/Punit1/Enterprise-AI-Copilot/README.md
-
curl -L -o README.md https://huggingface.co/spaces/Punit1/Enterprise-AI-Copilot/resolve/main/README.md
6.38 kB
| title: Enterprise AI Copilot | |
| emoji: π | |
| colorFrom: blue | |
| colorTo: purple | |
| sdk: docker | |
| app_port: 7860 | |
| pinned: false | |
| # π Enterprise AI Copilot β A Multi-Agent Platform for Intelligent Enterprise Automation | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
| An enterprise-grade, multi-agent AI automation platform built with **LangGraph**, **FastAPI**, **React 18**, **Qdrant Vector Database**, and **PostgreSQL**. Features hybrid RAG search, natural language SQL generation, automated analytics, real-time web search, multi-tenant RBAC security, and a full ChatGPT-style streaming UI. | |
| --- | |
| ## π Key Architecture & Capabilities | |
| ### π€ 1. LangGraph Multi-Agent Suite | |
| Powered by a **Supervisor Planner Node** that dynamically routes incoming queries to specialized agents: | |
| - π **Retrieval Specialist (Hybrid RAG)**: Performs dense vector search in Qdrant with CrossEncoder reranking (`ms-marco-MiniLM-L-6-v2`). | |
| - ποΈ **SQL Intelligence Agent**: Generates safe SQL queries validated by an AST parser that blocks destructive DML/DDL commands. | |
| - π **Analytics Specialist**: Generates structured metrics and dynamic chart visualizations (Recharts). | |
| - π» **Code Specialist**: Writes, explains, and debugs code snippets with markdown formatting. | |
| - π **Web Search Specialist**: Fetches real-time online data via DuckDuckGo integration. | |
| - π¬ **Direct Response Synthesizer**: Handles conversational queries and synthesizes grounded answers with page-level citations. | |
| --- | |
| ### π¬ 2. ChatGPT-Style Frontend Interface | |
| - **Persistent Conversation Memory**: Sessions and multi-turn chat history stored in PostgreSQL/SQLite. | |
| - **Left Sidebar Navigation**: Grouped conversation threads (*Today*, *Yesterday*, *Previous*) with instant session switching and deletion. | |
| - **Live Response Streaming**: Server-Sent Events (SSE) token streaming with word-by-word typing animation. | |
| - **1-Click Document Chat**: Ask questions about any uploaded document directly from the Documents dashboard. | |
| --- | |
| ### π 3. Enterprise Security & Multi-Tenant RBAC | |
| - **Tenant Isolation**: Every database record and vector payload is strictly tagged and filtered by `tenant_id`. | |
| - **Role-Based Access Control**: | |
| - π `admin`: Full platform control, user invitations, system audit logs, all document categories. | |
| - π `hr`: Access restricted to HR handbooks and policy documents. | |
| - π° `finance`: Access restricted to financial statements and sales metrics. | |
| - π€ `employee`: General knowledge base search with upload restriction safeguards. | |
| --- | |
| ### π 4. Observability & Monitoring | |
| - **Structured Audit Traces**: Every agent execution is logged in PostgreSQL with tokens used, routing decision, and latency in milliseconds. | |
| - **Metrics Dashboard**: Integrated **Prometheus** metrics exporter and **Grafana** dashboard monitoring container health and request volume. | |
| --- | |
| ## π Multi-Agent Flow Diagram | |
| ```mermaid | |
| graph TD | |
| A[User Query] --> B[Supervisor Planner Node] | |
| B -->|routing == retrieval| C[RAG Retrieval Agent + Qdrant + Reranker] | |
| B -->|routing == sql| D[SQL Agent + AST Safety Validator] | |
| B -->|routing == analytics| E[Analytics Agent + Chart Generator] | |
| B -->|routing == code| F[Code Specialist Agent] | |
| B -->|routing == web| G[Web Search Agent + DuckDuckGo] | |
| B -->|routing == direct| H[Direct Conversational Handler] | |
| C --> I[Response Synthesizer Node] | |
| D --> I | |
| E --> I | |
| F --> I | |
| G --> I | |
| H --> I | |
| I --> J[Streaming SSE Output + Citation Metadata] | |
| ``` | |
| --- | |
| ## βοΈ Microservice Architecture | |
| The platform runs 10 microservices orchestrated via Docker Compose: | |
| | Container | Service | Tech Stack | Port | | |
| | :--- | :--- | :--- | :--- | | |
| | `copilot_frontend` | Frontend UI | React 18, TypeScript, TailwindCSS, Vite | `:3000` | | |
| | `copilot_backend` | Core API & Agents | FastAPI, LangGraph, SQLAlchemy, Uvicorn | `:8000` | | |
| | `copilot_postgres` | Primary Database | PostgreSQL 16 | `:5432` | | |
| | `copilot_qdrant` | Vector Database | Qdrant v1.12 | `:6333` | | |
| | `copilot_redis` | Cache & Broker | Redis 7 | `:6379` | | |
| | `copilot_celery` | Task Worker | Celery | Background | | |
| | `copilot_nginx` | Reverse Proxy | Nginx Alpine | `:8080` | | |
| | `copilot_prometheus`| Metrics Collector| Prometheus | `:9090` | | |
| | `copilot_grafana` | Monitoring Dashboard| Grafana | `:3001` | | |
| --- | |
| ## β‘ Quick Start (Local Docker Setup) | |
| ### 1. Clone & Setup Environment | |
| ```bash | |
| git clone https://github.com/purityadav2/Enterprise-AI-Copilot.git | |
| cd Enterprise-AI-Copilot | |
| # Copy sample environment configuration | |
| cp .env.example .env | |
| ``` | |
| ### 2. Launch All Microservices | |
| ```bash | |
| docker compose -f docker/docker-compose.yml up -d | |
| ``` | |
| ### 3. Open the App in Your Browser | |
| - **Frontend App**: [http://localhost:3000](http://localhost:3000) | |
| - **FastAPI Swagger Docs**: [http://localhost:8000/docs](http://localhost:8000/docs) | |
| - **Grafana Monitoring**: [http://localhost:3001](http://localhost:3001) | |
| ### 4. Default Seed Credentials | |
| - **Email**: `admin@company.com` | |
| - **Password**: `Admin@123!` | |
| --- | |
| ## π§ͺ Running Automated Tests | |
| Run the full pytest suite inside the backend container (24/24 unit & end-to-end tests passing): | |
| ```bash | |
| docker compose -f docker/docker-compose.yml exec backend sh -c "cd /tests && pytest -v" | |
| ``` | |
| --- | |
| ## π Free Deployment on Hugging Face Spaces | |
| This project includes a single-container [`Dockerfile`](Dockerfile) pre-configured for free deployment on **Hugging Face Spaces**: | |
| 1. Create a Space on [huggingface.co/new-space](https://huggingface.co/new-space) using **Docker SDK (Blank)**. | |
| 2. Add `GROQ_API_KEY` and `SECRET_KEY` in **Space Settings β Secrets**. | |
| 3. Push to Hugging Face: | |
| ```bash | |
| git remote add hf https://huggingface.co/spaces/YOUR_USERNAME/Enterprise-AI-Copilot | |
| git push hf main --force | |
| ``` | |
| --- | |
| ## π License | |
| Distributed under the MIT License. See `LICENSE` for more information. | |