daniel_js_craft, to webdev
@daniel_js_craft@mastodon.social avatar

Weekend discovery. An intermediate step in the RAG process is document chunking. Determining the appropriate chunk size can become a trial & error game. James Briggs does a great job of explaining how to use Semantic Chunking to get better results.

#webdev #llm #ai #rag

https://www.youtube.com/watch?v=TcRRfcbsApw

joe, to ai

Previously, we looked at how to build a retrieval-augmented generation system using LangChain. As of last month, you can do the same thing with just the Ollama Python Library that we used in last month’s How to Write a Python App that uses Ollama. In today’s post, I want to use the Ollama Python Library, Chroma DB, and the JSON API for Kopp’s Frozen Custard to embed the flavor of the day for today and tomorrow.Let’s start with a very basic embedding example.

In the above example, we start by building an array of things that we want to embed, embed them using nomic-embed-text and Chroma DB, and then use llama3:8b for the main model.

https://i0.wp.com/jws.news/wp-content/uploads/2024/05/Screenshot-2024-05-30-at-10.32.52%E2%80%AFPM.png?resize=1024%2C800&ssl=1

So, how do you get the live data for the flavors of the day? The API, of course!

This simple script gets the flavor of the day from a JSON API, builds an array of embedable strings, and prints the result.

https://i0.wp.com/jws.news/wp-content/uploads/2024/05/Screenshot-2024-05-30-at-10.44.23%E2%80%AFPM.png?resize=1024%2C800&ssl=1

The next step is to combine the two scripts.

Two big differences that you will notice between the other two examples and this one is that the date no longer contains the year and I added a statement of what today’s date is, so that you can ask for “Today’s flavors”.

https://i0.wp.com/jws.news/wp-content/uploads/2024/05/Screenshot-2024-05-30-at-10.56.59%E2%80%AFPM.png?resize=1024%2C800&ssl=1

If you have any questions on how this works, later on today I am hosting a live webinar on Crafting Intelligent Python Apps with Retrieval-Augmented Generation. Feel free to stop by and see how to build a RAG system.

https://jws.news/2024/how-to-get-ai-to-tell-you-the-flavor-of-the-day-at-kopps/

#AI #ChromaDB #llama3 #LLM #Ollama #Python #RAG

pamelafox, to python
@pamelafox@fosstodon.org avatar

My talk from VS Code Day is now live!

"Building a RAG-powered AI chat app with Python and VS Code"

I showed how to do RAG on a local PostgreSQL database, both with Ollama and OpenAI models.

https://www.youtube.com/watch?v=3ctFWU492xk

  • All
  • Subscribed
  • Moderated
  • Favorites
  • JUstTest
  • InstantRegret
  • mdbf
  • ethstaker
  • magazineikmin
  • cubers
  • rosin
  • thenastyranch
  • Youngstown
  • osvaldo12
  • slotface
  • khanakhh
  • kavyap
  • DreamBathrooms
  • provamag3
  • Durango
  • everett
  • tacticalgear
  • modclub
  • anitta
  • cisconetworking
  • tester
  • ngwrru68w68
  • GTA5RPClips
  • normalnudes
  • megavids
  • Leos
  • lostlight
  • All magazines