Skip to content

Latest commit

 

History

History
522 lines (386 loc) · 16.8 KB

File metadata and controls

522 lines (386 loc) · 16.8 KB
ThinkFlow Logo

Open-NotebookLM / ThinkFlow

Python FastAPI React Vite License GitHub Repo

中文 | English

An AI knowledge workspace for paper reading, product research, course learning, and team presentations: from source ingestion and grounded chat to multimodal retrieval, knowledge assets, reports, mindmaps, PPTs, podcasts, flashcards, and quizzes

| 📚 Source-grounded QA  |  🧠 Multimodal Retrieval  |  📝 Knowledge Workspace  |  🎬 Multi-output Generation |


Quick Start Showcase Docs

ThinkFlow workspace dashboard

📑 Table of Contents

✨ Core Features

ThinkFlow turns a notebook into a traceable knowledge production loop: sources enter the notebook, conversations refine understanding, confirmed knowledge is saved, and final outputs are generated from locked context.

  • 📚 Unified source ingestion: upload files, paste text, import URLs, run search/deep-research flows, and organize all materials inside one notebook.
  • 💬 Source-grounded conversation: ask questions against selected sources, keep citations and source mappings, and continue in multiple named conversation branches.
  • 🧠 VLM multimodal retrieval: switch between text mode and VLM mode, attach or paste images, retrieve PDF page images/figures, and ground answers in visual evidence.
  • 🖼️ PDF image indexing and gallery: rebuild PDF image indexes, view extracted images, and feed those visual assets into retrieval and downstream outputs.
  • 📝 Knowledge workspace: save useful answers into Summary cards, editable documents, and output guidance instead of losing them in chat history.
  • 📌 Stateful conversations: preserve selected sources, bound documents, active documents, and output context per conversation.
  • 📄 Report generation: produce report drafts from sources, documents, and guidance.
  • 🗺️ Mindmap generation: turn source material into navigable hierarchical maps with preview and export options.
  • 🎞️ PPT workflow: generate outlines first, then review and produce slide-level presentation content.
  • 🎧 Podcast generation: generate scripts and playable audio from source-grounded context.
  • 🧩 Learning outputs: create flashcards and quizzes for course review, onboarding, and knowledge checks.
  • 🎬 Video generation: generate storyboards, narration scripts, and video outputs from source material.

🔁 Workflow

1. Ingest 2. Ask 3. Save 4. Guide 5. Generate
PDF / Word / image / audio / video / text / web Text RAG or VLM retrieval Summary, documents, and reusable notes Output guidance and source snapshots Report, mindmap, PPT, video, podcast, cards, quiz

ThinkFlow is not a one-shot chat window. It is designed for iterative knowledge work:

  1. Create a notebook for a paper, product investigation, class, or team presentation.
  2. Import sources and select which ones should participate in each conversation or output.
  3. Ask source-grounded questions in text mode, or switch to VLM mode for images, screenshots, PDF figures, and visual references.
  4. Save confirmed knowledge into Summary, documents, and output guidance.
  5. Generate final artifacts from a locked source/document/guidance context so results remain traceable.

📸 Showcase

📚 Source Workspace and Grounded Chat


✨ Bring files, text, URLs, search results, and deep-research materials into one notebook

✨ Use the three-column workspace to manage sources, chat, documents, and outputs

🧠 Multimodal Retrieval


✨ Text mode retrieves source chunks and answers with grounded context

✨ VLM mode accepts image prompts and retrieves visual evidence from PDFs and image sources

📝 Knowledge Workspace


✨ Save distilled conclusions into Summary cards

✨ Maintain editable documents as the main input for reports and PPTs

✨ Save audience, style, and focus constraints as output guidance


✨ Push valuable chat answers into reusable knowledge assets

✨ Reuse saved documents as explicit references for later outputs

📄 Reports and Mindmaps


✨ Generate report drafts from sources, documents, and guidance

✨ Turn source material into a structured mindmap for fast review

🧩 Learning Outputs


✨ Convert source content into flashcards

✨ Review and flip cards in the workspace

✨ Generate quizzes with answers and explanations

🎞️ PPT, Video, and Podcast


✨ Create and refine PPT outlines before slide generation

✨ Review slide generation progress and page-level content

✨ Open generated PPT results inside the output workspace


✨ Confirm narration and storyboard before video rendering

✨ Generate podcast scripts and playable audio from locked sources

View video generation demo


🚀 Quick Start

Requirements

  • Python 3.11 or newer
  • Node.js 18 or newer
  • npm
  • LLM and embedding API configuration for the features you want to run
  • Optional: ffmpeg for audio/video processing and media outputs

Ubuntu example for common media/runtime packages:

sudo apt-get update
sudo apt-get install -y ffmpeg libxcb-shm0 libxcb-shape0 libxcb-xfixes0

1. Clone and enter the project

git clone https://github.com/OpenDCAI/Open-NotebookLM.git
cd Open-NotebookLM

2. Create environment and install backend dependencies

python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt

For tests:

pip install -r requirements-dev.txt

3. Install frontend dependencies

cd frontend
npm install
cd ..

4. Configure environment variables

cp fastapi_app/.env.example fastapi_app/.env

Edit fastapi_app/.env with at least LLM and embedding settings. See Configuration for examples.

5. Start all services

./scripts/start.sh

The script starts:

  • Backend: http://localhost:8000
  • Frontend: http://localhost:3001
  • Local embedding service on port 8899 if that port is free
  • Monitor script for basic process recovery

Stop services:

./scripts/stop.sh

6. Manual startup

If you do not want the script to start the bundled local embedding service, run backend and frontend manually:

# Terminal 1: backend
python -m uvicorn fastapi_app.main:app --host 0.0.0.0 --port 8000
# Terminal 2: frontend
cd frontend
npm run dev -- --host 0.0.0.0 --port 3001

Then open:

http://localhost:3001

Health check:

curl http://localhost:8000/health

Expected response:

{"status":"ok"}

⚙️ Configuration

All backend configuration lives in fastapi_app/.env. The example file uses placeholders only; replace them with your own provider settings.

LLM

LLM_API_URL=https://api.example.com/v1
LLM_API_KEY=your_llm_api_key
LLM_MODEL=your_model_name

Embedding

OpenAI-compatible or ApiYi-compatible embedding:

EMBEDDING_PROVIDER=apiyi
EMBEDDING_API_URL=https://api.example.com/v1
EMBEDDING_API_KEY=your_embedding_api_key
EMBEDDING_MODEL=text-embedding-3-small
EMBEDDING_DIMENSION=1536

Local embedding service:

EMBEDDING_PROVIDER=local
EMBEDDING_API_URL=http://localhost:8899/v1
EMBEDDING_API_KEY=
EMBEDDING_MODEL=/path/to/your/embedding-model
EMBEDDING_DIMENSION=1024

Note

scripts/start.sh will try to launch scripts/start_embedding_4b.sh when port 8899 is free. If the default local model path is not available on your machine, either set EMBEDDING_MODEL and EMBEDDING_PYTHON_BIN, or use an external embedding provider.

VLM and visual embedding

These settings enable image attachments, PDF image retrieval, and multimodal answer grounding:

KB_VLM_MODEL=your_multimodal_chat_model
VISUAL_EMBEDDING_API_URL=https://api.example.com/v1
VISUAL_EMBEDDING_API_KEY=your_visual_embedding_api_key
VISUAL_EMBEDDING_MODEL=your_visual_embedding_model

If VISUAL_EMBEDDING_API_KEY is empty, the visual embedding client can fall back to the normal embedding key. If VLM or visual embedding is not configured, text RAG, source ingestion, documents, and standard outputs can still run.

TTS, search, image generation, and video

TTS_PROVIDER=apiyi
TTS_API_URL=https://api.example.com/v1
TTS_API_KEY=your_tts_api_key
TTS_MODEL=qwen-tts

SEARCH_PROVIDER=serper
SERPER_API_KEY=your_serper_key_here
SERPAPI_KEY=your_serpapi_key_here
BOCHA_API_KEY=your_bocha_key_here

IMAGE_GEN_API_URL=https://api.example.com/v1
IMAGE_GEN_API_KEY=your_image_gen_api_key
IMAGE_GEN_MODEL=your_image_model

GUI_PLUS_API_KEY=your_dashscope_or_bailian_key
LIVEPORTRAIT_KEY=your_liveportrait_key

Supabase authentication

Supabase is optional. If it is not configured, the app can still run with local workspace data under outputs/.

SUPABASE_URL=https://your-project-id.supabase.co
SUPABASE_ANON_KEY=your_supabase_anon_key
SUPABASE_SERVICE_ROLE_KEY=your_supabase_service_role_key

📂 Project Structure

.
├── fastapi_app/              # FastAPI backend: auth, notebooks, sources, documents, outputs, search, TTS
├── frontend/                 # React + Vite frontend for the ThinkFlow workspace
├── workflow_engine/          # Workflow orchestration, multimodal tools, prompt templates, output pipelines
├── docs/                     # Product docs, architecture notes, walkthroughs, and README assets
│   └── assets/               # Screenshots, logo, and showcase video used by README/docs
├── scripts/                  # Start/stop scripts, monitor, and local embedding service launcher
├── static/                   # Static README/product assets
├── requirements.txt          # Standard Python dependency entrypoint
├── requirements-base.txt     # Backend runtime dependency list
└── requirements-dev.txt      # Test/development dependencies

🧪 Development Commands

# Backend tests
pytest -q

# Backend syntax check
python -m compileall fastapi_app workflow_engine scripts

# Frontend build
cd frontend && npm run build

# Frontend tests
cd frontend && npm test

# Service health
curl http://localhost:8000/health

# Stop script-started services
./scripts/stop.sh

📦 Local Data Locations

ThinkFlow stores runtime data inside the project directory by default, which makes local trials, debugging, and migration straightforward:

  • outputs/: notebooks, uploaded sources, generated outputs, vector indexes, and local workspace state. Back up this directory before moving or cleaning the project.
  • logs/: backend, frontend, and embedding service logs generated by scripts/start.sh, useful for debugging startup, retrieval, and generation issues.
  • fastapi_app/.env: local environment configuration copied from fastapi_app/.env.example, where you set model, embedding, TTS, search, image generation, and other provider settings.

🗺️ Roadmap

Status Area Direction
Source-grounded workspace Notebook, sources, conversations, citations, documents, and outputs
Multimodal retrieval VLM mode, image attachments, visual embedding, PDF image gallery
Knowledge assets Summary cards, editable documents, output guidance, document references
Multi-output generation Report, mindmap, PPT, podcast, flashcards, quiz, video
🚧 Editable output workflows More structured review and edit loops for presentation/video/report artifacts
🚧 Deployment recipes Clearer Docker/production setup and provider-specific configuration guides
🚧 Evaluation and tracing Better generation traces, source coverage checks, and output quality diagnostics

📚 More Docs

You can use Claude Code / Codex to read docs/ and understand the project.


📄 License

This project is licensed under the Apache License 2.0.