Spaces:
Sleeping
Sleeping
Commit
Β·
6818d41
1
Parent(s):
c16e1c9
update the README.md file
Browse files
README.md
CHANGED
|
@@ -35,7 +35,7 @@
|
|
| 35 |
|
| 36 |
**IntegraChat** is an enterprise-ready, multi-tenant AI platform built to demonstrate the full capabilities of the **Model Context Protocol (MCP)** in a real production-style environment.
|
| 37 |
|
| 38 |
-
It combines **autonomous tool-using agents**, **RAG retrieval**, **live web search**, and **admin governance** under strict **tenant isolation**, powered by Groq
|
| 39 |
|
| 40 |
IntegraChat is a complete **"MCP in Action"** ecosystem β ideal for enterprise demos, research, production scaffolds, and governance-focused AI deployments.
|
| 41 |
|
|
@@ -66,15 +66,16 @@ Agents can intelligently:
|
|
| 66 |
- β
Retrieve tenant-private knowledge
|
| 67 |
- β
Pull real-time data from the internet
|
| 68 |
- β
Trigger admin alerts when needed
|
| 69 |
-
- β
Respond using
|
| 70 |
|
| 71 |
### 2. π Enterprise RAG System
|
| 72 |
|
| 73 |
-
- **MiniLM embeddings** for semantic search
|
| 74 |
- **Supabase + pgvector** for vector storage
|
| 75 |
-
- **
|
| 76 |
-
- **
|
| 77 |
-
- **Intelligent chunking**
|
|
|
|
| 78 |
|
| 79 |
### 3. π Live Web Search Tool
|
| 80 |
|
|
@@ -126,8 +127,9 @@ Isolation is guaranteed via **Supabase Row-Level Security (RLS)**.
|
|
| 126 |
| **FastAPI** | High-performance API framework |
|
| 127 |
| **MCP Client + Servers** | Model Context Protocol implementation |
|
| 128 |
| **Supabase** | Auth + Storage + pgvector database |
|
| 129 |
-
| **
|
| 130 |
-
| **
|
|
|
|
| 131 |
| **DuckDuckGo Search** | Web search provider |
|
| 132 |
| **Slack / Email** | Alerting system |
|
| 133 |
|
|
@@ -215,41 +217,14 @@ IntegraChat/
|
|
| 215 |
β β β βββ logging.py
|
| 216 |
β β β βββ supabase_client.py
|
| 217 |
β β β βββ tenant_context.py
|
| 218 |
-
β β β
|
|
|
|
| 219 |
β β βββ config.py
|
| 220 |
β β
|
| 221 |
β βββ mcp_servers/
|
| 222 |
-
β β βββ
|
| 223 |
-
β β
|
| 224 |
-
β β
|
| 225 |
-
β β β βββ search.py
|
| 226 |
-
β β β βββ embeddings.py
|
| 227 |
-
β β β βββ ingestion/
|
| 228 |
-
β β β β βββ ingest_pdf.py
|
| 229 |
-
β β β β βββ ingest_docx.py
|
| 230 |
-
β β β β βββ ingest_txt.py
|
| 231 |
-
β β β β βββ ingest_url.py
|
| 232 |
-
β β β βββ db/
|
| 233 |
-
β β β β βββ documents_repo.py
|
| 234 |
-
β β β β βββ embeddings_repo.py
|
| 235 |
-
β β β βββ config.py
|
| 236 |
-
β β β
|
| 237 |
-
β β βββ web_server/
|
| 238 |
-
β β β βββ main.py
|
| 239 |
-
β β β βββ providers/
|
| 240 |
-
β β β β βββ ddg.py
|
| 241 |
-
β β β β βββ serpapi.py (optional)
|
| 242 |
-
β β β β βββ bing.py (optional)
|
| 243 |
-
β β β βββ utils.py
|
| 244 |
-
β β β
|
| 245 |
-
β β βββ admin_server/
|
| 246 |
-
β β βββ main.py
|
| 247 |
-
β β βββ redflag_rules.py
|
| 248 |
-
β β βββ alerts/
|
| 249 |
-
β β β βββ slack.py
|
| 250 |
-
β β β βββ email.py
|
| 251 |
-
β β β βββ webhook.py
|
| 252 |
-
β β βββ audit_logs.py
|
| 253 |
β β
|
| 254 |
β βββ workers/
|
| 255 |
β β βββ ingestion_worker.py
|
|
@@ -341,9 +316,10 @@ IntegraChat/
|
|
| 341 |
Before you begin, ensure you have the following installed:
|
| 342 |
|
| 343 |
- β
**Python 3.10+**
|
| 344 |
-
- β
**Node.js 18+**
|
| 345 |
-
- β
**Supabase project** (with pgvector extension)
|
| 346 |
-
- β
**
|
|
|
|
| 347 |
- β
**DuckDuckGo Search key** (optional, if configured)
|
| 348 |
- β
**Slack/Email webhook** for alerts (optional)
|
| 349 |
|
|
@@ -360,16 +336,65 @@ Before you begin, ensure you have the following installed:
|
|
| 360 |
```
|
| 361 |
|
| 362 |
3. **Configure environment variables**
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 363 |
```bash
|
| 364 |
-
|
| 365 |
-
|
| 366 |
```
|
|
|
|
|
|
|
|
|
|
| 367 |
|
| 368 |
-
|
| 369 |
```bash
|
|
|
|
| 370 |
uvicorn api.main:app --reload
|
| 371 |
```
|
| 372 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 373 |
### Frontend Setup
|
| 374 |
|
| 375 |
1. **Navigate to frontend directory**
|
|
@@ -438,7 +463,7 @@ Contributions are welcome! Please feel free to submit a Pull Request.
|
|
| 438 |
## π Acknowledgments
|
| 439 |
|
| 440 |
- Built with [Model Context Protocol (MCP)](https://modelcontextprotocol.io/)
|
| 441 |
-
- Powered by [Groq](https://groq.com/) for LLM inference
|
| 442 |
- Database powered by [Supabase](https://supabase.com/)
|
| 443 |
|
| 444 |
---
|
|
|
|
| 35 |
|
| 36 |
**IntegraChat** is an enterprise-ready, multi-tenant AI platform built to demonstrate the full capabilities of the **Model Context Protocol (MCP)** in a real production-style environment.
|
| 37 |
|
| 38 |
+
It combines **autonomous tool-using agents**, **RAG retrieval**, **live web search**, and **admin governance** under strict **tenant isolation**, powered by **Ollama** (local) or **Groq** (cloud) LLM inference.
|
| 39 |
|
| 40 |
IntegraChat is a complete **"MCP in Action"** ecosystem β ideal for enterprise demos, research, production scaffolds, and governance-focused AI deployments.
|
| 41 |
|
|
|
|
| 66 |
- β
Retrieve tenant-private knowledge
|
| 67 |
- β
Pull real-time data from the internet
|
| 68 |
- β
Trigger admin alerts when needed
|
| 69 |
+
- β
Respond using **Ollama** (local) or **Groq** (cloud) LLM
|
| 70 |
|
| 71 |
### 2. π Enterprise RAG System
|
| 72 |
|
| 73 |
+
- **MiniLM embeddings** (384-dim) for semantic search
|
| 74 |
- **Supabase + pgvector** for vector storage
|
| 75 |
+
- **Automatic database schema initialization** on server startup
|
| 76 |
+
- **Strict multi-tenant isolation** with tenant_id filtering
|
| 77 |
+
- **Intelligent text chunking** (~300 words per chunk)
|
| 78 |
+
- **Vector similarity search** using cosine distance
|
| 79 |
|
| 80 |
### 3. π Live Web Search Tool
|
| 81 |
|
|
|
|
| 127 |
| **FastAPI** | High-performance API framework |
|
| 128 |
| **MCP Client + Servers** | Model Context Protocol implementation |
|
| 129 |
| **Supabase** | Auth + Storage + pgvector database |
|
| 130 |
+
| **PostgreSQL + pgvector** | Vector database for embeddings |
|
| 131 |
+
| **MiniLM Embeddings** | Semantic search embeddings (384-dim) |
|
| 132 |
+
| **Ollama / Groq** | LLM inference engine (configurable) |
|
| 133 |
| **DuckDuckGo Search** | Web search provider |
|
| 134 |
| **Slack / Email** | Alerting system |
|
| 135 |
|
|
|
|
| 217 |
β β β βββ logging.py
|
| 218 |
β β β βββ supabase_client.py
|
| 219 |
β β β βββ tenant_context.py
|
| 220 |
+
β β β βββ security.py
|
| 221 |
+
β β β βββ text_extractor.py
|
| 222 |
β β βββ config.py
|
| 223 |
β β
|
| 224 |
β βββ mcp_servers/
|
| 225 |
+
β β βββ main.py # RAG MCP Server (FastAPI)
|
| 226 |
+
β β βββ database.py # Supabase/PostgreSQL connection
|
| 227 |
+
β β βββ embeddings.py # Sentence transformers embeddings
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 228 |
β β
|
| 229 |
β βββ workers/
|
| 230 |
β β βββ ingestion_worker.py
|
|
|
|
| 316 |
Before you begin, ensure you have the following installed:
|
| 317 |
|
| 318 |
- β
**Python 3.10+**
|
| 319 |
+
- β
**Node.js 18+** (for frontend)
|
| 320 |
+
- β
**Supabase project** (with pgvector extension enabled)
|
| 321 |
+
- β
**PostgreSQL connection string** (from Supabase)
|
| 322 |
+
- β
**Ollama** (for local LLM) or **Groq API key** (for cloud LLM)
|
| 323 |
- β
**DuckDuckGo Search key** (optional, if configured)
|
| 324 |
- β
**Slack/Email webhook** for alerts (optional)
|
| 325 |
|
|
|
|
| 336 |
```
|
| 337 |
|
| 338 |
3. **Configure environment variables**
|
| 339 |
+
|
| 340 |
+
Create a `.env` file in the project root with the following:
|
| 341 |
+
```env
|
| 342 |
+
# Database Configuration
|
| 343 |
+
POSTGRESQL_URL=postgresql://user:password@host:port/database
|
| 344 |
+
SUPABASE_URL=https://your-project.supabase.co
|
| 345 |
+
SUPABASE_SERVICE_KEY=your_service_role_key
|
| 346 |
+
|
| 347 |
+
# MCP Server URLs
|
| 348 |
+
RAG_MCP_URL=http://localhost:8001
|
| 349 |
+
WEB_MCP_URL=http://localhost:8002
|
| 350 |
+
ADMIN_MCP_URL=http://localhost:8003
|
| 351 |
+
|
| 352 |
+
# LLM Configuration
|
| 353 |
+
OLLAMA_URL=http://localhost:11434
|
| 354 |
+
OLLAMA_MODEL=llama3
|
| 355 |
+
# Or use Groq instead:
|
| 356 |
+
# GROQ_API_KEY=your_groq_api_key
|
| 357 |
+
```
|
| 358 |
+
|
| 359 |
+
4. **Start the RAG MCP Server**
|
| 360 |
```bash
|
| 361 |
+
cd backend/mcp_servers
|
| 362 |
+
python main.py
|
| 363 |
```
|
| 364 |
+
The server will automatically initialize the database schema on startup.
|
| 365 |
+
- Server runs on `http://localhost:8001`
|
| 366 |
+
- API docs available at `http://localhost:8001/docs`
|
| 367 |
|
| 368 |
+
5. **Run the main API server**
|
| 369 |
```bash
|
| 370 |
+
cd backend
|
| 371 |
uvicorn api.main:app --reload
|
| 372 |
```
|
| 373 |
|
| 374 |
+
### RAG MCP Server API
|
| 375 |
+
|
| 376 |
+
The RAG MCP Server provides two main endpoints:
|
| 377 |
+
|
| 378 |
+
**Ingest Documents:**
|
| 379 |
+
```bash
|
| 380 |
+
curl -X POST http://localhost:8001/ingest \
|
| 381 |
+
-H "Content-Type: application/json" \
|
| 382 |
+
-d '{
|
| 383 |
+
"tenant_id": "tenant123",
|
| 384 |
+
"content": "Your document text here..."
|
| 385 |
+
}'
|
| 386 |
+
```
|
| 387 |
+
|
| 388 |
+
**Semantic Search:**
|
| 389 |
+
```bash
|
| 390 |
+
curl -X POST http://localhost:8001/search \
|
| 391 |
+
-H "Content-Type: application/json" \
|
| 392 |
+
-d '{
|
| 393 |
+
"tenant_id": "tenant123",
|
| 394 |
+
"query": "What are the HR policies?"
|
| 395 |
+
}'
|
| 396 |
+
```
|
| 397 |
+
|
| 398 |
### Frontend Setup
|
| 399 |
|
| 400 |
1. **Navigate to frontend directory**
|
|
|
|
| 463 |
## π Acknowledgments
|
| 464 |
|
| 465 |
- Built with [Model Context Protocol (MCP)](https://modelcontextprotocol.io/)
|
| 466 |
+
- Powered by [Ollama](https://ollama.ai/) or [Groq](https://groq.com/) for LLM inference
|
| 467 |
- Database powered by [Supabase](https://supabase.com/)
|
| 468 |
|
| 469 |
---
|