- Create and active a Python virtual environment by running the following commands:
python3 -m venv ./.venv
source ./.venv/bin/activate
- Install required dependencies by runing the following command:
pip install singlestoredb langchain langchain-community langchain-openai openai pypdf ijson "fastapi[standard]" python-dotenv
- Create a
.env
file in the root of the project based on the.env.example
file. - Place a PDF, Markdown, or TXT file that you want to use as your knowledge base into the directory you just created.
- Create tables by running the following command:
python ./create_tables.py
- Create embeddings by running the following command:
python ./create_embeddings.py
- Load embeddings by running the following command:
python ./load_embeddings.py
- Run the app:
python ./app.py
- Open http://localhost:8000/docs in your browser and test the
/ask
API endpoint.