A repository for learning LangChain by building a generative ai application. Original work from Eden Marco.
This is a web application demo that use Pinecone as a vectorstore and answers questions about LangChain. Pinecone act a context database, first you have to download the docs from sources from LangChain official documentation. Obviously you can do the same with every dataset you want.
Basically you have three scripts in this project:
langchain_retrieval_doc_helper.py --> my work. Original work from Eden was not working for me. main.py --> it invokes the logic from core_agent.py core_agent.py --> basically is a refactor from first script.
To run this project, you will need to add the following environment variables to your .env file
PINECONE_API_KEY
PINECONE_ENVIRONMENT_REGION
OPENAI_API_KEY
Clone the project
git clone https://github.com/alonsoir/documentation-helper.git
Go to the project directory
cd documentation-helper
Download LangChain Documentation
mkdir langchain-docs
wget -r -A.html -P langchain-docs https://api.python.langchain.com/en/latest
Run ingestion script to create the index in Pinecone. https://app.pinecone.io My index is langchain-doc-index, be sure to match this name with the one you use in the code.
python ingestion.py
Install dependencies
pipenv install
Start the flask server
streamlit run main.py
To run tests, run the following command
pipenv run pytest .