Agents
Agents enable conversation with data, including structured and unstructured data connected to MindsDB.
How Agents Work
Connect your data to MindsDB by connecting databases or applications or uploading files. Users can opt for using knowledge bases to store and retrieve data efficiently.
Create an agent, passing the connected data and defining the underlying model.
Query an agent and ask question over the connected data.
CREATE AGENT
Syntax
Here is the syntax for creating an agent:
It creates an agent that uses the defined model and has access to the connected data.
model
This parameter defines the underlying language model.
The available models and providers include the following.
<provider>_api_key
This parameter stores the API key for accessing models. Include the provider of the model in the parameter name, such as anthropic_api_key
, google_api_key
, openai_api_key
.
For example, use google_api_key
when using gemini-2.0-flash
for a model, and analogically, use openai_api_key
when using gpt-4o
for a model.
include_knowledge_bases
This parameter stores the list of knowledge bases accessible by the agent for data retrieval.
Learn more about knowledge bases here.
include_tables
This parameter stores the list of data sources accessible by the agent.
Learn more about available data integrations here.
prompt_template
This parameter stores instructions for the agent.
It is recommended to provide data description of the data sources listed in the include_knowledge_bases
and include_tables
to help the agent locate relevant data for answering questions.
SELECT FROM AGENT
Syntax
Query an agent to generate responses to questions.
Chat Interface
MindsDB provides a chat interface that enables users to chat with their data.
Select an agent from the list of existing agents, or create one if none exists yet.
Now the chat interface is connected to this agent via Agent2Agent Protocol and users can chat with the data connected to this agent.
DROP AGENT
Syntax
Here is the syntax for deleting an agent: