# plmbr/notebook-intelligence architecture

> Architecture diagram of the GitHub repository plmbr/notebook-intelligence, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-16). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/plmbr/notebook-intelligence
- Repository: https://github.com/plmbr/notebook-intelligence

## Overview

Notebook Intelligence is a JupyterLab AI assistant and extensible framework. A user opens the chat panel, configures a provider or agent mode, and sends notebook-related requests; the product also offers inline completion, code generation, notebook execution, and management/diagnostic features. The frontend communicates through its API layer with Python services, which coordinate model providers and agent/tool integrations. The README establishes the product capabilities; source-index references support several internal dependencies, but unsampled implementations and route wiring limit which connections can be shown confidently.

Main entry points: [`notebook_intelligence/ai_service_manager.py`](https://github.com/plmbr/notebook-intelligence/blob/main/notebook_intelligence/ai_service_manager.py) (AI service manager), [`src/api.ts`](https://github.com/plmbr/notebook-intelligence/blob/main/src/api.ts) (Frontend API), [`notebook_intelligence/api.py`](https://github.com/plmbr/notebook-intelligence/blob/main/notebook_intelligence/api.py) (Server API), [`src/index.ts`](https://github.com/plmbr/notebook-intelligence/blob/main/src/index.ts) (Lab extension)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["JupyterLab experience"]
  node_extension["Lab extension<br/>[index.ts]"]
  node_chat["Chat interface<br/>[chat-sidebar.tsx]"]
  node_frontend_api["Frontend API<br/>[api.ts]"]
  node_settings["Settings panels<br/>[settings-panel.tsx]"]
  node_tour["First-run tour<br/>[tour-steps.ts]"]
  node_chatbook_ui["Chatbook tools<br/>[chatbook.ts]"]
end

subgraph group_services["Assistant services"]
  node_server_api["Server API<br/>[api.py]"]
  node_service_manager["AI service manager"]
  node_providers["LLM providers"]
  node_inline["Inline completion"]
  node_chat_participant["Chat participants"]
  node_chat_kernel["Chatbook kernel<br/>[kernel.py]"]
end

subgraph group_agents["Agents and tools"]
  node_claude["Claude agent<br/>[claude.py]"]
  node_acp["ACP agent<br/>[acp_agent.py]"]
  node_mcp["MCP tools<br/>[mcp_manager.py]"]
  node_rules["Rulesets<br/>[rule_manager.py]"]
  node_skills["Claude skills<br/>[skill_manager.py]"]
  node_plugins["Claude plugins<br/>[plugin_manager.py]"]
end

subgraph group_governance["Configuration and operations"]
  node_config["Configuration<br/>[config.py]"]
  node_performance["Performance diagnostics<br/>[perf.py]"]
  node_translations["Translations<br/>[i18n.py]"]
end

node_user(("Notebook user"))

node_user -->|"sends requests"| node_chat
node_extension -->|"registers panel"| node_chat
node_extension -->|"initializes"| node_frontend_api
node_extension -->|"dispatches tour"| node_tour
node_chat -.->|"uses API"| node_frontend_api
node_settings -->|"configures features"| node_frontend_api
node_frontend_api -.->|"sends requests"| node_server_api
node_server_api -->|"uses services"| node_service_manager
node_service_manager -->|"selects models"| node_providers
node_service_manager -->|"selects agent mode"| node_claude
node_service_manager -.->|"selects agent mode"| node_acp
node_chat_participant -->|"uses chat contracts"| node_server_api
node_chat_participant -->|"injects rules"| node_rules
node_chat_participant -.->|"uses toolsets"| node_mcp
node_claude -->|"uses servers"| node_mcp
node_claude -.->|"invokes skills"| node_skills
node_claude -.->|"supports plugins"| node_plugins
node_frontend_api -.->|"requests execution"| node_chat_kernel
node_extension -->|"summarizes cells"| node_chatbook_ui
node_service_manager -.->|"selects completion model"| node_inline
node_server_api -->|"reads settings"| node_config
node_service_manager -->|"uses diagnostics"| node_performance
node_server_api -->|"uses translations"| node_translations
node_frontend_api -->|"formats interface"| node_translations

click node_extension "https://github.com/plmbr/notebook-intelligence/blob/main/src/index.ts"
click node_chat "https://github.com/plmbr/notebook-intelligence/blob/main/src/chat-sidebar.tsx"
click node_frontend_api "https://github.com/plmbr/notebook-intelligence/blob/main/src/api.ts"
click node_settings "https://github.com/plmbr/notebook-intelligence/blob/main/src/components/settings-panel.tsx"
click node_tour "https://github.com/plmbr/notebook-intelligence/blob/main/src/tour/tour-steps.ts"
click node_chatbook_ui "https://github.com/plmbr/notebook-intelligence/blob/main/src/chatbook.ts"
click node_server_api "https://github.com/plmbr/notebook-intelligence/blob/main/notebook_intelligence/api.py"
click node_service_manager "https://github.com/plmbr/notebook-intelligence/blob/main/notebook_intelligence/ai_service_manager.py"
click node_providers "https://github.com/plmbr/notebook-intelligence/tree/main/notebook_intelligence/llm_providers"
click node_inline "https://github.com/plmbr/notebook-intelligence/blob/main/notebook_intelligence/inline_completion.py"
click node_chat_participant "https://github.com/plmbr/notebook-intelligence/blob/main/notebook_intelligence/base_chat_participant.py"
click node_chat_kernel "https://github.com/plmbr/notebook-intelligence/blob/main/notebook_intelligence/chatbook_kernel/kernel.py"
click node_claude "https://github.com/plmbr/notebook-intelligence/blob/main/notebook_intelligence/claude.py"
click node_acp "https://github.com/plmbr/notebook-intelligence/blob/main/notebook_intelligence/acp_agent.py"
click node_mcp "https://github.com/plmbr/notebook-intelligence/blob/main/notebook_intelligence/mcp_manager.py"
click node_rules "https://github.com/plmbr/notebook-intelligence/blob/main/notebook_intelligence/rule_manager.py"
click node_skills "https://github.com/plmbr/notebook-intelligence/blob/main/notebook_intelligence/skill_manager.py"
click node_plugins "https://github.com/plmbr/notebook-intelligence/blob/main/notebook_intelligence/plugin_manager.py"
click node_config "https://github.com/plmbr/notebook-intelligence/blob/main/notebook_intelligence/config.py"
click node_performance "https://github.com/plmbr/notebook-intelligence/blob/main/notebook_intelligence/perf.py"
click node_translations "https://github.com/plmbr/notebook-intelligence/blob/main/notebook_intelligence/i18n.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_extension,node_chat,node_frontend_api,node_settings,node_tour,node_chatbook_ui,node_user toneBlue
class node_server_api,node_service_manager,node_providers,node_inline,node_chat_participant,node_chat_kernel toneAmber
class node_claude,node_acp,node_mcp,node_rules,node_skills,node_plugins toneMint
class node_config,node_performance,node_translations toneRose
```

## Components

### JupyterLab experience

- [Lab extension](https://github.com/plmbr/notebook-intelligence/blob/main/src/index.ts): `src/index.ts`
- [Chat interface](https://github.com/plmbr/notebook-intelligence/blob/main/src/chat-sidebar.tsx): `src/chat-sidebar.tsx`
- [Frontend API](https://github.com/plmbr/notebook-intelligence/blob/main/src/api.ts): `src/api.ts`
- [Settings panels](https://github.com/plmbr/notebook-intelligence/blob/main/src/components/settings-panel.tsx): `src/components/settings-panel.tsx`
- [First-run tour](https://github.com/plmbr/notebook-intelligence/blob/main/src/tour/tour-steps.ts): `src/tour/tour-steps.ts`
- [Chatbook tools](https://github.com/plmbr/notebook-intelligence/blob/main/src/chatbook.ts): `src/chatbook.ts`

### Assistant services

- [Server API](https://github.com/plmbr/notebook-intelligence/blob/main/notebook_intelligence/api.py): `notebook_intelligence/api.py`
- [AI service manager](https://github.com/plmbr/notebook-intelligence/blob/main/notebook_intelligence/ai_service_manager.py): `notebook_intelligence/ai_service_manager.py`
- [LLM providers](https://github.com/plmbr/notebook-intelligence/tree/main/notebook_intelligence/llm_providers): `notebook_intelligence/llm_providers`
- [Inline completion](https://github.com/plmbr/notebook-intelligence/blob/main/notebook_intelligence/inline_completion.py): `notebook_intelligence/inline_completion.py`
- [Chat participants](https://github.com/plmbr/notebook-intelligence/blob/main/notebook_intelligence/base_chat_participant.py): `notebook_intelligence/base_chat_participant.py`
- [Chatbook kernel](https://github.com/plmbr/notebook-intelligence/blob/main/notebook_intelligence/chatbook_kernel/kernel.py): `notebook_intelligence/chatbook_kernel/kernel.py`

### Agents and tools

- [Claude agent](https://github.com/plmbr/notebook-intelligence/blob/main/notebook_intelligence/claude.py): `notebook_intelligence/claude.py`
- [ACP agent](https://github.com/plmbr/notebook-intelligence/blob/main/notebook_intelligence/acp_agent.py): `notebook_intelligence/acp_agent.py`
- [MCP tools](https://github.com/plmbr/notebook-intelligence/blob/main/notebook_intelligence/mcp_manager.py): `notebook_intelligence/mcp_manager.py`
- [Rulesets](https://github.com/plmbr/notebook-intelligence/blob/main/notebook_intelligence/rule_manager.py): `notebook_intelligence/rule_manager.py`
- [Claude skills](https://github.com/plmbr/notebook-intelligence/blob/main/notebook_intelligence/skill_manager.py): `notebook_intelligence/skill_manager.py`
- [Claude plugins](https://github.com/plmbr/notebook-intelligence/blob/main/notebook_intelligence/plugin_manager.py): `notebook_intelligence/plugin_manager.py`

### Configuration and operations

- [Configuration](https://github.com/plmbr/notebook-intelligence/blob/main/notebook_intelligence/config.py): `notebook_intelligence/config.py`
- [Performance diagnostics](https://github.com/plmbr/notebook-intelligence/blob/main/notebook_intelligence/perf.py): `notebook_intelligence/perf.py`
- [Translations](https://github.com/plmbr/notebook-intelligence/blob/main/notebook_intelligence/i18n.py): `notebook_intelligence/i18n.py`

### Other components

- **Notebook user**

## Connections

- Notebook user → Chat interface: sends requests (evidence: `README.md`)
- Lab extension → Chat interface: registers panel (evidence: `src/index.ts`)
- Lab extension → Frontend API: initializes (evidence: `src/index.ts`)
- Lab extension → First-run tour: dispatches tour (evidence: `src/index.ts`)
- Chat interface → Frontend API: uses API
- Settings panels → Frontend API: configures features (evidence: `src/components/settings-panel.tsx`)
- Frontend API → Server API: sends requests
- Server API → AI service manager: uses services (evidence: `notebook_intelligence/api.py`)
- AI service manager → LLM providers: selects models (evidence: `notebook_intelligence/ai_service_manager.py`)
- AI service manager → Claude agent: selects agent mode (evidence: `notebook_intelligence/ai_service_manager.py`)
- AI service manager → ACP agent: selects agent mode (evidence: `notebook_intelligence/ai_service_manager.py`)
- Chat participants → Server API: uses chat contracts (evidence: `notebook_intelligence/base_chat_participant.py`)
- Chat participants → Rulesets: injects rules (evidence: `notebook_intelligence/base_chat_participant.py`)
- Chat participants → MCP tools: uses toolsets (evidence: `notebook_intelligence/mcp_manager.py`)
- Claude agent → MCP tools: uses servers
- Claude agent → Claude skills: invokes skills
- Claude agent → Claude plugins: supports plugins
- Frontend API → Chatbook kernel: requests execution
- Lab extension → Chatbook tools: summarizes cells (evidence: `src/index.ts`)
- AI service manager → Inline completion: selects completion model
- Server API → Configuration: reads settings (evidence: `notebook_intelligence/api.py`)
- AI service manager → Performance diagnostics: uses diagnostics (evidence: `notebook_intelligence/ai_service_manager.py`)
- Server API → Translations: uses translations (evidence: `notebook_intelligence/api.py`)
- Frontend API → Translations: formats interface (evidence: `src/api.ts`)
