LlamaIndex
LlamaIndex Handler
This documentation describes the integration of MindsDB with LlamaIndex, a framework for building context-augmented generative AI applications with LLMs.
Prerequisites
Before proceeding, ensure the following prerequisites are met:
- Install MindsDB locally via Docker or Docker Desktop.
- To use LlamaIndex within MindsDB, install the required dependencies following this instruction.
- Obtain the OpenAI API key required to OpenAI LLMs. Follow the instructions for obtaining the API key.
Setup
Create an AI engine from the Llamaindex handler.
Create a model using llama_index
as an engine and OpenAI as a model provider.
Usage
Here is how to create a model that answers questions by reading a page from the web:
Query the model to get answer:
Here is the output:
Configuring SimpleWebPageReader for Specific Domains
When SimpleWebPageReader is used it can be configured to interact only with specific domains by using the web_crawling_allowed_sites
setting in the config.json
file.
This feature allows you to restrict the handler to read and process content only from the domains you specify, enhancing security and control over web interactions.
To configure this, simply list the allowed domains under the web_crawling_allowed_sites
key in config.json
. For example:
Next Steps
Go to the Use Cases section to see more examples.
Was this page helpful?