This Streamlit application provides an advanced interface for querying a Qdrant vector database. It allows users to perform semantic searches with optional filters using either OpenAI embeddings with future plans to incorporate Qdrant's built-in FastEmbed model.
- Embedding Options: Choose between OpenAI embeddings for query vectorization. Qdrant's FastEmbed will be implemented in the near future
- Environment Variable Support: Utilize environment variables for API keys and URLs.
- Dynamic Filter Interface: Create complex filters (
must
,must_not
,should
) based on metadata fields. - Collection Management: Select from available collections in your Qdrant database.
- Result Exploration: View and expand search results with payload details.
-
Clone the Repository
git clone https://github.com/JosefButts/qdrant-ui.git cd qdrant-ui
-
Create a Virtual Environment
python3 -m venv venv source venv/bin/activate # On Windows use 'venv\Scripts\activate'
-
Install Dependencies
pip install -r requirements.txt
Set the following environment variables if you prefer to use them:
OPENAI_API_KEY
: Your OpenAI API key (required if using OpenAI embeddings).QDRANT_URL
: The URL of your Qdrant server.QDRANT_KEY
: Your Qdrant API key (if required).
You can set them in your terminal:
export OPENAI_API_KEY='your-openai-api-key'
export QDRANT_URL='your-qdrant-url'
export QDRANT_KEY='your-qdrant-api-key'
Alternatively, you can enter your API keys and URLs directly in the Streamlit app via the sidebar configuration.
-
Run the Application
streamlit run src/app.py
-
Configure API Settings
- Use the sidebar to select the embedding provider (
OpenAI
orFastEmbed
). - Choose whether to use environment variables or custom settings.
- Enter your API keys and URLs if not using environment variables.
- Use the sidebar to select the embedding provider (
-
Query Qdrant
- Enter your query text.
- Select the collection you want to search.
- Set the result limit.
- Create filters using the dynamic filter interface:
- Must Filters: Conditions that must be met.
- Must Not Filters: Conditions that must not be met.
- Should Filters: Conditions that should be met (optional).
- Click on "Query Qdrant" to execute the search.
-
View Results
- Expand each result to view the payload and other details.
- If no results are found, adjust your query or filters.
- Python 3.7 or higher
- Streamlit
- LangChain Community Embeddings
- Qdrant Client
- OpenAI API key (if using OpenAI embeddings)
- Access to a Qdrant server with your data indexed
All required Python packages are listed in requirements.txt
.
- Metadata Keys: The filter interface dynamically loads metadata keys from your selected collection.
This project is licensed under the MIT License.
Contributions are welcome! Please open an issue or submit a pull request for any enhancements or bug fixes.
- Streamlit for the interactive web interface.
- Qdrant for the vector database and search capabilities.
- OpenAI for their powerful embedding models.
- LangChain for community embeddings support.
For any questions or suggestions, please contact buttsjosef@gmail.com.