Groq API + PineCone
# 🤝help
h
This is my setup. First the user asks the chatbot a question. I will first use the internal knowledge base. If the question isn’t found there, I want a fallback. But I will not want to use ChatGPT. I would want to use Groq. As the Groq API is the fastest available. But asking Groq directly is not the proper way to do it. In a video posted by Groq engineer Alec McLean, they used Pinecone vector search that they used as knowledge and together with the prompt was feeded to the Groq API. The result was fantastic. Accurate and super fast response. I want to therefore have Groq + Pinecone as my fallback. Two community geniuses has posted how to use Groq API here on Discord. But I want to also use Pinecone as RAG to make it better. I also want to add that I reached out got Groq developers and they gave me this https://github.com/groq/groq-api-cookbook/blob/main/presidential-speeches-rag/presidential-speeches-rag.ipynb I’m not a developer myself to understand it tho. Please help!
l
@helpful-lamp-68778 it's possible let me know what you want in detail I can help you dm me
h
Check out this short video:

https://www.youtube.com/watch?v=QE-JoCg98iU

. It showcases the advantages of using a vector search knowledge base like Pinecone (https://www.pinecone.io/). You can enhance this by sending user queries and vector search results to the Groq API for responses. To access the Groq API for free, get your API key here: https://console.groq.com/keys. Also, explore this tutorial for more insights: https://github.com/groq/groq-api-cookbook/blob/main/presidential-speeches-rag/presidential-speeches-rag.ipynb. @gentle-engine-13076 from our BotPress community has shared resources to integrate Groq API with BotPress, streamlining the process without starting from scratch. By enriching the search with knowledge, the answers become more accurate and reduce errors. ⁠botpress⁠Use Groq API, it's fast I simply want to call the Groq API + RAG as a fallback when I don't get a answer from the internal BotPress KB I know how to use ChatGPT as a fallback, following this guide

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

but ChatGPT is not as fast as Groq. It also cost money, while the Groq API is both faster and free to use. In a nutshell, I want Groq API + RAG.
@lemon-microphone-50324 I thought you are an official support tech. I don't wish to pay for it.
Anyone else that can help me with this?
a
Hi. I'm also looking for a solution like this: 1) I have my own data in a .csv format 2) Transform the .csv format into a vector database (either visual interface or python code) and upload to Pinecone. 3) Connect Pinecone with Groq API 4) Make an API call to Grop API from botpress with user's question so the LLM can search in my vector databse in Pinecone. I have connected botpress with Groq and LLama3. Only need to transform the .csv files into vector database and upload to Pinecone. Anyone have a tutorial or something that I could use? Thanks in advance!
h
For me, it doesn’t need to be CSV. I can manually upload the data to Pinecone. Just need the Groq API + Pinecone so the user query is sent to the Groq API together with the search vector for Pinecone to get better and more accurate answers, without hallucinations.
Anyone here to help?!
g
Hmmm... I haven't set up a RAG for Botpress before. I do know that you can use [Flowise](http://flowiseai.com) to perform the retrieval chain w/ Groq; then connect to Botpress (but it will require an external sever setup for Flowise). I only set this up on my localhost so I didn't connect it to Botpress, but it works locally (screenshots) If you wanna go this route, there's a tutorial on how to connect Botpress to Flowise (once your server is setup and your RAG chatflow is working as intended).

https://youtu.be/7p3foNlykJc

Snippet for Botpress Execute Code Card:
Copy code
const response = await axios.post ("https://yoursever.com/api/v420/blahblahblah/1234567890",
{question: workflow.question
},
{headers: { Authorization: "Bearer ***YourFlowise****APIKEY******" }});
workflow.apiResponse = await response.data;
All together in the pictured setup there will be costs: Embeddings, Vector DB, Server Costs. Eventually Groq will cost something... Don't know how fast it'll be using this setup, but my chatflow is pretty snappy on local. https://cdn.discordapp.com/attachments/1232790793073463398/1233258494384148571/Screenshot_2024-04-25_at_17.04.59.png?ex=662c70f9&is=662b1f79&hm=4976090a292cf15269213ce786c288af954e1c05ca5b6e64356f55c9d8ed47dd&
16 Views