An open API service indexing awesome lists of open source software.

https://github.com/rockchinq/llm-embed-qa

Question answering system built with vector dbs and LLMs.
https://github.com/rockchinq/llm-embed-qa

embedding gpt llm milvus openai qa qaautomation

Last synced: 6 months ago
JSON representation

Question answering system built with vector dbs and LLMs.

Awesome Lists containing this project

README

        

# llm-embed-qa

Question answering system built with vector dbs and LLMs.

> Part of the content is implemented with reference to [michaelliao/llm-embedding-sample](https://github.com/michaelliao/llm-embedding-sample)

## Requirements (Default Component)

- Python 3.10
- Docker

## Install

1. Clone this repo
2. Install requirements with `pip install -r requirements.txt`
3. Startup PostgreSQL with Docker

```bash
docker run -d \
--rm \
--name pgvector \
-p 5432:5432 \
-e POSTGRES_PASSWORD=password \
-e POSTGRES_USER=postgres \
-e POSTGRES_DB=postgres \
-e PGDATA=/var/lib/postgresql/data/pgdata \
-v /path/to/llm-embedding-qa/pg-data:/var/lib/postgresql/data \
-v /path/to/llm-embedding-qa/pg-init-script:/docker-entrypoint-initdb.d \
ankane/pgvector:latest
```

**NOTE: replace /path/to/... with real path.**

4. Run `python main.py`, edit `config.yaml` to set your `api_key` of OpenAI.
5. Put your `markdown` format documents in `docs` folder.
- There are the wiki files of [QChatGPT](https://github.com/RockChinQ/QChatGPT) in `docs_examples` folder.
6. Run `python main.py` again, it will automatically build the vector database and start the server.

## Usage

- `GET /ask`
- `content`: the content of the question
- `strict`: (Optional) skip LLM request if `strict=true` and no related answer found in vector db