diff --git a/docs/docs/guides/rag-with-astradb.mdx b/docs/docs/guides/rag-with-astradb.mdx
index 226bc6d17..310f9ea70 100644
--- a/docs/docs/guides/rag-with-astradb.mdx
+++ b/docs/docs/guides/rag-with-astradb.mdx
@@ -13,7 +13,8 @@ AstraDB is a cloud-native database built on Apache Cassandra that is optimized f
In this guide, we will use AstraDB as a vector store to store and retrieve the documents that will be used by the RAG application to generate responses.
-This guide assumes that you have Langflow up and running. If you are new to Langflow, you can check out the [Getting Started](/) guide.
+ This guide assumes that you have Langflow up and running. If you are new to
+ Langflow, you can check out the [Getting Started](/) guide.
TLDR;
@@ -21,12 +22,15 @@ TLDR;
- Visit the [Astra](https://astra.datastax.com) website and create a free account
- Duplicate our [Langflow 1.0 Space](https://huggingface.co/spaces/Logspace/Langflow-Preview?duplicate=true)
- Create a new database, get a **Token** and the **API Endpoint**
--
+-
- Import the project into Langflow by dropping it on the Canvas or My Collection page
- Update the **Token** and **API Endpoint** in the **AstraDB** components
- Update the OpenAI API key in the **OpenAI** components
- Run the ingestion flow which is the one that uses the **AstraDB** component
-- Click on the ⚡ *Run* button and start interacting with your RAG application
+- Click on the ⚡ _Run_ button and start interacting with your RAG application
# First things first
@@ -45,14 +49,10 @@ Once you have created an account, you will be taken to the AstraDB dashboard. Cl
style={{ width: "80%" }}
/>
-
-
Now you will need to configure your database. Choose the **Serverless (Vector)** deployment type, and pick a Database name, provider and region.
After you have configured your database, click on the **Create Database** button.
-
-
-
-Once your database is initialized, to the right of the page, you will see the *Database Details* section which contains a button for you to copy the **API Endpoint** and another to generate a **Token**.
-
+Once your database is initialized, to the right of the page, you will see the _Database Details_ section which contains a button for you to copy the **API Endpoint** and another to generate a **Token**.
-
Now we are all set to start building our RAG application using AstraDB and Langflow.
## (Optional) Duplicate the Langflow 1.0 HuggingFace Space
@@ -97,14 +94,14 @@ Once you have downloaded the project file, you can import it into Langflow by dr
dark: "img/drag-and-drop-flow.png",
}}
style={{ width: "90%" }}
- />
-
+/>
This project consists of two flows. The simpler one is the **Ingestion Flow** which is responsible for ingesting the documents into the AstraDB database.
Your first step should be to understand what each flow does and how they interact with each other.
The ingestion flow consists of:
+
- **Files** component that uploads a text file to Langflow
- **Recursive Character Text Splitter** component that splits the text into smaller chunks
- **OpenAIEmbeddings** component that generates embeddings for the text chunks
@@ -117,7 +114,7 @@ The ingestion flow consists of:
dark: "img/astra-ingestion-flow.png",
}}
style={{ width: "90%" }}
- />
+/>
Now, let's update the **AstraDB** and **AstraDB Search** components with the **Token** and **API Endpoint** that we generated earlier, and the OpenAI Embeddings components with your OpenAI API key.
@@ -128,8 +125,7 @@ Now, let's update the **AstraDB** and **AstraDB Search** components with the **T
dark: "img/astra-ingestion-fields.png",
}}
style={{ width: "90%" }}
- />
-
+/>
And run it! This will ingest the Text data from your file into the AstraDB database.
@@ -140,17 +136,17 @@ And run it! This will ingest the Text data from your file into the AstraDB datab
dark: "img/astra-ingestion-run.png",
}}
style={{ width: "90%" }}
- />
-
+/>
Now, on to the **RAG Flow**. This flow is responsible for generating responses to your queries.
The RAG flow is a bit more complex. It consists of:
+
- **Chat Input** component that defines where to put the user input coming from the Interaction Panel
- **OpenAI Embeddings** component that generates embeddings from the user input
- **AstraDB Search** component that retrieves the most relevant Records from the AstraDB database
- **Text Output** component that turns the Records into Text by concatenating them and also displays it in the Interaction Panel
- - One interesting point you'll see here is that this component is named `Extracted Chunks`, and that is how it will appear in the Interaction Panel
+ - One interesting point you'll see here is that this component is named `Extracted Chunks`, and that is how it will appear in the Interaction Panel
- **Prompt** component that takes in the user input and the retrieved Records as text and builds a prompt for the OpenAI model
- **OpenAI** component that generates a response to the prompt
- **Chat Output** component that displays the response in the Interaction Panel
@@ -164,7 +160,7 @@ The RAG flow is a bit more complex. It consists of:
style={{ width: "90%" }}
/>
-To run it all we have to do is click on the ⚡ *Run* button and start interacting with your RAG application.
+To run it all we have to do is click on the ⚡ _Run_ button and start interacting with your RAG application.