Skip to content

About

An AI-powered document intelligence platform that offers structured notebook organization with citation-backed answers, powered by Azure Classic and Agentic RAG.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

InsightPad

InsightPad is a NotebookLM-style platform built with Azure's latest(as of Jan 2026) RAG advancements for structured PDF intelligence. It lets users organize documents in notebooks, ask grounded questions, and navigate answers with citations.

Monorepo Layout

merlinNB/
├── frontend/   # React + Vite client
└── backend/    # FastAPI + Azure services

Design Choices

  • Separated frontend and backend apps: independent release cadence and deployment scaling.
  • Notebook-centric data model: documents, sessions, and messages are scoped to notebooks for focused retrieval.
  • User isolation by default: backend filters and storage paths are user-scoped to avoid cross-tenant leakage.
  • Async document pipeline: upload, convert, chunk, embed, and index happen in background-friendly stages.
  • Hybrid retrieval first: blend vector, keyword, and semantic ranking before generation.

RAG Technologies

Classic RAG

  • Retrieval: hybrid search over indexed chunks.
  • Generation: single-pass LLM answer from retrieved context.
  • Best for: direct questions and faster latency.
  • Tradeoff: less robust on multi-hop or ambiguous questions.

Agentic RAG

InsightPad's agentic mode uses Azure AI Search's Knowledge Base for multi-step retrieval orchestration. A lightweight model handles query planning and knowledge source selection, then the main model synthesizes final answers with page citations.

  • Retrieval orchestration: planner-style, multi-step query and synthesis flow.
  • Generation: iterative reasoning across intermediate retrieval steps.
  • Best for: complex, multi-part, or exploratory questions.
  • Tradeoff: higher latency and compute cost.

Agentic Retrieval Reasoning Effort

Azure AI Search's retrievalReasoningEffort parameter controls how much LLM processing is applied during query planning and answer formulation. InsightPad exposes this via the AGENTIC_REASONING_EFFORT environment variable.

Available Levels

  • Minimal, low, Medium

Configuration

Set the reasoning effort in your backend .env file:

# Options: minimal, low, medium
AGENTIC_REASONING_EFFORT=low

The setting is applied when the Knowledge Base is created. To change it after creation, you may need to recreate the Knowledge Base or override per-request.

Stack Overview

  • Frontend: React, TypeScript, Vite, TanStack Query, Tailwind CSS
  • Backend: FastAPI, Pydantic, JWT auth, Azure Cosmos DB, Azure Blob Storage, Azure AI Search, Azure OpenAI

Local Development

Prerequisites

  • Python 3.11+ with Pipenv
  • Node.js 18+ with npm
  • Azure account with required services provisioned
  • Environment variables configured (see .env.example files)

Backend

cd backend

# Install dependencies
pipenv install

# Copy and configure environment variables
cp .env.example .env
# Edit .env with your Azure credentials

# Run development server
pipenv run dev

The backend runs at http://localhost:8000 by default.

Frontend

cd frontend

# Install dependencies
npm install

# Configure API endpoint (optional, defaults to localhost:8000)
echo "VITE_API_URL=http://localhost:8000" > .env

# Run development server
npm run dev

The frontend runs at http://localhost:5173 by default.

Docker Deployment

Backend

cd backend

# Build image
docker build -t insightpad-backend .

# Run locally
docker run -it -p 8000:8000 --env-file .env insightpad-backend

# Push to Azure Container Registry
docker tag insightpad-backend <your-registry>.azurecr.io/insightpad-backend:latest
docker push <your-registry>.azurecr.io/insightpad-backend:latest

Frontend

cd frontend

# Build image (with API URL baked in)
docker build --build-arg VITE_API_URL=https://your-backend-url.com -t insightpad-frontend .

# Run locally (with backend on host machine)
docker run -p 3000:80 \
  -e BACKEND_URL=http://host.docker.internal:8000 \
  -e BACKEND_HOST=host.docker.internal:8000 \
  insightpad-frontend

# Push to Azure Container Registry
docker tag insightpad-frontend <your-registry>.azurecr.io/insightpad-frontend:latest
docker push <your-registry>.azurecr.io/insightpad-frontend:latest

Environment Variables

Backend (.env)

Key variables to configure:

Variable Description
AZURE_OPENAI_ENDPOINT Azure OpenAI service endpoint
AZURE_OPENAI_API_KEY Azure OpenAI API key
COSMOS_ENDPOINT Azure Cosmos DB endpoint
COSMOS_KEY Azure Cosmos DB key
AZURE_BLOB_CONNECTION_STRING Azure Blob Storage connection string
AZURE_SEARCH_ENDPOINT Azure AI Search endpoint
AZURE_SEARCH_ADMIN_KEY Azure AI Search admin key
JWT_SECRET_KEY Secret for JWT token signing
AGENTIC_REASONING_EFFORT Reasoning effort level: minimal, low, or medium

See backend/.env.example for the complete list.

Frontend (.env)

Variable Description
VITE_API_URL Backend API base URL

Compatibility Notes

To avoid breaking existing client deployments, some infrastructure defaults and cloud resource identifiers may still include legacy names in environment variables/configuration.

About

An AI-powered document intelligence platform that offers structured notebook organization with citation-backed answers, powered by Azure Classic and Agentic RAG.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors