ChatGPT Retrieval Plugin
Introduction
The ChatGPT Retrieval Plugin is an innovative tool designed to enhance the capabilities of ChatGPT by enabling it to access and interact with personal or organizational documents. This plugin acts as a standalone retrieval backend, meaning it works independently to perform semantic searches. It can be paired with Custom GPTs or integrated through function calling with various OpenAI models, including the Assistants API. The plugin is especially useful when precise control over retrieval processes is necessary, such as setting document chunk sizes or choosing specific embedding models.
Quickstart Guide
Setting up the ChatGPT Retrieval Plugin involves the following steps:
- Ensure Python 3.10 is installed.
- Clone the ChatGPT Retrieval Plugin repository.
- Navigate to the repository directory.
- Use Poetry to handle dependencies: install Poetry and create a virtual environment using Python 3.10.
- Activate the environment and install necessary dependencies.
- Create a bearer token for authentication purposes.
- Configure essential environment variables, including those related to embedding dimensions and models.
- For specific vector database configurations, set additional environment variables, such as those for Pinecone, Weaviate, Zilliz, Redis, and more.
- Run the API locally.
- Access the local API documentation to test the endpoints.
About the Retrieval Plugin
Core Capabilities
The Retrieval Plugin facilitates semantic search, allowing users to effortlessly retrieve relevant document snippets by querying in natural language. It's especially valuable for enterprises aiming to make internal documents accessible via ChatGPT. The plugin uses powerful OpenAI embeddings to break down documents into searchable chunks stored in vector databases, such as Elasticsearch, MongoDB, Redis, and others.
Custom GPT Integration
Creating a Custom GPT with Retrieval Plugin integration involves setting up an online app where your plugin is deployed. Custom GPTs can thus use the plugin for document retrieval, enhancing their responses with obtained information. Authentication is handled securely, and developers can choose among various methods like API keys or OAuth.
Function Calling
The Retrieval Plugin's endpoints can be used with OpenAI's Function Calling feature in both the Chat and Assistants APIs. This enables a more dynamic interaction, as the model can autonomously decide when to perform searches or store new information based on the conversational context. This feature supports parallel processing, allowing multiple retrieval tasks within the same conversation.
Deployment and Security
The Retrieval Plugin can be hosted on any cloud service that supports Docker, like Heroku or Azure, making it highly adaptable. To keep databases updated, it can process and continuously store data from various sources using webhooks. Security is ensured through the requirement of bearer tokens for API access, and queries can be refined using metadata filters.
Future Directions
The project aims to continue expanding its capabilities and integrations with other AI tools, ensuring robust document retrieval for ChatGPT applications. Open-source contributions are encouraged to explore new features or enhance existing ones.
This setup empowers both individuals and companies to make data-driven AI interactions more informative and contextually rich, transforming the way we engage with digital content.