Getting started
Last updated on
23 July 2024
Pre-requisites:
- A Drupal site with content that you wish to search using Search API AI, admin access and access to Composer.
- An Open AI account and API key.
- A Pinecone account and API Key.
Instructions
Please also view Exploring SearchAPI AI: A First Look at AI-Powered Search in Drupal (YouTube).
- Use Composer to install the search_API_AI module. The module is currently in development so make sure you have your composer minimum_stability set to ‘dev’. e.g.
composer require drupal/search_api_ai - Enable the following modules either in the UI or command line:
- Search API AI,
- Search API AI Explorer
- Search API AI Pinecone
These modules depend on Search API, Open AI and Open AI Embeddings, so these will also be installed.
- Add your Open AI API key to Configuration/Open AI/Settings (
/admin/config/openai/settings). - Add your Pinecone API key and hostname to Configuration/Open AI/Embeddings settings (
/admin/config/openai/openai-embeddings/settings) - Add your Pinecone server to Configuration/Search and metadata/Search API (
/admin/config/search/search-api). - Then Add an index including your chosen data sources and ensure Pinecone is selected as the server the index should use. (Also, it is worth reducing the CRON batch size)
- Then add a field from your chosen datasource to the index, eg body. Ensure it is of type Embeddings.
- Now go to the View page of your index and index your data.
- Check that you have the correct number of items indexed in your index created in step 6.
- You can now ask chatGPT a question in Configuration/OpenAI/Search API AI Search. (
/admin/config/openai/search-api-ai-explorer) - You can then go to your block layout (
/admin/structure/block) to add and configure the ‘Search API AI: Chat form’ block. Here you select the index you have created, restrict the results to s specific view, and select entity types and messages.
Help improve this page
Page status: No known problems
You can:
You can:
- Log in, click Edit, and edit this page
- Log in, click Discuss, update the Page status value, and suggest an improvement
- Log in and create a Documentation issue with your suggestion