Skip to content

Commit dbd948a

Browse files
authored
RAG Setup doc (#12)
This will merge after air-gapped environment doc PR #6 --------- Signed-off-by: irapandey <ira.pandey2001@gmail.com> Signed-off-by: irapandey <ira.pandey1@ibm.com>
1 parent f4c845c commit dbd948a

File tree

6 files changed

+96
-4
lines changed

6 files changed

+96
-4
lines changed
19.2 KB
Loading
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<mxfile host="app.diagrams.net" agent="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36" version="29.0.3">
3+
<diagram name="Page-1" id="GTjqSt33njzW1BgtH2ou">
4+
<mxGraphModel dx="1234" dy="794" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="827" pageHeight="1169" math="0" shadow="0">
5+
<root>
6+
<mxCell id="0" />
7+
<mxCell id="1" parent="0" />
8+
<mxCell id="LReqxBRhHcuHuTflv2wf-1" value="" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
9+
<mxGeometry x="157.5" y="40" width="285" height="525" as="geometry" />
10+
</mxCell>
11+
<mxCell id="eAVfCuhivxKZ8sc40tzS-3" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="eAVfCuhivxKZ8sc40tzS-1" target="eAVfCuhivxKZ8sc40tzS-2" edge="1">
12+
<mxGeometry relative="1" as="geometry" />
13+
</mxCell>
14+
<mxCell id="eAVfCuhivxKZ8sc40tzS-1" value="Pull AI-services binary" style="rounded=0;whiteSpace=wrap;html=1;fontSize=12;" parent="1" vertex="1">
15+
<mxGeometry x="240" y="80" width="120" height="60" as="geometry" />
16+
</mxCell>
17+
<mxCell id="eAVfCuhivxKZ8sc40tzS-5" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="eAVfCuhivxKZ8sc40tzS-2" target="eAVfCuhivxKZ8sc40tzS-4" edge="1">
18+
<mxGeometry relative="1" as="geometry" />
19+
</mxCell>
20+
<mxCell id="eAVfCuhivxKZ8sc40tzS-2" value="Create app with RAG template" style="whiteSpace=wrap;html=1;rounded=0;fontSize=12;" parent="1" vertex="1">
21+
<mxGeometry x="240" y="200" width="120" height="60" as="geometry" />
22+
</mxCell>
23+
<mxCell id="eAVfCuhivxKZ8sc40tzS-7" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="eAVfCuhivxKZ8sc40tzS-4" target="eAVfCuhivxKZ8sc40tzS-6" edge="1">
24+
<mxGeometry relative="1" as="geometry" />
25+
</mxCell>
26+
<mxCell id="eAVfCuhivxKZ8sc40tzS-4" value="Start document ingestion" style="whiteSpace=wrap;html=1;rounded=0;fontSize=12;" parent="1" vertex="1">
27+
<mxGeometry x="240" y="330" width="120" height="60" as="geometry" />
28+
</mxCell>
29+
<mxCell id="eAVfCuhivxKZ8sc40tzS-6" value="Access the chatbot" style="whiteSpace=wrap;html=1;rounded=0;fontSize=12;" parent="1" vertex="1">
30+
<mxGeometry x="240" y="460" width="120" height="60" as="geometry" />
31+
</mxCell>
32+
</root>
33+
</mxGraphModel>
34+
</diagram>
35+
</mxfile>

docs/chatbot.md

Lines changed: 0 additions & 3 deletions
This file was deleted.

docs/installation.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ Before you begin, confirm that all prerequisites are satisfied.
55

66
## Prerequisites
77

8+
- User should have root privileges
9+
810
- HMC-based access (UI and/or CLI)
911

1012
- Spyre cards are attached, discoverable, and ACTIVATED (x cards)

docs/rag-setup.md

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# Setting up RAG using AI-services
2+
3+
This section explains how to set up a RAG using the existing templates provided in AI-services.
4+
5+
![rag-setup](./assets/rag-tutorial.drawio.png)
6+
7+
##### Fig 1.0 - RAG Chatbot Setup
8+
9+
## Pull and Run the AI-services binary
10+
11+
To get started, follow the [installation guide](./installation.md) to pull and run the AI-services binary.
12+
13+
## Create an App Using the RAG Template
14+
15+
Initialize a new application using the built-in template - RAG. It generates all essential resources required to configure and run a complete RAG workflow.
16+
You can also specify UI port for the chatbot using the --params flag (for example: --params UI_PORT=3000). If not provided, the system automatically assigns a free port for the chatbot UI.
17+
18+
Provide a unique name for the application to ensure smooth deployment (replace with `<app-name>`).
19+
20+
```bash
21+
$ ai-services application create <app-name> -t RAG --params UI_PORT=3000
22+
```
23+
24+
**Replace 3000 with any port number you wish to use for rendering the UI.**
25+
26+
After the `create` command completes successfully, the next steps will appear in the output. Alternatively, you can follow the instructions below. Make sure to replace `<app-name>` with your application name accordingly.
27+
28+
## Place the Documents for Ingestion
29+
30+
Add your source documents to the designated ingestion directory path -> `/var/lib/ai-services/<app-name>/docs/`. These files will be processed and indexed for retrieval by the RAG pipeline.
31+
32+
## Start Document Ingestion
33+
34+
Trigger the ingestion process to parse and upload the documents into DB. Once complete, the documents become searchable and ready for retrieval during chat interactions.
35+
36+
```bash
37+
ai-services application start <app-name> --pod=<app-name>--ingest-docs
38+
```
39+
40+
## Access the Chatbot
41+
42+
The chatbot URL is rendered on the terminal once the application is created and can also be viewed by using the `ai-service application info <app-name>` command.
43+
44+
```bash
45+
$ ai-services application info rag-test
46+
Application Name: rag-test
47+
Application Template: RAG
48+
Version: 0.0.1
49+
Info:
50+
-------
51+
Day N:
52+
1. Chatbot is available to use at http://10.20.177.252:3000
53+
2. If you want to serve any more new documents via this RAG application, add them inside "/var/lib/ai-services/rag-test/docs" directory
54+
3. If you want to do the ingestion again, execute below command and wait for the ingestion to be completed before accessing the chatbot to query the new data.
55+
`ai-services application start rag-test --pod=rag-test--ingest-docs`
56+
4. In case if you want to clean the documents added to the db, execute below command
57+
`ai-services application start rag-test --pod=rag-test--clean-docs`
58+
```

mkdocs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ nav:
4848
- completion: commands/completion.md
4949
- help: commands/help.md
5050
- version: commands/version.md
51-
- Chatbot: chatbot.md
51+
- Chatbot: rag-setup.md
5252
- Tutorials:
5353
- Creating an application: tutorials/create-app.md
5454
- Installing in air-gapped environment: tutorials/airgapped-env.md

0 commit comments

Comments
 (0)