Retrieval Augmented Generation in the Browser
Happy to announce RAG in the browser using EazyRAG
If you have implemented Retrieval Augmented Generation (RAG) or RAG-based chatbots, whether using Langchain or not, you have experienced the challenges of implementing everything from retrieval and context formation to streaming the response back to the client side.
That's what we are trying to solve with EazyRAG. We have the entire RAG pipeline implemented, and you can use it with a simple API call. What's even better is that we also support grounded answer generation from the browser. Here is a demo where I indexed the entire Bun Docs on EazyRAG, which is making RAG requests from the browser.
Here is a sample code.
Index your content from the server side.
curl --location 'https://api.eazyrag.com/v1/add' \
--header 'Authorization: sk-<Your server key>' \
--header 'Content-Type: application/json' \
--data '{
"contents": [
{
"content":"You entire document or chunk of content",
"title":"Document title (Optional)"
}
],
"collection": "sample"
}'
Once you have indexed your content, it's just a dead-simple way to generate grounded answers with a simple API call from your browser.
const fetchResponse = async (question: string) => {
try {
const response = await axios.get("https://api.eazyrag.com/v1/answer", {
params: {
query: question,
collection: "sample",
},
headers: {
Authorization:
"ck-<Your client key>",
},
});
// Grounded answer generation
console.log(response.data);
} catch (error) {
console.error("Error fetching data:", error);
}
};
We also support streams, and you can use EventSource to implement an API with streams on the browser side.
Our longer-term vision (if we survive) is to build a dead-simple API on top of LLM, where even someone who is just getting started with coding can create powerful LLM agents without needing to understand the underlying concepts.
If you have any questions or feedback, don't hesitate to click on the chat icon.