Skip to content

ragul28/rag-langchain-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RAG LangChain

This simple RAG (Retrieval Augmented Generation) golang based example using google gemini. The application allows you to add documents and query them using natural language, powered by Gemini's language model.

Prerequisites

  • Go 1.23 or later
  • Docker and Docker Compose
  • Google Cloud Project with Gemini API access

Setup

  1. Get a Google Gemini API key from Google AI Studio

  2. set the api key as an environment variable

export GEMINI_API_KEY=your_api_key_here
  1. Start the Weaviate vector database:
docker-compose up -d
  1. Build run the application
make run

Usage

The server provides the following endpoints:

Add Documents

curl -X POST http://localhost:8000/add/ \
  -H "Content-Type: application/json" \
  -d '{"documents": [{"text": "Your document text here"}]}'

Query Documents

curl -X POST http://localhost:8000/query/ \
  -H "Content-Type: application/json" \
  -d '{"content": "Your question here"}'

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published