Spring AI With PostgreSQL pgvector: Building Generative AI Apps in Java

แชร์
ฝัง
  • เผยแพร่เมื่อ 9 ม.ค. 2025

ความคิดเห็น • 17

  • @mallikarjunmongolla4519
    @mallikarjunmongolla4519 10 หลายเดือนก่อน +2

    Thanks for this video very useful to get into Spring AI . world need spring AI

    • @DevMastersDb
      @DevMastersDb  10 หลายเดือนก่อน

      Excellent, thank you! I've shared your feedback with the Spring team ;)

  • @alimemon386
    @alimemon386 2 หลายเดือนก่อน

    Thank you man.... It's a great help

    • @DevMastersDb
      @DevMastersDb  2 หลายเดือนก่อน

      Glad it helped, my friend!

  • @rafastepniewski6135
    @rafastepniewski6135 7 หลายเดือนก่อน

    Great job done here. Thanks a lot for sharing this.

    • @DevMastersDb
      @DevMastersDb  7 หลายเดือนก่อน

      Many thanks!

  • @christianendres4650
    @christianendres4650 11 หลายเดือนก่อน +2

    Thanks for the video but you should revoke and change your OpenAI-API-key (if the one shown is valid) and only set it via environment variables in the future to prevent leakage in videos.

    • @DevMastersDb
      @DevMastersDb  11 หลายเดือนก่อน +3

      Sure, you're right. The key was deleted before the video was published.
      Overall, I take many shortcuts while recording videos to make a tutorial as short as possible. With this specific one, my hope/assumption was that Java devs know how to initialize sensitive/private parameters.
      Anyway, thanks for highlighting this here! It's a good reminder for everyone who will come across the video later. And here is the repo that shows how to initialize the key via an env variable.github.com/YugabyteDB-Samples/YugaPlus/blob/main/backend/src/main/resources/application.properties

  • @GSUGambit
    @GSUGambit 11 หลายเดือนก่อน +1

    Itd be nice if you had a tutorial that showed how to create the embeddings. That will be the situation most developers will be in. We have the data in postgres but we need to generate the embeddings based on data already in our database

    • @GSUGambit
      @GSUGambit 11 หลายเดือนก่อน +1

      At 10:21 you show aiClient.embed function. My assumption is we need to list the key value pairs of our Domain Objects into a string and call this function and that will give us the embeddings we should save in the database.

    • @DevMastersDb
      @DevMastersDb  11 หลายเดือนก่อน +2

      @@GSUGambit
      Good point. I should have shown how to generate embeddings for my original dataset.
      The process is follows. Assume that you have the "value" column of a text type in Postgres. And you want to do a vector similarity search against its content. Then, this is how you can generated embeddings (pseudo-code):
      1. Add a column that will store the embedding value (1536 is a dimenstion for OpenAi text-ada-2 model, you can set another value for another model):
      alter table myTable add column value_vector vector(1536).
      Repeat for every row in the table:
      1. select id, value from myTable;
      2. embedding = aiClient.embed(value);
      3. update myTable set value_vector = embedding where id = row.id
      Hope it makes things clear.

    • @GSUGambit
      @GSUGambit 11 หลายเดือนก่อน +1

      @DevMastersDb thank you I believe this is everything I need

    • @DevMastersDb
      @DevMastersDb  11 หลายเดือนก่อน

      Ping me if anything doesn’t work as expected. I’ll do my best to send you over a code snippet in Java if necessary

    • @DevMastersDb
      @DevMastersDb  10 หลายเดือนก่อน +2

      @@GSUGambit in case you still need it, this is a new video that shows how to generate embeddings with Spring AI: th-cam.com/video/F0FGcxkMElk/w-d-xo.html

  • @globehogger
    @globehogger 9 หลายเดือนก่อน

    What to learn as java full stack developer for AI future?? Do i need to learn python and completely switch fron java developer to python with AI

    • @DevMastersDb
      @DevMastersDb  9 หลายเดือนก่อน +1

      Python is still a better fit for those who need to create and train models. As for general purpose apps that use LLMs and other models, Java is a great choice. So, stick to Java unless you’re creating your own models. Study Spring AI, LangChain4j and other frameworks that are gonna evolve rapidly within the Java ecosystem.