Skip to content

katconnors/rag-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rag-api

  • This is a simple Python/Flask service that can ingest text, convert it into embeddings, and store the embeddings within memory.
  • Given a query, a relevant sentence is then returned.

Setup

  • Create a virtual environment
virtualenv env
  • Activate the virtual environment
source env/bin/activate
  • Install the dependencies in requirements.txt
pip install -r requirements.txt

Usage

  • Run the server by using the following command:
python3 server.py
curl --location 'http://127.0.0.1:5000/ingest' \
--header 'Content-Type: application/json' \
--data '[
{
"id": 1,
"text": "This is a test sentence."
}
]'
curl --location 'http://127.0.0.1:5000/query?text=test%20query'

Unit Tests

Unit tests can be found in tests.py
To run tests, use:

python3 tests.py

About

Flask RAG API server

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages