Skip to main content

Persona-Aware AI Analytics & RAG Copilot — multi-domain KPI intelligence, GraphRAG-lite, ML forecasting.

Project description

IntelAI

License: AGPL v3

Persona-Aware AI Analytics & RAG Copilot — 9-persona, role-scoped copilot with GraphRAG-lite retrieval, ML forecasting, bilingual (EN/FR) UI, and board-ready exports.

CI FastAPI Python

Live demo: https://intelai.ysiddo-ai-projects.app · password-less role login (DEMO_MODE). First request may take ~60 s to wake the on-demand backend.


Features

Area Detail
9-persona RAG copilot CEO, CFO, CTO, COO, CHRO, ESG, Risk, Analyst, Assistant — role-scoped data, WS streaming, citations
GraphRAG-lite Multi-hop entity graph for cross-domain queries (USE_GRAPH_RAG=true)
Hybrid retrieval Dense + BM25 + RRF + BGE reranker; degrades gracefully
Answer-block structuring Backend parses LLM markdown into typed blocks (heading, kpi, list, quote, code)
90+ curated KPIs Finance, HR, IT, Ops, Logistics, ESG, Growth — 36-month history, 7 benchmarking scenarios
ML forecasting Monte Carlo with confidence bands
Data export/ingest PDF / Excel / CSV / JSON export; CSV & document ingestion
Auth + RBAC JWT, role-based pages, per-persona data scoping, audit log
Admin governance User management (create/edit/disable), role viewer, scenario switcher, vector store reindex
Multi-provider LLM Groq (default) / Anthropic via LiteLLM
Bilingual Full EN / FR UI and copilot responses

Architecture

React + Vite (Recharts · TanStack Query · i18n)   → Vercel / Netlify
        │  HTTP / WebSocket  /api/v1/*
FastAPI  (src/api/server.py)
  auth · chat (9 personas) · KPIs · insights · forecasting · admin
        │
   PostgreSQL (Neon)          LLM  (Groq / Anthropic via LiteLLM)
   KPIs · auth · sessions ·   GraphRAG-lite · hybrid retrieval
   vectors (pgvector opt-in)  BGE reranker · BM25

Quickstart

Prerequisites: Python 3.11, Node 18+, Postgres URL, GROQ_API_KEY.

git clone https://github.com/Yacine-ai-tech/IntelAI.git
cd IntelAI
cp .env.example .env   # fill POSTGRES_URL, GROQ_API_KEY, SECRET_KEY

# Backend (port 8000 — tables & seed created automatically)
pip install -r requirements.txt
python main.py

# Frontend (port 5173, proxies /api → :8000)
cd frontend && npm install && npm run dev

Default login: admin / admin123 — change after first login.

Docker:

docker compose -f docker-compose.dev.yml up --build   # app only (uses .env DB)
docker compose up --build                              # app + bundled Postgres

Configuration (.env)

Variable Required Description
POSTGRES_URL Neon / Railway / local Postgres
GROQ_API_KEY Default LLM provider
SECRET_KEY JWT signing key
ANTHROPIC_API_KEY Claude reasoning tier
USE_GRAPH_RAG true = GraphRAG-lite multi-hop
USE_HYBRID_RETRIEVAL true = dense+BM25+RRF+reranker
VECTOR_STORE memory · chroma · pgvector · qdrant
LLM_MODEL Groq model id (default llama-3.1-8b-instant)

Key API Endpoints

/health  ·  /api/docs
POST /api/v1/auth/login   GET /api/v1/auth/me
POST /api/v1/chat         WS  /api/v1/ws/chat      GET /api/v1/personas
GET  /api/v1/kpis[/periods|/metrics|/categories]
GET  /api/v1/insights/{health,risk,summary,anomalies}
POST /api/v1/forecast      GET /api/v1/glossary
POST /api/v1/data/export   POST /api/v1/ingest/{metrics,csv,document}
GET  /api/v1/admin/{users,roles,audit,scenario}

Full interactive reference at /api/docs.

Tests

pytest tests/ -q                  # all in-process (no live server needed)
pytest tests/test_smoke.py -q     # 5 smoke checks (zero deps)
pytest tests/test_api.py -q       # 30+ auth/RBAC/endpoint checks
pytest tests/test_chat.py -q      # chat endpoint + answer-block assertions

DB-dependent tests run automatically when POSTGRES_URL is reachable and skip cleanly otherwise — CI is green without a database.

Benchmarking Scenarios

Seven seeded scenarios (selectable from the Admin → Scenarios tab or via POST /api/v1/admin/scenario):

Scenario Description
healthy S&P 500 baseline
declining_financial Revenue contraction & margin compression
high_churn_crisis Customer retention failure
operational_meltdown OEE collapse & quality failures
talent_crisis High attrition, open-req spike
cybersecurity_breach Security incident — SLA/SLO degrade
esg_compliance_failure Governance failures & emissions spike

Deploy

IntelAI deploys as one cloud service (railway.toml included). Connect the repo on Railway, set the env vars above, attach a Postgres add-on. Deploy the frontend separately on Vercel with VITE_API_BASE_URL pointing to the Railway service URL.

License

MIT — see LICENSE.

⚖️ License & Enterprise Use (Dual-License)

This project is open-source under the AGPL-3.0 License. It is completely free for researchers, students, and open-source hobbyists.

Commercial Use: The AGPLv3 license requires that any proprietary network service (SaaS, internal corporate tools) that uses or modifies this code must also open-source its entire backend.

If you wish to use this framework in a closed-source commercial environment, or require Enterprise features (SSO, Active Directory, Custom VPC Deployment, Strict RBAC), you must obtain a Commercial License. Please reach out to discuss commercial licensing and integration consulting.

📡 Anonymous Telemetry

This project collects anonymous, GDPR-compliant startup pings to help the author understand usage volume and prioritize development.

  • What is collected: Only the project name and a "startup" event timestamp. No PII, no API keys, no user data.
  • How to disable: We respect your privacy. To opt-out, simply set TELEMETRY_OPT_OUT=true in your .env file.

Licensing

This project is licensed under the AGPL-3.0 License.

Commercial Use: If you wish to use this software commercially without releasing your own source code, please see COMMERCIAL.md to obtain a commercial license.

Telemetry: See TELEMETRY.md for our privacy-first data practices.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

intelai-0.1.1.tar.gz (149.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

intelai-0.1.1-py3-none-any.whl (151.9 kB view details)

Uploaded Python 3

File details

Details for the file intelai-0.1.1.tar.gz.

File metadata

  • Download URL: intelai-0.1.1.tar.gz
  • Upload date:
  • Size: 149.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for intelai-0.1.1.tar.gz
Algorithm Hash digest
SHA256 e4148c75a201ab638f022b675337ea7f55ee3979f5675139d0afec30aa32d944
MD5 e8f03c99e8288431c5ec8ba9841778f5
BLAKE2b-256 6e45ed4c8f2bf3278b88c12f19539ce8675735129baf6cfb8a6a4096d21efafa

See more details on using hashes here.

File details

Details for the file intelai-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: intelai-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 151.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for intelai-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2e9b7d6a4ed25bf55eb73082a72268923937735d14a44512251fdfc6a8cf7e13
MD5 bb780b4425a1117c41051a542d0408ac
BLAKE2b-256 eda25127ec840991385e4edf7d8106ff83970d835450db819efc556b94b2720f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page