This project implements a Retrieval-Augmented Generation (RAG) system using LangChainGo. The architecture consists of:
- MongoDB instance for storing user history
- PostgreSQL database with pgvector for document embeddings
- Ollama service for managing LLM interactions
- nomic-embed-text for embedding
- sailor2:8b as the LLM
- Docker
- NVIDIA GPU and drivers for GPU-accelerated Ollama (optional).
-
Clone the Repository:
git clone https://github.com/oniharnantyo/lanchaingo-rag-golang cd lanchaingo-rag-golang
-
Copy backend config:
Run the Docker Compose setup:
cd backend cp .env.example .env
-
Start Services:
Run the Docker Compose setup:
docker-compose up -d
-
Stopping Services:
To stop the services, run:
docker-compose down
Uploads a document to the backend for processing and embedding.
Request:
curl --request POST \
--url http://localhost:8000/documents \
--header 'content-type: multipart/form-data' \
--form 'file=@/path/to/your/document.pdf'
Sends a query to the backend and retrieves relevant results from the indexed documents.
Request:
curl --request POST \
--url http://localhost:8000/queries \
--header 'content-type: application/json' \
--data '{
"query": "your question here"
}'
This project is licensed under the MIT License. See the LICENSE file for details.