Git Product home page Git Product logo

faq-service's Introduction

FAQ-Service

Overview

FAQ-Service is a service that creates a RESTful interface for creating, managing, and querying your own custom knowledgebases

How does it work?

FAQ-Service is self-hosted. At its base, it is a flask application that acts as an API-server interface for our custom indexing and querying system. Upon installing FAQ-Service locally or on docker (see below), you can immediately start creating and querying knowledgebases

Knowledgebases consist of a collection of files. You first call a creation endpoint to create a knowledgebase, this will give you a knowledge ID. After a knowledgebase ID is retrieved, you can pack the knowledgebase with content, you can load the knowledgebase with content by using files or links, our indexing system (using llama-index under the hood) is automatically able to interpret most popular file types such as PDF, DOCX, TXT, CSV, etc. You can also load a knowledgebase from a link.

Adding documents to your knowledgebase builds a document store. When you are ready to query your knowledgebase, you can compose your knowledgebase. Compositions are what we call turning the document store into a vector index. Knowledgebase compositions have multiple different parameters that allow you to specify what type of index you want to be created, what LLM to use, and etc.

After composing your knowledgebase, you will be able to query your knowledgebase. A full-fledged example can be seen below:

Creating a knowledgebase: img.png

Adding documents to a knowledgebase: img.png

Composing the knowledgebase: img.png

Querying the composed knowledgebase: img.png

Installation & Setup

FAQ-Service is a python flask service that you can install with python >=3.9.

First install the base requirements:

python3.9 -m pip install -r requirements.txt

Install flask-async

python3.9 -m pip install "flask[async]"

You then need to create a file named .env in the root of the project and populate it with your openAI key and organization, it should look as follows:

OPENAI_API_KEY="sk-....."
OPENAI_ORGANIZATIOn="org-..."

Then, in the root directory you can run the routes.py as the entrypoint

python3.9 routes.py

faq-service's People

Contributors

kav-k avatar luyaojchen avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.