Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
74939d7
Update .gitignore
EricYiming Feb 18, 2026
35b0dcf
Update env.ts
EricYiming Feb 18, 2026
14763a7
Update .gitignore
EricYiming Feb 22, 2026
8a65bf5
fixed dimension mismatch
EricYiming Feb 22, 2026
f27ef77
add neo4j dependency
EricYiming Feb 22, 2026
2451d07
added new env
EricYiming Feb 23, 2026
b8dcc38
connect with neo4j
EricYiming Feb 23, 2026
e6a987f
update env requirement
EricYiming Feb 23, 2026
f3f4fe2
graph search integration working
EricYiming Feb 24, 2026
914e656
minor bug fix
EricYiming Mar 5, 2026
d20f6a0
Merge remote-tracking branch 'origin/main' into feature/neo4j-kg-inte…
EricYiming Mar 5, 2026
85c83a8
removed study buddy agent, added upload functionality
Deodat-Lawson Mar 6, 2026
e8df802
Merge pull request #239 from Deodat-Lawson/feature/remove-study-buddy…
Deodat-Lawson Mar 6, 2026
95c1269
Merge remote-tracking branch 'origin/main' into feature/neo4j-kg-inte…
EricYiming Mar 8, 2026
4f7313e
feat: add provider-aware LLM routing (OpenAI + Ollama) for document Q&A
EricLiu2795 Mar 8, 2026
8e7efe7
Merge pull request #235 from Deodat-Lawson/feature/neo4j-kg-integration
Deodat-Lawson Mar 8, 2026
fea2d50
Merge branch 'main' into feature/junkun/ollama-provider
EricLiu2795 Mar 8, 2026
0e2b088
fix: resolve merge issues for Ollama provider support
EricLiu2795 Mar 8, 2026
d788349
other model compatibility
Deodat-Lawson Mar 9, 2026
9492cd6
temperature only for GPT non reasoning models
Deodat-Lawson Mar 9, 2026
b6bc3f2
Merge pull request #242 from Deodat-Lawson/feature/junkun/ollama-prov…
Deodat-Lawson Mar 9, 2026
e386004
updated legal templates
Deodat-Lawson Mar 9, 2026
a900add
Merge pull request #247 from Deodat-Lawson/feature/integrate-document…
Deodat-Lawson Mar 9, 2026
ce44618
PDR AI Rename
Deodat-Lawson Mar 14, 2026
15f69e2
Merge pull request #250 from Deodat-Lawson/timothy/feature/GEO-optimi…
Deodat-Lawson Mar 14, 2026
15a695b
Merge branch 'stable' into main
Deodat-Lawson Mar 14, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
20 changes: 19 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,18 @@ NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=
CLERK_SECRET_KEY=

# OpenAI API (get from https://platform.openai.com/)

OPENAI_API_KEY=
OPENAI_MODEL="gpt-5-mini"

# Anthropic API (optional — enables Claude models, get from https://console.anthropic.com/)
ANTHROPIC_API_KEY=

# Google AI API (optional — enables Gemini models, get from https://aistudio.google.com/apikey)
GOOGLE_AI_API_KEY=

# Ollama (optional — enables local models via Ollama, see https://ollama.com/)
OLLAMA_BASE_URL="http://localhost:11434"
OLLAMA_MODEL="llama3.1:8b"

# UploadThing (get from https://uploadthing.com/)
UPLOADTHING_SECRET="your_uploadthing_secret"
Expand All @@ -45,3 +55,11 @@ AZURE_DOC_INTELLIGENCE_KEY="your_azure_doc_intelligence_key"
# Inngest (required for background document processing - https://inngest.com/)
INNGEST_EVENT_KEY="dev_placeholder"
INNGEST_SIGNING_KEY="signkey-dev-xxxxx"

# Sidecar (optional - get from https://github.com/pdr-ai/sidecar)
SIDECAR_URL="your_sidecar_url"

# Neo4j (optional - get from https://neo4j.com/)
NEO4J_URI="your_neo4j_uri"
NEO4J_USERNAME="your_neo4j_username"
NEO4J_PASSWORD="your_neo4j_password"
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ yarn-error.log*
.idea
/.localFiles
.windsurf/rules/markdowncreation.md
/public/vad
*.pyc

# kiro
.kiro
87 changes: 84 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,90 @@
# PDR AI - Professional Document Reader AI
# Launchstack - Professional Document Reader AI

PDR AI is a Next.js platform for role-based document management, AI-assisted Q&A, and predictive document analysis. It combines document upload, optional OCR, embeddings, and retrieval to help teams find gaps and act faster.
Launchstack is a Next.js platform for role-based document management, AI-assisted Q&A, and predictive document analysis. It combines document upload, optional OCR, embeddings, and retrieval to help teams find gaps and act faster.

## Core Features

- Clerk-based Employer/Employee authentication with role-aware middleware.
- Document upload pipeline with optional OCR for scanned PDFs.
- PostgreSQL + pgvector semantic retrieval for RAG workflows.
- AI chat and predictive document analysis over uploaded content.
- Agent guardrails with PII filtering, grounding checks, and confidence gating.
- Supervisor agent that validates outputs against domain-specific rubrics.
- Marketing pipeline with content generation for Reddit, X, LinkedIn, and Bluesky.
- Optional web-enriched analysis with Tavily.
- Optional reliability/observability via Inngest and LangSmith.

## Predictive Analysis — Supported Document Types

Launchstack runs domain-specific analysis tailored to your document type:

| Type | What It Detects |
|------|----------------|
| **Contract** | Missing exhibits, schedules, addendums, and supporting agreements |
| **Financial** | Missing balance sheets, audit reports, income statements |
| **Technical** | Missing specifications, manuals, diagrams, deliverables |
| **Compliance** | Missing regulatory filings, certifications, policy documents |
| **Educational** | Missing syllabi, handouts, readings, linked resources |
| **HR** | Missing policies, forms, benefits materials, handbooks |
| **Research** | Missing cited papers, datasets, supplementary materials |
| **General** | Any document with cross-references and attachments |

Each analysis type also extracts insights (deadlines, action items, resources, caveats) and runs chain-of-verification on high-priority predictions.

## Importing External Knowledge

Launchstack can ingest content exported from third-party tools. No API keys or OAuth setup required — export your data, upload the files, and the ingestion pipeline handles the rest.

### Supported Export Formats

| Source | Export Method | Resulting Format | Launchstack Adapter |
|--------|-------------|-----------------|----------------|
| **Notion** | Settings > Export > Markdown & CSV | `.md`, `.csv` (ZIP) | TextAdapter, SpreadsheetAdapter |
| **Notion** | Page > Export > HTML | `.html` | HtmlAdapter |
| **Google Docs** | File > Download > Microsoft Word | `.docx` | DocxAdapter |
| **Google Sheets** | File > Download > CSV or Excel | `.csv`, `.xlsx` | SpreadsheetAdapter |
| **Google Drive** | Google Takeout (takeout.google.com) | `.docx` (ZIP) | DocxAdapter |
| **Slack** | Workspace Settings > Import/Export > Export | `.json` (ZIP) | JsonExportAdapter |
| **GitHub** | Code > Download ZIP | `.md`, `.txt` (ZIP) | TextAdapter |
| **GitHub** | `gh issue list --json ...` | `.json` | JsonExportAdapter |
| **GitHub** | `gh pr list --json ...` | `.json` | JsonExportAdapter |

### How to Export

**Notion**
1. Open your Notion workspace.
2. Click the **...** menu on a page, or go to **Settings & members > Export** for a full workspace export.
3. Select **Markdown & CSV** as the format and check **Include subpages** if needed.
4. Download the ZIP and upload it directly to Launchstack.

**Google Docs / Sheets**
1. Open the document in Google Docs or Sheets.
2. Go to **File > Download** and choose **Microsoft Word (.docx)** or **CSV / Excel (.xlsx)**.
3. Upload the downloaded file. For bulk exports, use [Google Takeout](https://takeout.google.com) to export your Drive as a ZIP.

**Slack**
1. Go to **Workspace Settings > Import/Export Data > Export**.
2. Choose a date range and start the export.
3. Download the ZIP and upload it to Launchstack. Each channel's messages will be ingested as a separate document.

**GitHub**
1. **Repo docs**: Click **Code > Download ZIP** on any GitHub repository. Upload the ZIP — all Markdown and text files will be ingested.
2. **Issues**: Install the [GitHub CLI](https://cli.github.com/) and run:
```bash
gh issue list --state all --limit 1000 --json number,title,body,state,labels,author,createdAt,closedAt,comments > issues.json
```
Upload the resulting `issues.json` file.
3. **Pull requests**: Run:
```bash
gh pr list --state all --limit 1000 --json number,title,body,state,labels,author,createdAt,mergedAt,comments > prs.json
```
Upload the resulting `prs.json` file.

All uploaded content flows through the standard ingestion pipeline (chunking, embedding, RAG indexing) and becomes searchable alongside your other documents.

## Architecture

PDR AI follows a three-layer modular architecture:
Launchstack follows a three-layer modular architecture:

```mermaid
block-beta
Expand Down Expand Up @@ -137,6 +208,10 @@ Optional integrations:
- `LANDING_AI_API_KEY`, `DATALAB_API_KEY`
- `LANGCHAIN_TRACING_V2`, `LANGCHAIN_API_KEY`, `LANGCHAIN_PROJECT`
- `DEBUG_PERF` (`1` or `true`) to enable dev perf logs for middleware and key auth/dashboard APIs
- `SIDECAR_URL`
- `NEO4J_URI`
- `NEO4J_USERNAME`
- `NEO4J_PASSWORD`

### 2.1) Configure Vercel Blob Storage

Expand Down Expand Up @@ -242,6 +317,12 @@ pnpm build
pnpm start
```

## Roadmap — Future Integrations

- **Notion API-key connector**: Paste your Notion Internal Integration token in settings, select pages to sync. No OAuth required. Contributions welcome.
- **GitHub webhook sync**: Automatically ingest new issues and PRs via repository webhooks.
- **Google Drive watch**: Automatic re-sync when Google Docs are updated, using Drive push notifications.

## Troubleshooting

- Confirm Docker is running before DB startup.
Expand Down
6 changes: 6 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,12 @@ services:
AZURE_DOC_INTELLIGENCE_ENDPOINT: ${AZURE_DOC_INTELLIGENCE_ENDPOINT:-}
AZURE_DOC_INTELLIGENCE_KEY: ${AZURE_DOC_INTELLIGENCE_KEY:-}
LANDING_AI_API_KEY: ${LANDING_AI_API_KEY:-}
# Anthropic / Google (optional — enables Claude and Gemini models)
ANTHROPIC_API_KEY: ${ANTHROPIC_API_KEY:-}
GOOGLE_AI_API_KEY: ${GOOGLE_AI_API_KEY:-}
# Ollama (optional — set OLLAMA_BASE_URL to an Ollama instance)
OLLAMA_BASE_URL: ${OLLAMA_BASE_URL:-}
OLLAMA_MODEL: ${OLLAMA_MODEL:-}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Docker Compose YAML indentation breaks environment variables

High Severity

The new environment variables (ANTHROPIC_API_KEY, GOOGLE_AI_API_KEY, OLLAMA_BASE_URL, OLLAMA_MODEL) appear to be outdented by 2 spaces compared to the existing environment block entries. In the diff, the existing entries (lines 65–77) are indented with 6 spaces under environment:, but the new lines at 78–83 use only 4 spaces, placing them at the app service level rather than inside environment:. This means Docker Compose will not recognize them as environment variables.

Fix in Cursor Fix in Web

ports:
- "3000:3000"

Expand Down
2 changes: 1 addition & 1 deletion docs/Architechture/Overall.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# PDR AI — Modular Architecture Overview
# Launchstack — Modular Architecture Overview

## Three-Layer Architecture

Expand Down
2 changes: 1 addition & 1 deletion docs/deployment.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Deployment Guide

This document covers deployment options for PDR AI.
This document covers deployment options for Launchstack.

## Prerequisites

Expand Down
4 changes: 2 additions & 2 deletions docs/feature-workflows.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Feature Workflows and Architecture

This document explains how major PDR AI features connect end to end.
This document explains how major Launchstack features connect end to end.

## End-to-end workflow

PDR AI follows this loop:
Launchstack follows this loop:

1. Authenticate user with role context (Employer/Employee)
2. Upload document (cloud or database storage)
Expand Down
2 changes: 1 addition & 1 deletion docs/observability.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Observability & Metrics

The PDR AI backend exposes Prometheus-compatible metrics for request health, cache efficiency, and search behavior.
The Launchstack backend exposes Prometheus-compatible metrics for request health, cache efficiency, and search behavior.

## Available Metrics

Expand Down
1 change: 1 addition & 0 deletions drizzle/0004_document_mime_type.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ALTER TABLE "document" ADD COLUMN "mime_type" varchar(128);
4 changes: 4 additions & 0 deletions next.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ const config: NextConfig = {
return webpackConfig;
},

experimental: {
middlewareClientMaxBodySize: "128mb",
},

eslint: { ignoreDuringBuilds: true },
typescript: { ignoreBuildErrors: true },

Expand Down
9 changes: 7 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "pdr_ai_v2",
"name": "launchstack",
"version": "0.1.0",
"private": true,
"type": "module",
Expand Down Expand Up @@ -34,6 +34,7 @@
"@langchain/core": "^0.3.74",
"@langchain/google-genai": "^2.1.3",
"@langchain/langgraph": "^0.4.9",
"@langchain/ollama": "^0.1.6",
"@langchain/openai": "^0.6.11",
"@langchain/textsplitters": "^0.1.0",
"@napi-rs/canvas": "^0.1.88",
Expand Down Expand Up @@ -79,13 +80,15 @@
"cmdk": "^1.1.1",
"dayjs": "^1.11.18",
"diff": "^8.0.3",
"docxtemplater": "^3.68.3",
"dotenv": "^17.3.1",
"drizzle-orm": "^0.45.1",
"duck-duck-scrape": "^2.2.7",
"embla-carousel-react": "^8.6.0",
"formdata-node": "^6.0.3",
"framer-motion": "^12.29.2",
"geist": "^1.5.1",
"highlight.js": "^11.11.1",
"inngest": "^3.49.3",
"input-otp": "^1.4.2",
"jszip": "^3.10.1",
Expand All @@ -96,6 +99,7 @@
"mammoth": "^1.11.0",
"marked": "^17.0.3",
"motion": "^12.29.2",
"neo4j-driver": "^6.0.1",
"next": "^15.5.7",
"next-themes": "^0.4.6",
"node-fetch": "^3.3.2",
Expand All @@ -108,6 +112,7 @@
"pdf2pic": "^3.2.0",
"pdfjs-dist": "^5.4.530",
"pdfjs-serverless": "^1.1.0",
"pizzip": "^3.2.0",
"postgres": "^3.4.7",
"prom-client": "^15.1.3",
"re-resizable": "^6.11.2",
Expand Down Expand Up @@ -174,4 +179,4 @@
"initVersion": "7.38.1"
},
"packageManager": "pnpm@10.15.1"
}
}
Loading
Loading