Skip to content

Repository files navigation

AgentDoc β€” Autonomous AI Document Workspace

Vite React FastAPI TailwindCSS Python License: MIT

AgentDoc is an autonomous document intelligence platform that transforms natural-language prompts into publication-grade business reports, strategic plans, and technical architectures. Designed for consultants, analysts, and recruiters, it bridges the gap between raw LLM completions and executive-ready deliverables (PDF/DOCX/Markdown) through a multi-stage reasoning pipeline, real-time interactive plan editing, and a premium "vellum-and-ink" Notion-inspired workspace.


🌍 Live Demo


πŸ’‘ Demo Prompts

These sample prompts are designed to showcase the platform's capabilities during live demonstrations. Copy and paste them into the workspace to see AgentDoc in action.

Standard Mode (Fast & Direct)
Use this mode for straightforward documents that don't require complex multi-step reasoning. It generates the document in a single pass.
Create a professional business proposal for implementing an AI-powered customer support chatbot for a mid-sized e-commerce company with approximately 200 employees. Include an executive summary, current challenges, proposed solution, implementation roadmap, estimated budget, expected business benefits, risks, KPIs, project timeline, and final recommendations. Present the document in a consultant-style format with headings, tables, and bullet points.
Adaptive Mode (Context-Aware)
Use this mode when you want the system to automatically determine the necessary depth of analysis and whether to use a multi-step plan based on the prompt's complexity.
Create a strategic business expansion plan for a rapidly growing fintech startup planning to enter three new international markets. Include market analysis, expansion strategy, operational roadmap, regulatory considerations, hiring plan, estimated budget, risks, financial projections, success metrics, and executive recommendations. Adjust the depth of analysis based on the complexity of the problem.
Advanced Mode (Deep Reasoning Pipeline)
Use this mode for comprehensive, highly structured reports. It engages the full multi-agent pipeline (Planner β†’ Executor β†’ Synthesizer β†’ Reflector) for maximum quality and depth.
Create a comprehensive AI adoption strategy for a mid-sized retail company with 500 employees planning to integrate AI across customer support, inventory forecasting, marketing, sales, HR, and internal operations over the next 12 months. Include an executive summary, current-state assessment, stakeholder analysis, AI use cases, technology stack recommendations, implementation roadmap, cost-benefit analysis, ROI projections, governance framework, cybersecurity considerations, staffing plan, KPIs, budget breakdown, risk assessment with mitigation strategies, change management plan, and final executive recommendations. Present the report in a professional consultant-style format with numbered headings, tables, bullet points, and executive-ready language.

πŸš€ Key Features

  • Autonomous Planning & Reasonings: Decomposes complex user requests into structured, multi-phase execution tasks using an LLM-powered planner agent.
  • Human-in-the-Loop Review Mode: Pauses the generation pipeline, allowing users to inline edit, reorder, delete, or append tasks before the agent execution begins.
  • Streaming Multi-Stage Execution: Renders execution logs, generated tokens, and completed document sections in real time using Server-Sent Events (SSE).
  • Glanceable Workspace Insights: A responsive dashboard containing total document counts, average generation times, preferred generation modes, and monthly report usage tracking.
  • Notion-Style History System: Stored entirely client-side using IndexedDB with support for document favoriting, title renames, slide-out details preview drawers, and layout duplication.
  • Fuzzy Command Palette (Cmd+K): Keyboard-first routing engine allowing fast navigation, document clearing, and template triggers.
  • Consulting-Grade Document Exports:
    • PDF: Features custom typography (Inter), headers, margins, colored callouts, zebra-striped tables, page-break safeguards, and dynamic footer page numbering.
    • DOCX (Word): Visually matches the PDF styling with corporate-style cover pages, accent divider bars, custom table cells, and styled callout boxes.
    • Markdown: Standard export of the raw, semantic source text.

🎨 Workspace Walkthrough

1. Document Creator Workspace

Enter natural language prompts, select standard or advanced modes, and toggle plan review safeguards.

Generate Workspace

2. Plan Review Editor (Review Mode)

Audit, edit, reorder, delete, or add tasks before the agent executes the generation stream.

Plan Review Mode

3. Execution Live Streaming

Watch the synthesizer draft and format section contents phase by phase with live terminal logs.

Streaming View

4. Interactive Document Workspace

Inspect the completed consulting draft side-by-side with execution steps and metrics.

Execution Workspace

5. Document Library & Insights

Manage previous document drafts, favorite items, and review monthly quota metrics.

History Workspace


πŸ—οΈ System Architecture

                                [ Client UI React Workspace ]
                                              β”‚
                 β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                 β–Ό (Search / Star Favorites)   β–Ό (Execute Commands)         β–Ό (PDF / DOCX Downloads)
           [ Client IndexedDB ]          [ Commands Context Registry ] [ FastAPI Static Server ]
                                              β”‚
                                              β–Ό (Trigger Generation API POST)
                                 [ FastAPI Request Router ]
                                              β”‚
                       β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                       β–Ό (Caches matching requests)                  β–Ό (Bypasses / Cache Misses)
            [ SQLite Cache Store ]                      [ Multi-Agent Pipeline ]
                                                                     β”‚
                  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                  β–Ό              β–Ό              β–Ό              β–Ό              β–Ό              β–Ό
             [ Classifier ] [ Planner ]   [ Plan Review ] [ Executor ]  [ Synthesizer ] [ Reflector ]
             (Resolves mode)(Drafts outline)(Pause / Edit)(Runs tasks)  (Markdown build)(Score checks)
  1. Classifier: Scans the input prompt to classify the document type (e.g. Project Plan, SOP, Proposal) and determines the appropriate execution path.
  2. Planner: Outlines the logical structure and tasks required to generate the requested document.
  3. Plan Review: Pauses the system if "Require Review" is toggled, exposing the plan nodes to the client UI for editing.
  4. Executor: Runs individual tasks sequentially, compiling contextual information.
  5. Synthesizer: Merges the gathered intelligence into a cohesive, beautifully formatted Markdown file.
  6. Reflector: Conducts a self-check evaluation and triggers exactly one revision pass if quality benchmarks are not met.
  7. Document Exports: Renders the final output dynamically into PDF, DOCX, and raw Markdown formats.

πŸ› οΈ Technology Stack

Layer Technologies
Frontend React 19, TypeScript, Vite, React Router v7, Tailwind CSS, Base UI, Lucide Icons, react-markdown
Backend Python 3.13, FastAPI, Uvicorn, Pydantic, SQLite (Request Cache)
Document Export fpdf2 (PDF Generation), python-docx (DOCX Templating), markdown
AI Models OpenAI GPT-4o, Tencent OpenCode Zen (hy3-free)
Development Playwright (E2E testing), Oxlint (Linting), Pytest

βš™οΈ Configuration & Environment

Create a .env file in the project root containing:

# -----------------------------------------------------------------------------
# AgentDoc Environment Variables Template
# -----------------------------------------------------------------------------

# Backend Application Configuration
PORT=8000
DEBUG=false
ENABLE_CACHE=true

# CORS Allow List (Comma-separated list of allowed origins)
ALLOWED_ORIGINS=https://agentdoc-ai-document-workspace.vercel.app,http://localhost:5173

# LLM Provider Configuration (openai, gemini, anthropic, zen)
LLM_PROVIDER=openai
LLM_API_KEY=your_api_key_here
LLM_MODEL=gpt-4o
LLM_BASE_URL=https://api.openai.com/v1

# Optional: Run in local offline Demo mode without hitting active LLM API limits
USE_DEMO_MODE=false

# Budget & Timeout Controls (Default: 180.0)
# BUDGET_MAX_STAGE_LATENCY=180.0

πŸš€ Installation & Setup

Prerequisites

  • Node.js 20+
  • Python 3.11+
  • NPM

1. Clone & Setup Backend

# Clone the repository
git clone https://github.com/ishanbhattacharjee12/AgentDoc.git
cd AgentDoc

# Create a virtual environment and install dependencies
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt

2. Start the Backend Server

# From the project root (venv active)
python -m uvicorn app.main:app --reload --port 8000

3. Setup & Start the Frontend

# Open a new terminal tab/window
cd frontend-react
npm install
npm run dev

Open http://localhost:5173 in your browser to run the application.


πŸ“ Repository Folder Structure

.
β”œβ”€β”€ ARCHITECTURE.md          # Detailed engineering & design specifications
β”œβ”€β”€ DEPLOYMENT.md            # Production deployment guidelines
β”œβ”€β”€ INSTALLATION.md          # Developer environment setup
β”œβ”€β”€ CHANGELOG.md             # Changelog and version release notes
β”œβ”€β”€ app
β”‚   β”œβ”€β”€ agent                # Multi-agent pipelines (Planner, Synthesizer, Reflector)
β”‚   β”œβ”€β”€ llm                  # LLM Client wrappers, rate-limiting, and budget guards
β”‚   β”œβ”€β”€ main.py              # FastAPI server router & endpoints
β”‚   β”œβ”€β”€ static               # Static bundle fallback files
β”‚   └── tools                # PDF & DOCX rendering tools
β”œβ”€β”€ docs
β”‚   β”œβ”€β”€ DEMO.md              # 2-minute, 5-minute, and 10-minute audit scripts
β”‚   └── examples             # Consulting document exports (PDF / DOCX examples)
β”œβ”€β”€ frontend-react
β”‚   β”œβ”€β”€ src                  # React views, hooks, components, and layout shells
β”‚   └── package.json         # React client dependencies
└── tests                    # Backend unit test suites

πŸ“„ License

Licensed under the MIT License.


✍️ Author

Developed by Ishan Bhattacharjee (ishanbhattacharjee12).

About

Autonomous AI document intelligence platform that transforms natural language prompts into consultant-grade business documents with streaming execution, multi-stage reasoning, and professional PDF/DOCX exports.

Topics

Resources

Contributing

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages