markthebault / Knowledge-Base

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Knowledge Database

Requirements

  • Docker
  • Docker Compose

How to run

  • Clone this repository
  • Create an .env file. You can copy the contents of .env.example and make any necessary changes
  • Run docker-compose build to build the image
  • Run docker-compose up -d to run the containers

Endpoints

POST /insert

Insert new knowledge into the database. The body must be a JSON with the following structure:

{
    "data": [
        {
            "id": "abc",
            "text": "Text that will be converted to embeddings",
            "entity": "Name of the entity that will be used to filter if needed",
            "payload": {
                "key": "optional"
            }
        }
    ]
}

GET /query

This endpoint can receive the following parameters:

  • query: Query to search for
  • k: Number of results to return. Default = 5
  • entities: Comma separated list of entities to filter the results. Default = all entities

DELETE /delete/{id}

Delete a knowledge from the database. The id parameter is the id of the knowledge to delete.

About


Languages

Language:Python 93.3%Language:Dockerfile 6.7%