RAG system that recieves a Natural Language query as input, and gives a textual response and a related Knowledge Graph (RDF).
- docker & docker compose.
- openai api key.
git clone https://github.com/vlermandac/retrieval-augmented-graph-generation-webapp/
cd retrieval-augmented-graph-generation-webapp # enter the repository
# from the project root directory, add your api key with this command
echo "OPENAI_API_KEY=<your-api-key>" >> .env
You can also change more build configuration in the .env file.
# depending the OS, the docker compose bin can be one of this two:
docker compose up
docker-compose up
It was tested in macos ventura using micromamba.
- conda/mamba/micromamba (one of the previous).
- gcc/g++ >= 12 compiler (no guarantee of working with other compilers).
# from ./searcher/
conda create -n searcher -f conda-lock.yml
conda activate searcher
- Build and run the graph with Cmake (./graph/).
- Install dependencies, build and run the front-end with npm (./react-app/).
- Run the python service (./searcher/app.py) with uvicorn.
- Edit the docker-compose.yml file to just build Elasticsearch, then run it.
If you followed one of the above guides, you should be able to use the app from your browser in [http://localhost:3000/].
First, the house button '⌂' on top-left corner will always take you to the current home page.
You can open and change some settings pressing the gear icon '⚙' on the top-right corner.
Remember to always save the changes after you made them. Otherwise they won't update.
Now, to make the app work you need to upload files. This can be easily done from the 'setting' tab.
Depending on the size of the file it can take a while to process.
Write a query in Natural Language in the input text box. Send it with the 'Enter' key.
As a result from your query you'll recieve:
- A textual answer in Natural Language.
- A rendered Knowledge Graph. The sizes of the Graph nodes are based on their 'PageRank' score.
- Check the ports that each of the docker containers need are available.
- Be sure you don't have keys or password in your .bashrc o .zshrc that could conlfict with the local env variables.
- Build memory surpass
- Check your global docker settings assign enough resources to containers (tested with default setting of 1 GB max and 2 vCPU max).
- Improve graph visualization.
- Integrate OCR: image -> pdf.
- Better chunking algorithm.
- CI/CD (github actions).
- Locally-runned LLM.
- Ditch python. Re-write backend.
- Optimize graph (big optimization margin).
- Add kubernetes. LLM, DB, backend, frontend could be clusters or nodes.
- More graph algorithms (community detection and others).