@@ -45,34 +45,36 @@ and configure its templated connection settings:
4545
4646## Running the App
4747
48+ This application contains two services:
49+ * create-index: Installs ELSER and ingests data into elasticsearch
50+ * api-frontend: Hosts the chatbot-rag-app application on http://localhost:4000
51+
4852There are two ways to run the app: via Docker or locally. Docker is advised for
4953ease while locally is advised if you are making changes to the application.
5054
5155### Run with docker
5256
53- Docker compose is the easiest way, as you get one-step to:
54- * ingest data into elasticsearch
55- * run the app, which listens on http://localhost:4000
57+ Docker compose is the easiest way to get started, as you don't need to have a
58+ working Python environment.
5659
5760** Double-check you have a ` .env ` file with all your variables set first!**
5861
5962``` bash
6063docker compose up --pull always --force-recreate
6164```
6265
63- * Note* : First time creating the index can fail on timeout. Wait a few minutes
64- and retry.
66+ * Note* : The first run may take several minutes to become available.
6567
6668Clean up when finished, like this:
6769
6870``` bash
6971docker compose down
7072```
7173
72- ### Run locally
74+ ### Run with Python
7375
74- If you want to run this example with Python and Node.js , you need to do a few
75- things listed in the [ Dockerfile] ( Dockerfile ) . The below uses the same
76+ If you want to run this example with Python, you need to do a few things listed
77+ in the [ Dockerfile] ( Dockerfile ) to build it first . The below uses the same
7678production mode as used in Docker to avoid problems in debug mode.
7779
7880** Double-check you have a ` .env ` file with all your variables set first!**
@@ -89,7 +91,7 @@ nvm use --lts
8991(cd frontend; yarn install; REACT_APP_API_HOST=/api yarn build)
9092```
9193
92- #### Configure your python environment
94+ #### Configure your Python environment
9395
9496Before we can run the app, we need a working Python environment with the
9597correct packages installed:
@@ -102,17 +104,16 @@ pip install "python-dotenv[cli]"
102104pip install -r requirements.txt
103105```
104106
105- #### Run the ingest command
107+ #### Create your Elasticsearch index
106108
107109First, ingest the data into elasticsearch:
108110``` bash
109- FLASK_APP=api/app.py dotenv run -- flask create-index
111+ dotenv run -- flask create-index
110112```
111113
112- * Note* : First time creating the index can fail on timeout. Wait a few minutes
113- and retry.
114+ * Note* : This may take several minutes to complete
114115
115- #### Run the app
116+ #### Run the application
116117
117118Now, run the app, which listens on http://localhost:4000
118119``` bash
@@ -185,10 +186,10 @@ passages. Modify this script to index your own data.
185186
186187See [ Langchain documentation] [ loader-docs ] for more ways to load documents.
187188
188- ### Building from source with docker
189+ ### Running from source with Docker
189190
190- To build the app from source instead of using published images, pass the ` --build `
191- flag to Docker Compose.
191+ To build the app from source instead of using published images, pass the
192+ ` --build ` flag to Docker Compose instead of ` --pull always `
192193
193194``` bash
194195docker compose up --build --force-recreate
0 commit comments