Are you sure you want to delete this access key?
This RAG example allows you to ask questions over a number of public company SEC filings. It uses LangChain, but the flow is representative of any RAG solution.
There are 3 parts:
ingest.py
: Chunks and loads PDFs into a vector database (PDFs are pulled from a public Google Cloud bucket)
retrieve.py
: Promptfoo-compatible provider that answers RAG questions using the database.
promptfooconfig.yaml
: Test inputs and requirements.
To get started:
Set the OPENAI_API_KEY environment variable.
Create a python virtual environment: python3 -m venv venv
Enter the environment: source venv/bin/activate
Install python dependencies: pip install -r requirements.txt
Run ingest.py
to create the vector database: python ingest.py
Now we're ready to go.
promptfooconfig.yaml
to your liking to configure the questions you'd like to ask in your tests. Then run:retrieve.py
to control how context is loaded and questions are answered.promptfoo eval
Afterwards, you can view the results by running promptfoo view
See promptfooconfig.with-asserts.yaml
for a more complete example that compares the performance of two RAG configurations.
Press p or to see the previous file or, n or to see the next file
Browsing data directories saved to S3 is possible with DAGsHub. Let's configure your repository to easily display your data in the context of any commit!
promptfoo is now integrated with AWS S3!
Are you sure you want to delete this access key?
Browsing data directories saved to Google Cloud Storage is possible with DAGsHub. Let's configure your repository to easily display your data in the context of any commit!
promptfoo is now integrated with Google Cloud Storage!
Are you sure you want to delete this access key?
Browsing data directories saved to Azure Cloud Storage is possible with DAGsHub. Let's configure your repository to easily display your data in the context of any commit!
promptfoo is now integrated with Azure Cloud Storage!
Are you sure you want to delete this access key?
Browsing data directories saved to S3 compatible storage is possible with DAGsHub. Let's configure your repository to easily display your data in the context of any commit!
promptfoo is now integrated with your S3 compatible storage!
Are you sure you want to delete this access key?