This repository implements a RAG server for Web3 related requests.
Data for RAG is provided by the user either manualy or by using the data submission interface. Git repositories are prefered as data source.
Intall the requirements with pip install -r requirements.txt
TOKENIZERS_PARALLELISM=false python main.py
Handles RAG query via HTTP POST request
curl -X POST http://localhost:7860/query \
-H "Content-Type: application/json" \
-d '{"query":"Write an ERC721 soulbound contract"}'
GET
Queries the current git data repository config or POST
insert a new repository to be crawled and added to the knowledge base.
curl -X POST http://localhost:7860/repositories \
-H "Content-Type: application/json" \
-d '{
"name": "hardhat",
"url": "https://github.com/NomicFoundation/hardhat.git",
"local_path": "data/hardhat",
"update_frequency_hours": 24
}'
curl -X GET http://localhost:7860/repositories \
-H "Content-Type: application/json"
Get the number of documents in the knowledge base.
curl -X GET http://localhost:7860/knowledge_base \
-H "Content-Type: application/json"