Skip to content

deepset-ai/opea-haystack-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Demopalooza: Practical RAG with OPEA and Haystack

image

This Streamlit app is set up for simple Haystack and OPEA applications. The template is ready to perform Retrieval Augmented Generation with three different retrieval methods on example files.

See the 'How to use this template' instructions below to create a simple UI for your own Haystack search pipelines.

Installation and Running

To run the bare application:

  1. Install requirements: pip install -r requirements.txt
  2. Make sure that your OPEA microservices are running
  3. Run the streamlit app: streamlit run app.py

This will start the app on localhost:8501, where you will find a simple search bar.

How to use this template

  1. Create a new repository from this template or simply open it in a codespace to start playing around 💙
  2. Make sure your requirements.txt file includes the Haystack (haystack-ai) and Streamlit versions you would like to use.
  3. Change the code in utils/haystack.py if you would like a different pipeline.
  4. Create a .env file with all of your configuration settings.
  5. Make any UI edits if you'd like to.
  6. Run the app as show in installation and running

Repo structure

  • ./utils: This is where we have 2 files:
    • haystack.py: Here you will find some functions already set up for you to start creating your Haystack search pipeline. It includes 2 main functions called start_haystack_pipeline() which is what we use to create a pipeline and cache it, and query() which is the function called by app.py once a user query is received.
    • ui.py: Use this file for any UI and initial value setups.
  • app.py: This is the main Streamlit application file that we will run. In its current state it has a sidebar, a simple search bar, a 'Run' button, and a response.
  • ./files: You can use this folder to store files to be indexed.

What to edit?

There are default pipelines both in start_document_store() and start_haystack_pipeline(). Change the pipelines to use different document stores, embedding and generative models or update the pipelines as you need. Check out 📚 Useful Resources section for details.

📚 Useful Resources

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages