Find a file
Nikhil Shrivastava ef2ef536f0
Some checks failed
Development Build / extract-version (push) Has been cancelled
Development Build / changes (push) Has been cancelled
Tests / Backend Tests (push) Has been cancelled
Tests / Backend Lint (push) Has been cancelled
Tests / Backend Typecheck (push) Has been cancelled
Tests / Frontend Tests (push) Has been cancelled
Tests / Frontend Lint (push) Has been cancelled
Tests / Frontend Build (push) Has been cancelled
Development Build / build-regular (push) Has been cancelled
Development Build / build-single (push) Has been cancelled
Development Build / summary (push) Has been cancelled
feat(chat): render mermaid code blocks as diagrams, with fallback to code (#1631)
* feat(chat): render mermaid code blocks as diagrams, with fallback to code

A mermaid fenced block in an answer now renders as a diagram wherever
MarkdownRenderer is used (notebook chat, source chat, Ask, insights).

- Mermaid is loaded with a dynamic import, only when a block is rendered,
  so it stays out of the initial bundle.
- Strict security mode: securityLevel 'strict', htmlLabels off, and the
  secure list so a diagram's own %%{init}%% cannot override them.
- The source is validated with mermaid.parse() first; invalid syntax keeps
  the existing code block. An unclosed fence stays as code until the
  closing fence arrives, and rendering waits for the source to settle.
- Follows the light/dark theme, has a Show code / Show diagram toggle, and
  a wide diagram scrolls inside its container.
- Adds the two toggle strings to every locale, tests, and a CHANGELOG entry.

Fixes #1625

* fix(chat): keep the app theme when a diagram has an init directive

Add theme to the keys Mermaid protects from %%{init}%%, rename the
test that only checks those keys, and use fake timers for the tests
that assert nothing happens during the settle delay.

* fix(chat): keep the diagram when the parent re-renders

The `code` renderer was an inline function in the `components` object, so it
had a new identity on every render. React treated it as a different component
type and remounted MermaidBlock, which dropped the diagram back to the code
block, re-ran Mermaid after the settle delay and reset the Show code toggle.

Build the default renderers once per theme with useMemo and read the current
text through a ref, so the `code` renderer keeps its identity while the text
streams. Callers that pass `components` inline (StreamingResponse) only
replace the entries they override.

Adds regression tests: a parent re-render, the Show code toggle and text
appended after a closed block all keep the diagram, and Mermaid renders once.
2026-12-01 13:53:16 +00:00
.claude/agents docs(smoke): add the PDF fixture and a fresh-database setup to the smoke journey (#1578) 2026-11-13 14:20:53 -03:00
.codex/agents feat: add anthropic_compatible credential provider (#1043) 2026-07-19 15:14:17 -03:00
.github feat(release-test): restart the RC stack without losing its data (#1659) 2026-11-29 20:08:47 -03:00
.maintainer feat(release-test): restart the RC stack without losing its data (#1659) 2026-11-29 20:08:47 -03:00
api fix(sources): reject retry while a source is already processing (#1646) 2026-11-29 14:46:37 +00:00
commands fix(sources): give failed sources a real title and show why they failed (#1614) 2026-11-14 12:50:58 -03:00
docs feat(podcasts): add a download button to episode cards (#1633) 2026-11-29 15:21:18 +00:00
examples docs: raise the minimum Node.js for source installs to 22.12 2026-11-14 12:51:39 +00:00
frontend feat(chat): render mermaid code blocks as diagrams, with fallback to code (#1631) 2026-12-01 13:53:16 +00:00
open_notebook fix(sources): refresh content settings for each extraction (#1624) 2026-11-17 14:33:57 -03:00
prompts docs(chat): document the context-to-execute flow and drop search-tool wording (#1574) 2026-11-13 14:20:48 -03:00
scripts feat(release-test): restart the RC stack without losing its data (#1659) 2026-11-29 20:08:47 -03:00
tests fix(sources): reject retry while a source is already processing (#1646) 2026-11-29 14:46:37 +00:00
.dockerignore feat(sources): opt-in Docling + Crawl4AI runtimes installed at startup (#1122) (#1123) 2026-07-13 08:26:20 -03:00
.env.example docs: mark the compose encryption fallback as compatibility-only 2026-10-17 17:19:41 -04:00
.gitattributes fix(docker): make wait-for-api.sh POSIX and enforce LF line endings (#586) (#598) 2026-04-19 15:49:11 -03:00
.gitignore chore: add the oss-maintainer profile under .maintainer/ (#1351) 2026-09-30 22:31:39 -03:00
.pre-commit-config.yaml style: ruff format the Python codebase and gate it in CI (#1429) 2026-10-03 07:12:25 -03:00
.python-version forcing 3.12 as maximum python version to fix pydub issue 2025-04-26 06:23:31 -03:00
.worktreeinclude feat(ui): add command palette for quick navigation and search (#288) 2025-12-01 14:59:17 -03:00
AGENTS.md feat(api): limit CORS to localhost and the same host when no password is set (#1556) 2026-11-07 21:07:58 -03:00
CHANGELOG.md feat(chat): render mermaid code blocks as diagrams, with fallback to code (#1631) 2026-12-01 13:53:16 +00:00
CLAUDE.md docs: restructure documentation around AGENTS.md, VISION.md and decision records (#1032) 2026-07-10 15:33:19 -03:00
CODE_OF_CONDUCT.md docs: add Code of Conduct (Contributor Covenant v2.1) (#856) 2026-06-13 09:13:49 -03:00
CONFIGURATION.md docs: restructure documentation around AGENTS.md, VISION.md and decision records (#1032) 2026-07-10 15:33:19 -03:00
CONTRIBUTING.md docs: development docs match the codebase; add-a-provider playbook (#1458) 2026-10-04 23:06:36 -03:00
cubic.yaml docs: refresh stale provider-registry, cubic.yaml and Ollama example rules (#1474) (#1544) 2026-11-07 15:22:26 -03:00
dev-init.sh feat(worker): expose OPEN_NOTEBOOK_WORKER_MAX_TASKS to control worker concurrency (#1141) 2026-07-14 12:28:48 -03:00
docker-compose.override.yml.example docs: stop teaching 0.0.0.0 SurrealDB port exposure in setup snippets (#1060) 2026-07-12 08:42:52 -03:00
docker-compose.yml docs: mark the compose encryption fallback as compatibility-only 2026-10-17 17:19:41 -04:00
Dockerfile feat(sources): opt-in Docling + Crawl4AI runtimes installed at startup (#1122) (#1123) 2026-07-13 08:26:20 -03:00
LICENSE Initial commit with all features 2024-10-21 14:56:10 -03:00
logo.png fix discord link 2025-04-24 10:14:59 -03:00
MAINTAINER_GUIDE.md docs: restructure documentation with new organized layout 2026-01-03 20:10:24 -03:00
Makefile feat(release-test): restart the RC stack without losing its data (#1659) 2026-11-29 20:08:47 -03:00
mypy.ini ci: gate PRs on mypy, start ignore_errors burn-down (#1076) 2026-07-11 19:25:29 -03:00
pyproject.toml chore(release): 1.16.0 (#1649) 2026-11-29 14:04:57 -03:00
README.dev.md docs: development docs match the codebase; add-a-provider playbook (#1458) 2026-10-04 23:06:36 -03:00
README.md Merge PR #1513 onto current main 2026-11-13 18:04:44 +00:00
run_api.py Api podcast migration (#93) 2025-07-17 08:36:11 -03:00
SECURITY.md docs: add SECURITY.md with disclosure policy (#954) 2026-06-21 18:04:02 -03:00
supervisord.conf feat(worker): expose OPEN_NOTEBOOK_WORKER_MAX_TASKS to control worker concurrency (#1141) 2026-07-14 12:28:48 -03:00
supervisord.surrealdb.conf build: converge Docker builds into a single multi-stage Dockerfile (#1066) 2026-07-11 18:46:43 -03:00
uv.lock chore(release): 1.16.0 (#1649) 2026-11-29 14:04:57 -03:00
VISION.md docs: restructure documentation around AGENTS.md, VISION.md and decision records (#1032) 2026-07-10 15:33:19 -03:00

Forks Stargazers Issues MIT License


Logo

Open Notebook

An open source, privacy-focused alternative to Google's Notebook LM!
Join our Discord server for help, to share workflow ideas, and suggest features!
Checkout our website »
Follow @lfnovo on X for updates

📚 Get Started · 📖 User Guide · ✨ Features · 🚀 Deploy

lfnovo%2Fopen-notebook | Trendshift

New Notebook

In a world dominated by Artificial Intelligence, having the ability to think 🧠 and acquire new knowledge 💡, is a skill that should not be a privilege for a few, nor restricted to a single provider.

Open Notebook empowers you to:

  • 🔒 Control your data - Keep your research private and secure
  • 🤖 Choose your AI models - 20+ providers including OpenAI, Anthropic, Google, Mistral, Ollama and any OpenAI-compatible server (LM Studio, vLLM)
  • 📚 Organize multi-modal content - PDFs, videos, audio, web pages, and more
  • 🎙️ Generate professional podcasts - Advanced multi-speaker podcast generation
  • 🔍 Search intelligently - Full-text and vector search across all your content
  • 💬 Chat with context - AI conversations powered by your research
  • 🌐 Multi-language UI - English, Bengali, Catalan, Chinese (Simplified & Traditional), French, German, Italian, Japanese, Polish, Portuguese, Russian, Spanish and Turkish

Learn more about our project at https://www.open-notebook.ai


🆚 Open Notebook vs Google Notebook LM

Feature Open Notebook Google Notebook LM Advantage
Privacy & Control Self-hosted, your data Google cloud only Complete data sovereignty
AI Provider Choice 20+ providers, cloud or local (OpenAI, Anthropic, Google, Ollama, LM Studio, etc.) Google models only Flexibility and cost optimization
Podcast Speakers 1-4 speakers with custom profiles 2 speakers only Extreme flexibility
Content Transformations Custom and built-in Limited options Unlimited processing power
API Access Full REST API No API Complete automation
Deployment Docker, cloud, or local Google hosted only Deploy anywhere
Citations Answers cite the sources, notes and insights they used Comprehensive with sources Research integrity
Customization Open source, fully customizable Closed system Unlimited extensibility
Cost Pay only for AI usage Free tier + Monthly subscription Transparent and controllable

Why Choose Open Notebook?

  • 🔒 Privacy First: Your sensitive research stays completely private
  • 💰 Cost Control: Choose cheaper AI providers or run locally with Ollama
  • 🎙️ Better Podcasts: Full script control and multi-speaker flexibility vs limited 2-speaker deep-dive format
  • 🔧 Unlimited Customization: Modify, extend, and integrate as needed
  • 🌐 No Vendor Lock-in: Switch providers, deploy anywhere, own your data

Built With

Python Next.js React SurrealDB LangChain

🚀 Quick Start

Prerequisites

  • Docker Desktop (macOS, Windows) or Docker Engine with the Compose plugin (Linux)
  • An API key from an AI provider, or a local model server such as Ollama. You add it in the UI, not in config files.

Step 1: Download docker-compose.yml

mkdir open-notebook && cd open-notebook
curl -o docker-compose.yml https://raw.githubusercontent.com/lfnovo/open-notebook/main/docker-compose.yml

This is the official docker-compose.yml from this repository. It runs two services: surrealdb (the database) and open_notebook (UI, API and background worker).

Step 2: Set your encryption key

Create a .env file next to docker-compose.yml and set OPEN_NOTEBOOK_ENCRYPTION_KEY to a long random secret you generate yourself (for example with openssl rand -hex 32; other options). The shipped compose file reads it from .env. Editing that line in docker-compose.yml is a valid alternative. It encrypts the API keys you store; keep it. When neither is set, the file falls back to change-me-to-a-secret-string only for installs that used that placeholder. If an existing install has a custom key in its old compose file, copy that exact key into .env before replacing the file; do not generate a new one. That fallback is public. Replace it before you save provider keys.

Shared network or server? The UI (8502) and API (5055) are published on all network interfaces and there is no password by default. If other devices can reach this machine, change those two port lines to "127.0.0.1:8502:8502" and "127.0.0.1:5055:5055", or set OPEN_NOTEBOOK_PASSWORD in the same .env file, before starting.

Step 3: Start services

docker compose up -d

Wait about 30 seconds, then open: http://localhost:8502

Step 4: Connect an AI provider

  1. In the sidebar, open Models (under Manage).
  2. Find your provider (OpenAI, Anthropic, Google, etc.) and click Add Configuration.
  3. Enter a name and your API key (local providers such as Ollama need a Base URL instead), then click Add Configuration.
  4. Click Test on the new configuration to check the connection.
  5. Click Models, choose a Model Type, tick the models to add and click Add. Add at least one Language model and one Embedding model.
  6. Under Default Model Assignments, click Auto-assign Defaults (or pick the models yourself).

Done! Create a notebook, add a source and start chatting. Full walkthrough: Connect a provider.

Need an API key? Get one from: OpenAI · Anthropic · Google · Groq

Anthropic and Groq have no embedding models; pair them with a provider that does (see the matrix).

Want free local AI? See the Local Quick Start (Ollama in Docker).


📚 More Installation Options


📖 Need Help?


Star History

Star History Chart

Provider Support Matrix

Thanks to the Esperanto library, we support these providers out of the box. The columns show the model types each provider offers; what you can use depends on your account.

Provider LLM Support Embedding Support Speech-to-Text Text-to-Speech
OpenAI ✅ ✅ ✅ ✅
Anthropic ✅ ❌ ❌ ❌
Google (GenAI) ✅ ✅ ✅ ✅
Groq ✅ ❌ ✅ ❌
Mistral ✅ ✅ ✅ ✅
DeepSeek ✅ ❌ ❌ ❌
xAI ✅ ❌ ❌ ✅
OpenRouter ✅ ✅ ✅ ✅
DashScope (Qwen) ✅ ❌ ❌ ❌
MiniMax ✅ ❌ ❌ ✅
Novita ✅ ❌ ❌ ❌
SiliconFlow ✅ ❌ ❌ ❌
Z.ai ✅ ❌ ❌ ❌
PayPerQ (PPQ) ✅ ✅ ✅ ✅
Cohere ✅ ✅ ❌ ❌
Voyage ❌ ✅ ❌ ❌
ElevenLabs ❌ ❌ ✅ ✅
Deepgram ❌ ❌ ✅ ✅
Ollama ✅ ✅ ❌ ❌
oMLX ✅ ✅ ❌ ❌
Azure OpenAI ✅ ✅ ✅ ✅
Vertex AI ✅ ✅ ❌ ✅
OpenAI Compatible* ✅ ✅ ✅ ✅
Anthropic Compatible ✅ ❌ ❌ ❌

*Supports LM Studio and any OpenAI-compatible endpoint. Prefer the native oMLX provider for oMLX (Apple Silicon); see docs/5-CONFIGURATION/omlx.md.

✨ Key Features

Core Capabilities

  • 🔒 Privacy-First: Self-hosted; with local models nothing leaves your machine
  • 🎯 Multi-Notebook Organization: Manage multiple research projects seamlessly
  • 📚 Universal Content Support: PDFs, videos, audio, web pages, Office docs, and more
  • 🤖 Multi-Model AI Support: 20+ providers including OpenAI, Anthropic, Ollama, Google, LM Studio, and more
  • 🎙️ Professional Podcast Generation: Advanced multi-speaker podcasts with Episode Profiles
  • 🔍 Intelligent Search: Full-text and vector search across all your content
  • 💬 Context-Aware Chat: AI conversations powered by your research materials
  • 📝 AI-Assisted Notes: Generate insights or write notes manually

Advanced Features

  • ⚡ Reasoning Model Support: Full support for thinking models like DeepSeek-R1 and Qwen3
  • 🔧 Content Transformations: Powerful customizable actions to summarize and extract insights
  • 🌐 Comprehensive REST API: Full programmatic access for custom integrations API Docs
  • 🔐 Optional Password Protection: Secure public deployments with authentication
  • 📊 Fine-Grained Context Control: Choose exactly what to share with AI models
  • 📎 Citations: Get answers with proper source citations

Podcast Feature

Check out our podcast sample

📚 Documentation

Getting Started

User Guide

Advanced Topics

(back to top)

🗺️ Where We're Going

Right now the focus is on making the core experience (sources, chat, search, notes, podcasts) solid across every provider and deployment, before adding new product surfaces. The bigger directions under consideration, such as multi-user support, new output formats and agents operating Open Notebook through MCP, are described in the Horizon section of VISION.md. They are directions, not dated promises.

Explore GitHub Discussions for proposed features and product ideas, and open Issues for known bugs and approved work. Recent changes are in the CHANGELOG.

(back to top)

📖 Need Help?

🤝 Community & Contributing

Join the Community

  • 💬 Discord Server - Get help, share ideas, and connect with other users
  • 𝕏 Follow @lfnovo on X - Project updates and news from the maintainer
  • 💡 GitHub Discussions - Ask questions and shape features, product direction, design, and architecture
  • 🐛 GitHub Issues - Report reproducible bugs and find approved work
  • ⭐ Star this repo - Show your support and help others discover Open Notebook

Contributing

We welcome contributions! We're especially looking for help with:

  • Frontend Development: Help improve our modern Next.js/React UI
  • Testing & Bug Fixes: Make Open Notebook more robust
  • Feature Development: Build the coolest research tool together
  • Documentation: Improve guides and tutorials

Current Tech Stack: Python, FastAPI, Next.js, React, SurrealDB

See our Contributing Guide for detailed information on how to get started, including our guidelines for AI-assisted contributions. To understand what we're building (and what we'll say no to), read VISION.md.

(back to top)

📄 License

Open Notebook is MIT licensed. See the LICENSE file for details.

Community Support:

(back to top)