Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

IntelDocs AI

AI-powered Enterprise Knowledge & RAG Platform

FastAPI PostgreSQL LangChain License


Overview

IntelDocs AI is a highly scalable, AI-powered enterprise knowledge platform. It enables companies to securely organize documents, repositories, and codebases by team. Through advanced Retrieval-Augmented Generation (RAG), employees can chat with their team's specific knowledge base, while administrators monitor teams, documents, metadata, and analytics from a centralized dashboard.

Key Features

  • Multi-Tenant Architecture: Robust workspaces supporting top-level company management and isolated sub-level teams with their own secure documents and chat histories.
  • Context-Aware Chat: Interact with your data using plain language. Receive highly accurate answers grounded entirely in your uploaded documents, complete with source citations.
  • Advanced RAG Pipeline:
    • Omni-Format Support: Process PDF, DOCX, TXT, CSV, XLSX, PPTX, MD, and HTML files seamlessly.
    • Intelligent Chunking: Configurable semantic chunking with fallback to recursive character splitting for optimal retrieval context.
    • Contextual Enrichment: Leverage Groq LLMs to prepend contextual notes to chunks prior to embedding, significantly boosting retrieval quality.
  • High-Performance Vector Search: Lightning-fast cosine similarity vector search utilizing PostgreSQL + pgvector.
  • Session-Based Security: Strict, hierarchical visibility rules ensuring team access explicitly requires active company session validation.

Architecture & Tech Stack

Built on a modern, asynchronous Python backend, IntelDocs AI is tailored for high concurrency and heavy AI inference workloads.

Layer Technologies
Backend Framework FastAPI (Asynchronous HTTP requests & routing)
Database Layer PostgreSQL, asyncpg, SQLAlchemy ORM, pgvector
AI / LLM Stack LangChain, LangGraph, HuggingFace (all-MiniLM-L6-v2), Groq API
Document Processing pypdf, unstructured, tiktoken
Frontend Vanilla HTML, CSS, JavaScript (Lightweight Dashboards)
Security bcrypt

Quick Start

1. Prerequisites

  • Python 3.9+
  • PostgreSQL database with the pgvector extension enabled.

2. Installation

Clone the repository and set up your virtual environment:

git clone <repository-url>
cd IntelDocs-AI
python -m venv .venv

# On Linux/macOS
source .venv/bin/activate  
# On Windows
.venv\Scripts\activate

# Install dependencies
pip install -r requirements.txt

3. Database Configuration

Ensure PostgreSQL is running and execute the following SQL command in your database to enable vector storage:

CREATE EXTENSION IF NOT EXISTS vector;

4. Environment Variables

Create a .env file in the root directory and configure the following variables (you can use .env.example if available):

GROQ_API_KEY=your_groq_api_key
DATABASE_URL=postgresql+asyncpg://user:password@localhost:5432/dbname
PORT=8000
DEBUG=True
SESSION_TOKEN_EXPIRE_HOURS=24

(RAG configurations like chunk sizes and threshold semantics can be tuned in config/settings.py)

5. Run the Server

Database tables are automatically created on startup via SQLAlchemy's lifecycle events.

uvicorn main:app --host 0.0.0.0 --port 8000

Usage Examples

Uploading a Document (Team Scope)

curl -X POST "http://localhost:8000/knowledge/team/knowledge/upload" \
  -H "Authorization: Bearer <company_token>:<team_token>" \
  -F "file=@/path/to/document.pdf"

Asking a Question

curl -X POST "http://localhost:8000/chat/team/ask" \
  -H "Authorization: Bearer <company_token>:<team_token>" \
  -H "Content-Type: application/json" \
  -d '{"question": "What is our current refund policy?", "session_id": null}'

Project Structure

IntelDocs-AI/
├── config/              # Application & RAG tuning settings
├── database/            # SQLAlchemy models, async setup, and schema logic
├── frontend/            # Vanilla HTML/JS/CSS client dashboards
├── services/
│   ├── pipeline/        # High-level orchestration (chat execution, ingestion)
│   ├── prompts/         # LangChain prompt templates
│   ├── rag/             # Core RAG: loading, chunking, embedding, retrieval
│   └── routes/          # FastAPI REST endpoints
├── utils/               # Exceptions, logging, auth middleware
├── main.py              # Application entry point & lifespan management
└── requirements.txt     # Python dependencies

Performance Highlights

  • Smart Chunking Recovery: Identifies logical breakpoints seamlessly. If a chunk is oversized, only that specific chunk falls back to recursive splitting, keeping semantic boundaries intact.
  • Strictly Asynchronous: From database transactions (asyncpg) to blocking embedding calls (asyncio.to_thread), the API guarantees non-blocking execution.
  • Zero Cold-Start Latency: The sentence-transformers embedding model is pre-loaded during the FastAPI lifespan hook to ensure immediate availability for the first request.

License

This project is licensed under the MIT License - Copyright (c) 2026 Muhammad Aniq Ramzan

About

IntelDocs-AI is an AI-powered enterprise knowledge platform where companies securely organize documents, repos, and codebases by team. Employees can chat with their team's knowledge using RAG, while admins monitor teams, documents, metadata, and analytics from a centralized dashboard.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages