Skip to content

Conversation

mbellade
Copy link
Member

Fixes #49144

This PR provides a re-design of the Hibernate ORM query console (Dev UI interface that allows querying the underlying datasources through Hibernate's query language), taking advantage of the functionality introduced in the new hibernate-tools-language module.

The changes are:

  • re-designed the console to a "chat-like" interface that preserves the history of the executed queries
  • improved the query results serialization, that now handles lazy and circular associations correctly
  • introduced new AI features, based on @phillip-kruger's work and the new Assistant interface, like LLM-assisted query execution and also data interpretation via the interactive mode

Here's a small demo of the new interface:

Screen.Recording.2025-07-30.at.11.43.36.mp4

@quarkus-bot quarkus-bot bot added the area/dependencies Pull requests that update a dependency file label Jul 30, 2025
Copy link

quarkus-bot bot commented Jul 30, 2025

/cc @gsmet (hibernate-orm)

@mbellade mbellade requested a review from yrodiere July 30, 2025 10:03

This comment has been minimized.

Copy link

github-actions bot commented Jul 30, 2025

🎊 PR Preview b44215d has been successfully built and deployed to https://quarkus-pr-main-49165-preview.surge.sh/version/main/guides/

  • Images of blog posts older than 3 months are not available.
  • Newsletters older than 3 months are not available.

@phillip-kruger
Copy link
Member

This is very cool !!! I love it !

Copy link
Member

@phillip-kruger phillip-kruger left a comment

Choose a reason for hiding this comment

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

I really like this, I also like the new layout. Just one minor thing, when you create pages that is a mix of assistant and non assistant, you don't need to create an assistant Page, your JsonRPC services will use the assistant (as you do already) and in your existing web component page you can use the assistant state to see if there is an configured assistant available, and use that to decide how / what to show on your page.

Copy link
Member

@gsmet gsmet left a comment

Choose a reason for hiding this comment

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

I have one small question: do we persist the history of all these nice features?

Because I could see the value of being able to restart the app later and have the history around.

Maybe even the ability to export the history of the interactions for a coworker. Or save a specific session?

Not sure it's something I would handle feature by feature but I was wondering if it was something you had in mind @phillip-kruger?

Now, what I'm unsure of is that I suppose you push all the chat as a context?

Copy link
Member

@gsmet gsmet left a comment

Choose a reason for hiding this comment

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

I spotted something that is IMO blocking.

Now we could merge this if I'm sure we fix the issue by Aug 12th.

Comment on lines 68 to 71
<dependency>
<groupId>org.hibernate.tool</groupId>
<artifactId>hibernate-tools-language</artifactId>
</dependency>
Copy link
Member

Choose a reason for hiding this comment

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

Noooooooooooooooooooooooo :).

We definitely don't want this dependency at runtime.

Maybe it's time to split this into a runtime-dev module? /cc @phillip-kruger

Copy link
Member

@phillip-kruger phillip-kruger Jul 30, 2025

Choose a reason for hiding this comment

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

As far as I remember there was an issue with the hibernate extension with this.
@aloubyansky might know the details. Another option could be to use BuildTimeActions ? Is there a reason why this can not happen in the deployment class path ?

Copy link
Member Author

Choose a reason for hiding this comment

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

Would marking the dependency as optional be a valid temporary workaround, while we figure out how to split the dev components to their own module? We already depend on e.g. quarkus-devui optionally in the runtime module, so that seems like it could be fine for now.

Copy link
Member

Choose a reason for hiding this comment

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

If you make it optional, it won't be there.

IF we can't make these parts a runtime-dev module (I would need to discuss with @aloubyansky), maybe we could have the dependency as optional in the runtime module and have a runtime-dev empty module with just this dependency? But I have no idea what the initial problem was so...

Copy link
Member

Choose a reason for hiding this comment

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

Right, the hibernate-orm extension was excluded from the initial runtime-dev introducing change due our Gradle plugin not being able to properly handle dependency exclusions. Our CI should catch that if it breaks.
The good news is we may be able to lift this limitation soon, I have a branch that should fix it.

Copy link
Member

Choose a reason for hiding this comment

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

Hm, that doesn't seem to be complete. But it was supposed to be.

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

I couldn't merge those because they were breaking Gradle IT. We may just try rebasing them now.

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks, I've created #49399 on top of those commits

Copy link
Member Author

Choose a reason for hiding this comment

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

Now that we have a runtime-dev module I moved new the dependency there

@mbellade mbellade force-pushed the console-assistant branch 2 times, most recently from d734501 to b8d92f4 Compare July 30, 2025 11:34
@mbellade
Copy link
Member Author

I have one small question: do we persist the history of all these nice features?

Not at the moment, no. Though Hibernate could always help with persistence related aspects :)

Now, what I'm unsure of is that I suppose you push all the chat as a context?

Not at the moment, no. Each message is a separate interaction with the DB and/or the Assistant. If we wanted, we could technically preserve the whole chat in-memory, pass it as a single String to io.quarkus.assistant.runtime.dev.Assistant.AssistBuilder#userMessage, and perhaps it could work - though we could run into memory concerns relatively soon.

I wanted to mention this to @phillip-kruger, as it would be very nice to have something like langchain4j's ChatMemory that can be paired with the Assistant to handle context management aspects (e.g. size and persistence of messages). I have already worked on some experiments that use that, so I'd be glad to help if needed.

@phillip-kruger
Copy link
Member

phillip-kruger commented Jul 30, 2025

Yes that is a feature we need to add the Chappie or the Chappie extension. I'll have a look a.s.a.p

This comment has been minimized.

@mbellade mbellade force-pushed the console-assistant branch from b8d92f4 to 9508915 Compare July 30, 2025 12:38

This comment has been minimized.

This comment has been minimized.

Copy link
Member

@phillip-kruger phillip-kruger left a comment

Choose a reason for hiding this comment

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

Approved from a Dev UI and Assistant p.o.v. Please wait for others approval before merging.

@phillip-kruger
Copy link
Member

@gsmet - noteworthy label ?

@mbellade mbellade force-pushed the console-assistant branch from 9508915 to 0888714 Compare July 31, 2025 07:39
Copy link
Member

@phillip-kruger phillip-kruger left a comment

Choose a reason for hiding this comment

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

OK, all good from the UI and assistant p.o.w, please get a approve from others too before merging

This comment has been minimized.

This comment has been minimized.

Copy link
Member

@yrodiere yrodiere left a comment

Choose a reason for hiding this comment

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

Thanks. Looks awesome!

I unfortunately could test myself because of trouble configuring Chappie, but I left a comment for Philip about that. I'll try again another time :)

More info below.

Comment on lines 153 to 155
if (a == null || !a.isAvailable()) {
return errorDataSet(
"The assistant is not available, please check the Quarkus assistant extension is correctly configured.");
Copy link
Member

Choose a reason for hiding this comment

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

@phillip-kruger any way we could provide more info? I tried using this with ollama, and as someone completely unfamiliar, this was... difficult. I had zero information, and was unable to determine at which level my configuration was incorrect. Was the host not resolvable? The port not responding? The REST API returning an error? No feedback, so no idea.

It's beyond the scope of this PR, but I would suggest:

  1. A connection check in the "Configuration" page in the dev UI, with an error message if the assistant cannot be reached, ideally with specific info (exception or error response).
  2. A way for extensions to provide the same info when isAvailable() returns false (like here). Maybe a checkAvailable() that would throw an exception with more details?

@yrodiere
Copy link
Member

Oh, and about approvals: I'm fine with merging once we solve the runtime dependency issue (in any way you like): #49165 (comment)

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

@gsmet
Copy link
Member

gsmet commented Aug 7, 2025

@mbellade I let you rebase this one and ping me loudly when done. Thanks!

@mbellade mbellade force-pushed the console-assistant branch from 5c095f4 to 0ee2d35 Compare August 8, 2025 07:47
@quarkus-bot quarkus-bot bot added the area/infra-automation anything related to CI, bots, etc. that are used to automated our infrastructure label Aug 8, 2025
@mbellade
Copy link
Member Author

mbellade commented Aug 8, 2025

@gsmet done!

This comment has been minimized.

This comment has been minimized.

@mbellade mbellade force-pushed the console-assistant branch from 0ee2d35 to 8da83eb Compare August 8, 2025 12:14

This comment has been minimized.

This comment has been minimized.

@gsmet gsmet force-pushed the console-assistant branch from 8da83eb to 5237c4a Compare August 9, 2025 09:23
@gsmet
Copy link
Member

gsmet commented Aug 9, 2025

I just pushed a rebase to use the final versions.

Copy link

quarkus-bot bot commented Aug 9, 2025

Status for workflow Quarkus Documentation CI

This is the status report for running Quarkus Documentation CI on commit 5237c4a.

✅ The latest workflow run for the pull request has completed successfully.

It should be safe to merge provided you have a look at the other checks in the summary.

Warning

There are other workflow runs running, you probably need to wait for their status before merging.

Copy link

quarkus-bot bot commented Aug 9, 2025

Status for workflow Quarkus CI

This is the status report for running Quarkus CI on commit 5237c4a.

✅ The latest workflow run for the pull request has completed successfully.

It should be safe to merge provided you have a look at the other checks in the summary.

You can consult the Develocity build scans.

@gsmet gsmet merged commit a04eb95 into quarkusio:main Aug 11, 2025
60 checks passed
@quarkus-bot quarkus-bot bot added this to the 3.26 - main milestone Aug 11, 2025
@quarkus-bot quarkus-bot bot added the kind/enhancement New feature or request label Aug 11, 2025
@gsmet
Copy link
Member

gsmet commented Aug 11, 2025

Thanks a lot!

ia3andy pushed a commit to ia3andy/quarkus that referenced this pull request Aug 11, 2025
DevUI HQL console redesign + Hibernate Assistant functionality
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/dependencies Pull requests that update a dependency file area/dev-ui area/hibernate-orm Hibernate ORM area/infra-automation anything related to CI, bots, etc. that are used to automated our infrastructure kind/enhancement New feature or request release/noteworthy-feature triage/flaky-test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Hibernate ORM Dev UI - Assistant functionalities for natural language interactions

5 participants