Skip to content

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

Merged
voidmatcha merged 1 commit into
apache:masterfrom
seung-00:feature/notebook-assistant
Oct 11, 2026
Merged

voidmatcha merged 1 commit into
apache:masterfrom
seung-00:feature/notebook-assistant

Conversation

@seung-00

@seung-00 seung-00 commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

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?

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

@voidmatcha voidmatcha left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found two issues that appear to be causing the CI failures.

First, the transitive dependencies from openai-java conflict with existing dependency versions, causing Maven dependency convergence checks to fail. Second, ASSISTANT_SEND_MESSAGE and ASSISTANT_EVENT, which were added to the Java side, are missing from the TypeScript SDK, so the WebSocket contract check stops the E2E job before Playwright starts.

I prepared a reference implementation covering both issues:

voidmatcha@3f7c15d

With this approach, Maven dependency convergence, the WebSocket contract check, the SDK contract typecheck, and all 28 assistant-related server tests pass locally. Please feel free to use it as a reference.

@seung-00
seung-00 force-pushed the feature/notebook-assistant branch 7 times, most recently from f3ea6a5 to 749832f Compare October 7, 2026 03:51
@seung-00
seung-00 force-pushed the feature/notebook-assistant branch 3 times, most recently from d698333 to bab263f Compare October 10, 2026 08:28
return builder.build();
}

// TODO(seung-00) replace with pattern matching (Java 16+)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍


private final ExecutorService executorService = Executors.newFixedThreadPool(10);

private final ExecutorService assistantExecutor = new ThreadPoolExecutor(

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be better to locate it on AssistantService.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jongyoul Agreed, I’ve moved it.

jongyoul
jongyoul previously approved these changes Oct 10, 2026

@jongyoul jongyoul left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thank you for this complicated job. I left comments but all are not blockers to merge this PR. We could handle it with another PR.

@seung-00
seung-00 force-pushed the feature/notebook-assistant branch from 398cb79 to 5c2c52d Compare October 10, 2026 15:10
@voidmatcha
voidmatcha merged commit de1d7a9 into apache:master Oct 11, 2026
27 of 32 checks passed
@voidmatcha

Copy link
Copy Markdown
Member

Merged into master (de1d7a9).

tbonelee pushed a commit that referenced this pull request Oct 18, 2026
…T and WebSocket APIs

### What is this PR for?

Connect the Assistant frontend to the conversation REST and WebSocket APIs. The transport provides conversation creation and retrieval, message sending, and response delivery for the UI.

Server PR #5547, #5558, and UI contracts #5561 have merged. This PR is now based on master.

### What type of PR is it?

Feature

### Todos

* [x] Merge #5547
* [x] Merge #5558
* [x] Merge #5561 before this PR
* [x] Rebase onto master, retarget this PR to master, and rerun CI before merging
* [x] Compare against the final API contract from server PR #5547
* [x] Confirm CI on the current PR head

### What is the Jira issue?

ZEPPELIN-6742

### How should this be tested?

Run from `zeppelin-web-angular/`:

```bash
npm run build-project:sdk
npm run typecheck:react
npm --prefix projects/zeppelin-react test -- src/entities/assistant/model/assistantTransport.spec.ts
```

Also verify the REST and WebSocket integration against the final API contract from server PR #5547.

### Screenshots (if appropriate)

N/A

### Questions:

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


Closes #5563 from voidmatcha/voidmatcha/assistant-v2-6-transport.

Signed-off-by: ChanHo Lee <chanholee@apache.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants