Back to Articles

DocPortal AI: Enterprise AI
Document Portal

Introduction

DocPortal AI is an enterprise-grade Retrieval-Augmented Generation (RAG) platform designed for intelligent document management, semantic search, AI-powered querying, and automated insight generation. The system combines hybrid search, vector databases, LLM orchestration, and asynchronous ingestion pipelines to enable scalable document intelligence across large collections of enterprise documents.

Architectural Note: Developed using a "Bring Your Own Key" (BYOK) model with free-tier APIs (Groq & Gemini) during development, while architected for seamless transition to enterprise-grade production APIs for deployment.

Core Features

Enterprise RAG Chat

AI-powered conversational interface that enables users to query documents using natural language with streaming responses and source-aware contextual retrieval.

Hybrid Search Engine

Combined BM25 keyword retrieval and vector similarity search using weighted ranking algorithms for improved semantic accuracy and relevance scoring.

Intelligent Ingestion

Automated ingestion pipeline capable of parsing, semantic chunking, and vector indexing for PDF, DOCX, TXT, and Markdown files.

Intelligence Briefs

AI-generated analytical briefs that aggregate insights across multiple documents using Gemini-based extraction pipelines and structured analytics generation.

System Architecture

DocPortalAI follows a layered enterprise microservices architecture designed for scalability, asynchronous processing, and modular AI orchestration.

DocPortalAI Enterprise RAG Architecture Diagram

DocPortalAI Enterprise RAG Architecture — Frontend, FastAPI Backend, Core Data Layer (PostgreSQL, Weaviate, S3), and AI & Cloud Providers (Groq, Nomic, Gemini).

1. Frontend Layer (React.js)

Built with React.js and Context API, the frontend provides the user interaction layer for document uploads, analytics dashboards, and real-time monitoring.

Major UI Components

  • Advanced Intelligence Dashboard: Interactive dashboard with sortable tables and document status monitoring.
  • Projects Dashboard: Central hub for managing all document projects — view project status, document counts, and jump directly into project-specific chat or analytics.
  • Project Insights Page: Per-project intelligence hub that surfaces AI-generated analytical briefs, document summaries, and key insights extracted across the entire project knowledge base.
  • Context-Aware RAG Chat UI: Conversational interface with streaming responses and source citations — supports both project-scoped and global cross-project querying.
  • Document Ingestion Portal: Drag-and-drop system with batch upload support and progress tracking.
  • Database Management Page: Multi-tenant collection browser with Weaviate vector store visibility, document count tracking, and collection-level controls.
Intelligence Dashboard

Intelligence Dashboard

Document Upload Portal

Document Ingestion Portal

Context-Aware RAG Chat UI

Context-Aware RAG Chat UI

Database Management — Collections View

DB — Collections View

Database Management — Document Index

DB — Document Index

Database Management — Vector Stats

DB — Vector Stats

Project Insights Page

AI-Generated Project Insights

AI-Generated Project Insights — Full Report View

Projects Dashboard Page

Projects Dashboard

Projects List Page

List of PDF's in a Project

2. Backend Layer (FastAPI)

The core intelligence is powered by a high-performance FastAPI backend organized into modular domain services with asynchronous processing capabilities.

API Gateway

Handles request validation, JWT authentication, GZip compression, and secure CORS security configuration.

Document Service

Manages upload lifecycle, metadata extraction, version control, and duplicate detection.

Hybrid Search Scoring

Final Score = α × BM25_Score + (1 - α) × Vector_Score

Improves semantic relevance, contextual retrieval quality, and keyword precision.

Data Storage Layer

PostgreSQL

Used for metadata storage, user sessions, analytics, document indexing, and brief storage.

Weaviate

HNSW indexing for semantic vector storage and sub-second similarity search (768D).

Amazon S3

Enterprise-grade storage for raw, processed, and temporary ingestion documents.

s3://docportal-documents/ ├── raw/ ├── processed/ └── temp/

AI & LLM Integrations

DocPortalAI integrates multiple AI providers for specialized enterprise tasks.

Provider Model Core Responsibility
Groq Llama 3.3 70B Low-latency RAG response generation & synthesis
Nomic Embed-Text-v1.5 High-dimensional (768D) vector generation
Gemini Gemini 1.5 Pro Insight extraction & intelligence brief generation

Technical Workflows

1. Document Ingestion Pipeline
PDF Upload ──▶ Python PDF Parsing ──▶ Semantic Chunking ──▶ Nomic Embedding ──▶ Weaviate DB └──▶ Raw PDF Copy ──▶ S3 Storage

The PDF is parsed immediately on upload using Python libraries (PyMuPDF, python-docx). During parsing, a raw copy of the file is simultaneously persisted to S3 for archival. The parsed content is then semantically chunked, vectorized via Nomic Embeddings, and indexed into Weaviate for retrieval.

2. RAG Chat Pipeline
User Query ──▶ Hybrid Search ──▶ Result Reranking ──▶ Context Assembly ──▶ Groq LLM ──▶ Streamed Response

Top-ranked chunks are aggregated into an optimized context window, allowing Groq Llama 3.3 to generate contextual, source-backed responses streamed to the UI. The system supports two chat modes:

Project-Specific Chat

Scoped to a single project's document collection — ideal for deep-diving into a specific knowledge base with high-precision retrieval.

Project Chat — Conversation View

Project Chat — Conversation View

Project Chat — Response Detail

Project Chat — Response Detail

RAG Source Citations — Inline References

Inline Source Citations — Every answer is grounded in traceable document references

Global Chat — Cross-Project Intelligence

Queries span all projects simultaneously, enabling cross-collection analysis and organization-wide document intelligence.

Global Chat View 1

Global Chat — Query Interface

Global Chat View 2

Global Chat — Multi-Project Response

Global Chat View 3

Global Chat — Source Aggregation

3. Intelligence Brief Generation Pipeline
Aggregate Docs ──▶ Gemini Extraction ──▶ JSON Parsing ──▶ Analytics Gen ──▶ Visualization

Gemini analyzes trends, risks, and strategic patterns across grouped documents to produce structured analytical briefs and visualizations.

AI Generated Project Insights

AI-Generated Insights Panel

Intelligence Brief Detail Modal

Intelligence Brief Detail Modal

Security Architecture

Authentication

JWT-based auth with token expiration and refresh token support.

API Security

CORS whitelisting, rate limiting, and TLS 1.3 encryption for all pipes.

Data Privacy

PII scrubbing using local Ollama and encrypted S3 storage buckets.

API Infrastructure

Exposed REST APIs for comprehensive system interaction and monitoring.

Method Endpoint Action
POST /api/v1/documents/upload Async document ingestion
POST /api/v1/chat Contextual RAG interaction
POST /api/v1/search Hybrid semantic/keyword search
GET /api/v1/stats System health & telemetry

Technical Highlights

Hybrid RAG Multi-LLM Orchestration Vector DB Async Pipelines PII Handling Microservices

App Gallery

Click any image to explore the DocPortal AI interface in high resolution.

Dashboard
Main Intelligence Dashboard

Main Intelligence Dashboard

Document Upload
Document Upload Portal

Document Ingestion Portal

Project Dashboard
Projects Dashboard

Projects Dashboard

Projects List

Projects & Documents List

AI-Generated Project Insights

AI-Generated Project Insights

Project Insights Panel

Project Insights Panel

Intelligence Brief Modal

Intelligence Brief Modal

Project Chat
Project Chat — View 1

Project Chat

Project Chat — View 2

Project Chat — Response Detail

Source Citations

Inline Source Citations

Global Chat
Global Chat — View 1

Global Chat

Global Chat — View 2

Global Chat — Multi-Project Response

Global Chat — View 3

Global Chat — Source Aggregation

Database Management
Database — Collections View

Collections View

Database — Document Index

Document Index

Database — Vector Stats

Vector Stats

Code & Deployment

The complete source code for DocPortal AI is open-source and available on GitHub.