- 
          
 - 
                Notifications
    
You must be signed in to change notification settings  - Fork 3.7k
 
          HHH-19880 Move Hibernate Tools' hibernate-assistant module to Hibernate ORM
          #11156
        
          New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
a2b92a1    to
    b6b6d0e      
    Compare
  
    There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! A few comments below.
As long as everything is clearly marked as incubating I think it's all fine, but mostly we'll need the ack from Steve regarding the inclusion/publishing of a new module.
        
          
                documentation/src/main/asciidoc/userguide/chapters/assistant/Assistant.adoc
          
            Show resolved
            Hide resolved
        
              
          
                documentation/src/main/asciidoc/userguide/chapters/assistant/Assistant.adoc
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                documentation/src/main/asciidoc/userguide/chapters/assistant/Assistant.adoc
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                documentation/src/main/asciidoc/userguide/chapters/assistant/Assistant.adoc
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                documentation/src/main/asciidoc/userguide/chapters/assistant/Assistant.adoc
              
                Outdated
          
            Show resolved
            Hide resolved
        
      | - Access to data is *constrained to the mapped domain model*. The only tables the LLM will be able to access are the ones that have a corresponding entity class, and only columns listed as fields in your objects can be read. Furthermore, custom filters and SQL restrictions can be applied to further restrict the scope of the data exposed through these tools. You don’t have to worry about creating custom database-level users or permissions only to ensure sensitive information is not exposed to AI services; | ||
| - Natively maps results to *Java objects* for direct application consumption, but can also be serialized and passed back to the model to obtain an *informed natural language response based on your existing data*; | ||
| - Hibernate’s query language parsing can identify the *type of query* being executed and prevent accidental data modifications when the user only meant to read data; | ||
| - *Fail-early* in case generative AI produces incorrect statements. Thanks to Hibernate’s advanced query validation and type-safety features, we don’t need to make a round-trip to the database before noticing a problem, increasing both reliability and overall performance. It’s also easy to understand what the problem with the generated query is thanks to clear error messages, and attempt to solve it either manually or with subsequent prompts; | ||
| - With HQL it’s easier to write more *complex queries* involving multiple entities (i.e. tables) thanks to associations, embeddable values and inheritance. LLMs have an easier time generating valid queries that provide useful information to the user when compared to plain SQL, since Hibernate's query language is closer to natural language. | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's fine to list features, to say what this think can help you with, and how it does so.
But I wouldn't try to make claims about safety or to compare ease of use with other solutions. That would belong in a blog post IMO.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, I didn't know what to add here apart from possible use-cases / advantages of using this module, so that's what I did. If we want to keep this brief, just for reference, we can definitely remove this whole paragraph.
b6b6d0e    to
    b993588      
    Compare
  
    b993588    to
    9ddcf11      
    Compare
  
    There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found two incorrect heading levels, but otherwise LGTM. Let's ask Steve on Monday?
| No implementation is included, but the above provides the building blocks for integration with generative AI services/APIs. | ||
| 
               | 
          ||
| [[assistant-gen-ai]] | ||
| ==== Generative AI integration considerations | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Incorrect heading level
| ==== Generative AI integration considerations | |
| === Generative AI integration considerations | 
| 
               | 
          ||
| 
               | 
          ||
| [[assistant-serialization]] | ||
| ==== Serialization Components | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Incorrect heading level
| ==== Serialization Components | |
| === Serialization Components | 
https://hibernate.atlassian.net/browse/HHH-19880
Opening as draft, TBD:
tooling/assistantfor now)hibernate-tools-language)By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license
and can be relicensed under the terms of the LGPL v2.1 license in the future at the maintainers' discretion.
For more information on licensing, please check here.