← Back to Pull requests

[ZEPPELIN-6733] Add AI assistant chat to notebooks (server-side) #5547

Closed
unknown closed this pull request without merging on Oct 11, 2026 11:11 UTC
View on GitHub
unknown unknown commented on Oct 05, 2026 17:08 UTC
Author

What is this PR for?


This PR adds the server-side implementation of an AI assistant for notebooks.

Motivation


AI can help with coding and data analysis, but using it with Zeppelin requires users to move code and results between the notebook and a separate chat. A built-in assistant can reduce this effort. It can also make notebook operations and other tasks easier through tools.

Decisions


Model adaptor
  • The assistant currently supports OpenAI models.

  • It uses the official OpenAI Java SDK to keep up with API changes.
  • Data structure

    Notebook 1 ── N Conversation
    Conversation 1 ── N Message
    Message (assistant) 1 ── N ToolCall
    

    File path
    $ZEPPELIN_HOME/assistant/<noteId>/<conversationId>.json

    Permissions

  • Anyone who can read a notebook can read its conversations.

  • Only the user who created a conversation can mutate it.
  • See the proposal for more details.

    Direction


  • The assistant is disabled by default and can be enabled through zeppelin.notebook.assistant.enable. Enabling it by default is planned once the feature is stable.

  • The initial tool, list_paragraphs, just returns paragraph metadata. More tools are needed to make the assistant more capable. Contributions are welcome.
  • What type of PR is it?


    Feature

    What is the Jira issue?


    https://issues.apache.org/jira/browse/ZEPPELIN-6733

    How should this be tested?


  • Run the assistant unit tests

  • ./mvnw test -pl zeppelin-server \
      -Dtest='org.apache.zeppelin.service.assistant.*Test'
    

  • Verify conversation management and message history through the REST APIs

  • Verify streaming responses and tool calls through WebSocket
  • Questions:


    Does the license files need to update? Y
    Is there breaking changes for older versions? N
    Does this needs documentation? Y

    Diff: 238 lines (+178 / -60) across 2 files Reviewer: tbonelee Review duration: 8283m
    All Vouch review confidence checks passed
    Residual risk 0.17 = Change Risk (0.42) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.42 · 238 lines diff across 2 files
    0.42
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.328
    Shallow Review Depth shallow_review_depth
    0.289
    Ai Authored ai_authored
    0.050
    Real PR Conversation Timeline
    1 comments
    "Review active on #5547"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 42.2% (MEDIUM) · Higher = larger blast radius
    42.2%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 16.7% · Safe to merge
    16.7%