[PLUGIN] - AI BOT + Groq/Gemini Inference

RAG + Bubble Setup

(version 1.99.0)

Keeping the forum/notes/documentation all up to date, this update provides the ability to upload and retrieve vectors from your Bubble database and use it as part of a RAG setup.

Full setup instructions: https://paul-testing.bubbleapps.io/version-test/ai_agent_instructions?tab=7

Previously, and thee most commonly used for doing this type of thing, was to use Pinecone. Now we can store all this data in a dedicated table directly in your own database where the agent can connect to whenever it needs to source data. You end up with a table that looks something like this:

This setup cannot be done on Bubble’s free plan though, because it utilises the Data API and requires an API token to be configured within your app settings.

There’s a whole new section dedicated for setting up the required database options, this replaces the previous Pinecone configuration (which is still available).

How it works (in a nutshell)

The action called Train AI Agent is responsible for the initial upload. You can upload single/list text values or single/list of PDF files.

After the upload has been completed, both the Enable RAG integration and External Database Options need to be set.

When the agent requests any data, it does so using the Data API root URL.
This URL and the API token need to be stored in the tokenAuth page. These values are encrypted and decrypted through the plugin (as are all other keys stored).

The plugin now uses the same cosine similarity calculations that are typical for returning embeddings closest to the input it receives.

Regards,
Paul

1 Like

This is kind of incredible that this can be done on Bubble. Thanks for the addition. Will be switching current rag to this today. should save quite a few bucks.

1 Like

Thanks @Timbo ! appreciate that

Took some effort but hopefully worth the trouble

Paul

1 Like