What Programming Languages Are Used in Open Notebook? A Complete Technical Breakdown
Open Notebook is built with TypeScript for the React/Next.js frontend, Python 3.11+ for the FastAPI backend, and Bash/Docker for deployment automation. This lfnovo/open-notebook repository implements a full-stack architecture where each tier uses a language optimized for its specific responsibilities, from UI interactivity to AI orchestration and containerized deployment.
Frontend Architecture: TypeScript and React
The user interface layer of Open Notebook relies entirely on TypeScript with JSX to deliver a type-safe, modern React application.
React Components and TypeScript Configuration
All frontend source code resides in the frontend/ directory, where TypeScript provides compile-time safety for React components and state management. The project uses Next.js as the meta-framework, Zustand for state management, and Tailwind CSS for styling—all orchestrated through TypeScript.
Key configuration files include:
frontend/package.json— Declares TypeScript dependencies alongside Next.js, React, and Zustandfrontend/tsconfig.json— Configures the TypeScript compiler with strict type checking for the UI codebase
A typical component follows this pattern found in frontend/src/components/ui/button.tsx:
// File: frontend/src/components/ui/Hello.tsx
import React from "react";
type Props = {
name?: string;
};
export const Hello: React.FC<Props> = ({ name = "world" }) => (
<div className="p-4 text-lg">
Hello, {name}!
</div>
);
Backend Architecture: Python 3.11+
The API layer is implemented in Python 3.11+, leveraging FastAPI's async capabilities to handle AI provider orchestration, LangGraph workflows, and SurrealDB database operations.
FastAPI Application Layer
The backend entry point resides in api/main.py, which initializes the FastAPI application with middleware, CORS handling, and router inclusion. As implemented in the lfnovo/open-notebook source code, the backend uses an async-first design pattern:
# File: api/main.py
from fastapi import FastAPI
app = FastAPI(title="Open Notebook API")
@app.get("/hello")
async def hello(name: str = "world"):
"""Return a friendly greeting."""
return {"message": f"Hello, {name}!"}
AI and Database Modules
The Python backend contains several critical modules:
open_notebook/ai/models.py— Implements the multi-provider AI abstraction layer (codenamed Esperanto) that orchestrates different language modelsopen_notebook/database/repository.py— Provides the async SurrealDB repository layer for graph database operations
These modules demonstrate Python's role in handling the "heavy lifting" of AI orchestration and asynchronous data access.
DevOps and Deployment: Bash and Docker
Supporting the main application tiers, Open Notebook uses Bash scripts and Dockerfile configurations for CI/CD automation and containerization.
Shell Scripts for CI/CD
Helper scripts in the scripts/ directory automate development workflows. The scripts/wait-for-api.sh file exemplifies the Bash automation used in container orchestration:
#!/usr/bin/env bash
# wait for the API to become healthy before proceeding
while ! curl -s http://localhost:5055/health | grep -q "healthy"; do
echo "Waiting for API..."
sleep 1
done
echo "API is ready!"
Additionally, scripts/export_docs.py provides Python-based utilities for documentation generation from code comments.
Container Configuration
The Dockerfile defines the container image that bundles the Python backend and its dependencies, ensuring consistent deployment environments across development and production.
Summary
Open Notebook employs a polyglot architecture optimized for modern full-stack development:
- TypeScript powers the React/Next.js frontend with type-safe components and Zustand state management
- Python 3.11+ drives the FastAPI backend, handling AI providers via LangGraph and async SurrealDB operations in
open_notebook/ai/models.pyandopen_notebook/database/repository.py - Bash scripts in
scripts/wait-for-api.shautomate CI/CD and deployment workflows - Docker packages the entire application for containerized deployment
Frequently Asked Questions
Is Open Notebook purely a Python project?
No, Open Notebook is a multi-language application. While the backend AI orchestration and API logic are written in Python 3.11+, the frontend is built entirely with TypeScript using React and Next.js. The repository also includes Bash scripts for automation and Docker for deployment.
Why does Open Notebook use TypeScript instead of JavaScript for the frontend?
The project uses TypeScript to provide compile-time type safety for the React component tree and state management. According to the source code in frontend/tsconfig.json, the configuration enforces strict typing, which reduces runtime errors in the complex UI interactions involving AI chat interfaces and notebook editing.
What Python version is required to run the Open Notebook backend?
The backend requires Python 3.11+, as indicated by the async FastAPI implementation in api/main.py and the modern Python features used in modules like open_notebook/ai/models.py. The async/await patterns throughout the database repository layer leverage Python 3.11's enhanced asyncio capabilities.
Does Open Notebook use any other languages beyond Python and TypeScript?
Yes, the repository includes Bash shell scripts for development automation (such as scripts/wait-for-api.sh for health checks) and Dockerfile syntax for container definitions. There are also utility Python scripts like scripts/export_docs.py that support documentation generation, but no other compiled languages are used in the core application.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →