@@ -45,34 +45,36 @@ and configure its templated connection settings:
45
45
46
46
## Running the App
47
47
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
+
48
52
There are two ways to run the app: via Docker or locally. Docker is advised for
49
53
ease while locally is advised if you are making changes to the application.
50
54
51
55
### Run with docker
52
56
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.
56
59
57
60
** Double-check you have a ` .env ` file with all your variables set first!**
58
61
59
62
``` bash
60
63
docker compose up --pull always --force-recreate
61
64
```
62
65
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.
65
67
66
68
Clean up when finished, like this:
67
69
68
70
``` bash
69
71
docker compose down
70
72
```
71
73
72
- ### Run locally
74
+ ### Run with Python
73
75
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
76
78
production mode as used in Docker to avoid problems in debug mode.
77
79
78
80
** Double-check you have a ` .env ` file with all your variables set first!**
@@ -89,7 +91,7 @@ nvm use --lts
89
91
(cd frontend; yarn install; REACT_APP_API_HOST=/api yarn build)
90
92
```
91
93
92
- #### Configure your python environment
94
+ #### Configure your Python environment
93
95
94
96
Before we can run the app, we need a working Python environment with the
95
97
correct packages installed:
@@ -102,17 +104,16 @@ pip install "python-dotenv[cli]"
102
104
pip install -r requirements.txt
103
105
```
104
106
105
- #### Run the ingest command
107
+ #### Create your Elasticsearch index
106
108
107
109
First, ingest the data into elasticsearch:
108
110
``` bash
109
- FLASK_APP=api/app.py dotenv run -- flask create-index
111
+ dotenv run -- flask create-index
110
112
```
111
113
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
114
115
115
- #### Run the app
116
+ #### Run the application
116
117
117
118
Now, run the app, which listens on http://localhost:4000
118
119
``` bash
@@ -185,10 +186,10 @@ passages. Modify this script to index your own data.
185
186
186
187
See [ Langchain documentation] [ loader-docs ] for more ways to load documents.
187
188
188
- ### Building from source with docker
189
+ ### Running from source with Docker
189
190
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 `
192
193
193
194
``` bash
194
195
docker compose up --build --force-recreate
0 commit comments