Skip to content

Commit 9d81563

Browse files
committed
feat: Enhance RAG in a Box with multi-agent CoT and deployment options
Major enhancements: - Add multi-agent Chain of Thought reasoning with specialized agents (Planner, Researcher, Reasoner, Synthesizer) - Add support for both Oracle DB 23ai and local LLM (Ollama) deployments - Implement containerized deployment with Podman for Windows/Mac/Linux - Add comprehensive logging and error handling - Add real-time step-by-step reasoning visualization - Improve documentation with deployment guides and troubleshooting - Add support for multiple container configurations Technical improvements: - Optimize agent prompts for faster responses - Add proper error handling for database connections - Add HuggingFace embeddings error recovery - Improve container networking and initialization
1 parent f49444e commit 9d81563

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+3167
-0
lines changed

rag_in_a_box/LICENSE

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
Copyright (c) 2021 Oracle and/or its affiliates.
2+
3+
The Universal Permissive License (UPL), Version 1.0
4+
5+
Subject to the condition set forth below, permission is hereby granted to any
6+
person obtaining a copy of this software, associated documentation and/or data
7+
(collectively the "Software"), free of charge and under any and all copyright
8+
rights in the Software, and any and all patent rights owned or freely
9+
licensable by each licensor hereunder covering either (i) the unmodified
10+
Software as contributed to or provided by such licensor, or (ii) the Larger
11+
Works (as defined below), to deal in both
12+
13+
(a) the Software, and
14+
(b) any piece of software and/or hardware listed in the lrgrwrks.txt file if
15+
one is included with the Software (each a "Larger Work" to which the Software
16+
is contributed by such licensors),
17+
18+
without restriction, including without limitation the rights to copy, create
19+
derivative works of, display, perform, and distribute the Software and make,
20+
use, sell, offer for sale, import, export, have made, and have sold the
21+
Software and the Larger Work(s), and to sublicense the foregoing rights on
22+
either these or other terms.
23+
24+
This license is subject to the following condition:
25+
The above copyright notice and either this complete permission notice or at
26+
a minimum a reference to the UPL must be included in all copies or
27+
substantial portions of the Software.
28+
29+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
30+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
31+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
32+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
33+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
34+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
35+
SOFTWARE.

rag_in_a_box/README.md

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
# AI RAG in a BOX Demo using Oracle Autonomous Database 23ai and Local LLMs
2+
3+
## Introduction
4+
5+
An innovative RAG (Retrieval Augmented Generation) system designed to leverage an LLM agent for effective information retrieval and response generation.
6+
7+
This system efficiently processes various document formats and intelligently selects the appropriate knowledge base based on user queries.
8+
9+
The AI RAG in a BOX Demo utilizing the Internal LLM Engine "Ollama" is deployable via Podman across multiple platforms, including Mac OSX, Windows, and Linux.
10+
11+
AI RAG in a BOX Demo using Internal LLM Engine "Ollama" can be deployed in Podman on your PC - Mac OSX (Intel or ARM), Windows (Intel or ARM), or Linux.
12+
13+
This solution includes 2 containers:
14+
- Oracle Database 23ai
15+
- AIRAG Container
16+
17+
## 1. Install the containers
18+
19+
#### Windows Deployment
20+
21+
1. Install Podman in Windows
22+
- Follow the installation guide [here](https://github.com/containers/podman/blob/main/docs/tutorials/podman-for-windows.md)
23+
- See detailed tutorial for [Windows Installation](./install_win_llama3_db23ai.md)
24+
25+
2. Install Containers
26+
- Deploy using the script: [install_airagdb23ai_win.bat](./scripts/install_airagdb23ai_win.bat)
27+
28+
#### Mac OSX Deployment
29+
30+
- Deploy using the script. You can check all the steps which are commented in the script: [install_airagdb23ai_macosx.sh](./scripts/install_airagdb23ai_macosx.sh)
31+
32+
#### Linux Deployment
33+
34+
- Deploy using the script: [install_airagdb23ai_linux.sh](./scripts/install_airagdb23ai_linux.sh)
35+
36+
## 2.Verifying Installation
37+
38+
1. Check Podman network:
39+
40+
```bash
41+
podman network ls
42+
```
43+
44+
2. Verify downloaded images:
45+
46+
```bash
47+
podman images
48+
```
49+
50+
3. Check running containers:
51+
```bash
52+
podman ps
53+
```
54+
55+
4. Check container logs:
56+
```bash
57+
podman logs -f 23aidb
58+
podman logs -f airagdb23aiinbox
59+
```
60+
61+
5. Connect to the database:
62+
```bash
63+
podman exec -it 23aidb sqlplus VECDEMO/<pwd>@FREEPDB1
64+
```
65+
66+
## Appendix: Troubleshooting
67+
68+
### Database Connection
69+
70+
To verify database functionality for the user `VECDEMO`:
71+
72+
```bash
73+
podman exec -it 23aidb sqlplus VECDEMO/<pwd>@FREEPDB1
74+
```
75+
76+
### HuggingFace Embeddings Error
77+
78+
If you encounter this error:
79+
80+
```bash
81+
OSError: We couldn't connect to 'https://huggingface.co' to load this file...
82+
```
83+
84+
Restart the container:
85+
86+
```bash
87+
podman stop airagdb23aiinbox
88+
podman start airagdb23aiinbox
89+
```
90+
91+
## Contributing
92+
93+
This project is open source. Please submit your contributions by forking this repository and submitting a pull request! Oracle appreciates any contributions that are made by the open source community.
94+
95+
## License
96+
97+
Copyright (c) 2024 Oracle and/or its affiliates.
98+
99+
Licensed under the Universal Permissive License (UPL), Version 1.0.
100+
101+
See [LICENSE](../LICENSE) for more details.
102+
103+
ORACLE AND ITS AFFILIATES DO NOT PROVIDE ANY WARRANTY WHATSOEVER, EXPRESS OR IMPLIED, FOR ANY SOFTWARE, MATERIAL OR CONTENT OF ANY KIND CONTAINED OR PRODUCED WITHIN THIS REPOSITORY, AND IN PARTICULAR SPECIFICALLY DISCLAIM ANY AND ALL IMPLIED WARRANTIES OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. FURTHERMORE, ORACLE AND ITS AFFILIATES DO NOT REPRESENT THAT ANY CUSTOMARY SECURITY REVIEW HAS BEEN PERFORMED WITH RESPECT TO ANY SOFTWARE, MATERIAL OR CONTENT CONTAINED OR PRODUCED WITHIN THIS REPOSITORY. IN ADDITION, AND WITHOUT LIMITING THE FOREGOING, THIRD PARTIES MAY HAVE POSTED SOFTWARE, MATERIAL OR CONTENT TO THIS REPOSITORY WITHOUT ANY REVIEW. USE AT YOUR OWN RISK.

0 commit comments

Comments
 (0)