Skip to content

Commit 676da2e

Browse files
Merge branch 'main' into bugfix/undetectable-encodingg
2 parents 0189f7d + 67b473e commit 676da2e

8 files changed

Lines changed: 471 additions & 370 deletions

File tree

docs/docs.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -532,7 +532,9 @@
532532
{
533533
"group": "Agents",
534534
"pages": [
535-
"mindsdb_sql/agents/agent"
535+
"mindsdb_sql/agents/agent",
536+
"mindsdb_sql/agents/agent_syntax",
537+
"mindsdb_sql/agents/agent_gui"
536538
]
537539
},
538540
{

docs/mindsdb_sql/agents/agent.mdx

Lines changed: 13 additions & 277 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,26 @@
11
---
2-
title: Agents
2+
title: How Agents Work
33
sidebarTitle: Overview
44
---
55

66
Agents enable conversation with data, including structured and unstructured data connected to MindsDB.
77

8-
## How Agents Work
9-
108
Connect your data to MindsDB by [connecting databases or applications](/integrations/data-overview) or [uploading files](/mindsdb_sql/sql/create/file). Users can opt for using [knowledge bases](/mindsdb_sql/knowledge-bases) to store and retrieve data efficiently.
119

1210
Create an agent, passing the connected data and defining the underlying model.
1311

1412
```sql
1513
CREATE AGENT my_agent
1614
USING
17-
model = 'gemini-2.0-flash',
18-
google_api_key = 'xyz123',
19-
include_knowledge_bases= ['mindsdb.sales_kb', 'mindsdb.orders_kb'],
20-
include_tables=['postgres_conn.customers', 'mysql_conn.products'],
15+
model = {
16+
"provider": "openai",
17+
"model_name" : "gpt-4o",
18+
"api_key": "sk-abc123"
19+
},
20+
data = {
21+
"knowledge_bases": ["mindsdb.sales_kb", "mindsdb.orders_kb"],
22+
"tables": ["postgres_conn.customers", "mysql_conn.products"]
23+
},
2124
prompt_template='
2225
mindsdb.sales_kb stores sales analytics data
2326
mindsdb.orders_kb stores order data
@@ -34,273 +37,6 @@ FROM my_agent
3437
WHERE question = 'What is the average number of orders per customers?';
3538
```
3639

37-
## `CREATE AGENT` Syntax
38-
39-
Here is the syntax for creating an agent:
40-
41-
```sql
42-
CREATE AGENT my_agent
43-
USING
44-
model = 'model-name',
45-
<provider>_api_key= 'abc123',
46-
include_knowledge_bases = ['project_name.kb_name', ...],
47-
include_tables = ['datasource_conn_name.table_name', ...],
48-
prompt_template = 'describe data';
49-
```
50-
51-
It creates an agent that uses the defined model and has access to the connected data.
52-
53-
```sql
54-
SHOW AGENTS
55-
WHERE name = 'my_agent';
56-
```
57-
58-
### `model`
59-
60-
This parameter defines the underlying language model.
61-
62-
The available models and providers include the following.
63-
64-
<AccordionGroup>
65-
66-
<Accordion title="Anthropic">
67-
Available models:
68-
- claude-3-opus-20240229
69-
- claude-3-sonnet-20240229
70-
- claude-3-haiku-20240307
71-
- claude-2.1
72-
- claude-2.0
73-
- claude-instant-1.2
74-
</Accordion>
75-
76-
<Accordion title="Google">
77-
Available models:
78-
- gemini-2.5-pro-preview-03-25
79-
- gemini-2.0-flash
80-
- gemini-2.0-flash-lite
81-
- gemini-1.5-flash
82-
- gemini-1.5-flash-8b
83-
- gemini-1.5-pro
84-
</Accordion>
85-
86-
<Accordion title="Ollama">
87-
Available models:
88-
- gemma
89-
- llama2
90-
- mistral
91-
- mixtral
92-
- llava
93-
- neural-chat
94-
- codellama
95-
- dolphin-mixtral
96-
- qwen
97-
- llama2-uncensored
98-
- mistral-openorca
99-
- deepseek-coder
100-
- nous-hermes2
101-
- phi
102-
- orca-mini
103-
- dolphin-mistral
104-
- wizard-vicuna-uncensored
105-
- vicuna
106-
- tinydolphin
107-
- llama2-chinese
108-
- openhermes
109-
- zephyr
110-
- nomic-embed-text
111-
- tinyllama
112-
- openchat
113-
- wizardcoder
114-
- phind-codellama
115-
- starcoder
116-
- yi
117-
- orca2
118-
- falcon
119-
- starcoder2
120-
- wizard-math
121-
- dolphin-phi
122-
- nous-hermes
123-
- starling-lm
124-
- stable-code
125-
- medllama2
126-
- bakllava
127-
- codeup
128-
- wizardlm-uncensored
129-
- solar
130-
- everythinglm
131-
- sqlcoder
132-
- nous-hermes2-mixtral
133-
- stable-beluga
134-
- yarn-mistral
135-
- samantha-mistral
136-
- stablelm2
137-
- meditron
138-
- stablelm-zephyr
139-
- magicoder
140-
- yarn-llama2
141-
- wizard-vicuna
142-
- llama-pro
143-
- deepseek-llm
144-
- codebooga
145-
- mistrallite
146-
- dolphincoder
147-
- nexusraven
148-
- open-orca-platypus2
149-
- all-minilm
150-
- goliath
151-
- notux
152-
- alfred
153-
- megadolphin
154-
- xwinlm
155-
- wizardlm
156-
- duckdb-nsql
157-
- notus
158-
</Accordion>
159-
160-
<Accordion title="OpenAI">
161-
Available models:
162-
- gpt-3.5-turbo
163-
- gpt-3.5-turbo-16k
164-
- gpt-3.5-turbo-instruct
165-
- gpt-4
166-
- gpt-4-32k
167-
- gpt-4-1106-preview
168-
- gpt-4-0125-preview
169-
- gpt-4o
170-
- o3-mini
171-
- o1-mini
172-
</Accordion>
173-
174-
<Accordion title="Nvidia NIM">
175-
Available models:
176-
- microsoft/phi-3-mini-4k-instruct
177-
- mistralai/mistral-7b-instruct-v0.2
178-
- writer/palmyra-med-70b
179-
- mistralai/mistral-large
180-
- mistralai/codestral-22b-instruct-v0.1
181-
- nvidia/llama3-chatqa-1.5-70b
182-
- upstage/solar-10.7b-instruct
183-
- google/gemma-2-9b-it
184-
- adept/fuyu-8b
185-
- google/gemma-2b
186-
- databricks/dbrx-instruct
187-
- meta/llama-3_1-8b-instruct
188-
- microsoft/phi-3-medium-128k-instruct
189-
- 01-ai/yi-large
190-
- nvidia/neva-22b
191-
- meta/llama-3_1-70b-instruct
192-
- google/codegemma-7b
193-
- google/recurrentgemma-2b
194-
- google/gemma-2-27b-it
195-
- deepseek-ai/deepseek-coder-6.7b-instruct
196-
- mediatek/breeze-7b-instruct
197-
- microsoft/kosmos-2
198-
- microsoft/phi-3-mini-128k-instruct
199-
- nvidia/llama3-chatqa-1.5-8b
200-
- writer/palmyra-med-70b-32k
201-
- google/deplot
202-
- meta/llama-3_1-405b-instruct
203-
- aisingapore/sea-lion-7b-instruct
204-
- liuhaotian/llava-v1.6-mistral-7b
205-
- microsoft/phi-3-small-8k-instruct
206-
- meta/codellama-70b
207-
- liuhaotian/llava-v1.6-34b
208-
- nv-mistralai/mistral-nemo-12b-instruct
209-
- microsoft/phi-3-medium-4k-instruct
210-
- seallms/seallm-7b-v2.5
211-
- mistralai/mixtral-8x7b-instruct-v0.1
212-
- mistralai/mistral-7b-instruct-v0.3
213-
- google/paligemma
214-
- google/gemma-7b
215-
- mistralai/mixtral-8x22b-instruct-v0.1
216-
- google/codegemma-1.1-7b
217-
- nvidia/nemotron-4-340b-instruct
218-
- meta/llama3-70b-instruct
219-
- microsoft/phi-3-small-128k-instruct
220-
- ibm/granite-8b-code-instruct
221-
- meta/llama3-8b-instruct
222-
- snowflake/arctic
223-
- microsoft/phi-3-vision-128k-instruct
224-
- meta/llama2-70b
225-
- ibm/granite-34b-code-instruct
226-
</Accordion>
227-
228-
<Accordion title="Writer">
229-
Available models:
230-
- palmyra-x5
231-
- palmyra-x4
232-
</Accordion>
233-
234-
</AccordionGroup>
235-
236-
### `<provider>_api_key`
237-
238-
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`.
239-
240-
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.
241-
242-
### `include_knowledge_bases`
243-
244-
This parameter stores the list of knowledge bases accessible by the agent for data retrieval.
245-
246-
Learn more about [knowledge bases here](/mindsdb_sql/knowledge-bases).
247-
248-
### `include_tables`
249-
250-
This parameter stores the list of data sources accessible by the agent.
251-
252-
Learn more about available [data integrations here](/integrations/data-overview).
253-
254-
### `prompt_template`
255-
256-
This parameter stores instructions for the agent.
257-
258-
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.
259-
260-
## `SELECT FROM AGENT` Syntax
261-
262-
Query an agent to generate responses to questions.
263-
264-
```sql
265-
SELECT answer
266-
FROM my_agent
267-
WHERE question = 'What is the average number of orders per customers?';
268-
```
269-
270-
### Chat Interface
271-
272-
MindsDB provides a chat interface that enables users to chat with their data.
273-
274-
<Note>
275-
To access the chat interface and converse with agents, users need to enable the A2A API that is used to communicate between the chat interface and the agent.
276-
277-
```bash
278-
docker run --name mindsdb_container -e MINDSDB_A2A_HOST=<if-using-remote-host> -e MINDSDB_APIS=http,mysql,mcp,a2a -p 47334:47334 -p 47335:47335 -p 47337:47337 -p 47338:47338 mindsdb/mindsdb
279-
```
280-
281-
Note that the `MINDSDB_A2A_HOST` variable is required when running MindsDB on a remote host, such as AWS. If you run MindsDB on `127.0.0.1`, the `MINDSDB_A2A_HOST` variable is not required.
282-
</Note>
283-
284-
<p align="center">
285-
<img src="/assets/mindsdb_gui_respond.png" />
286-
</p>
287-
288-
Select an agent from the list of existing agents, or create one if none exists yet.
289-
290-
<p align="center">
291-
<img src="/assets/mindsdb_gui_respond_agents.png" />
292-
</p>
293-
294-
Now the chat interface is connected to this agent via [Agent2Agent Protocol](https://google.github.io/A2A/) and users can chat with the data connected to this agent.
295-
296-
<p align="center">
297-
<img src="/assets/mindsdb_gui_respond_chat.png" />
298-
</p>
299-
300-
## `DROP AGENT` Syntax
301-
302-
Here is the syntax for deleting an agent:
303-
304-
```sql
305-
DROP AGENT my_agent;
306-
```
40+
<Tip>
41+
Follow [this doc page to learn more about the usage of agents](/mindsdb_sql/agents/agent_syntax).
42+
</Tip>
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
---
2+
title: How to Chat with Agents
3+
sidebarTitle: Chat Interface
4+
---
5+
6+
Agents enable conversation with data, including structured and unstructured data connected to MindsDB.
7+
8+
MindsDB provides a chat interface that enables users to chat with their data.
9+
10+
<Note>
11+
To access the chat interface and converse with agents, users need to enable the A2A API that is used to communicate between the chat interface and the agent.
12+
13+
```bash
14+
docker run --name mindsdb_container -e MINDSDB_A2A_HOST=<if-using-remote-host> -e MINDSDB_APIS=http,mysql,mcp,a2a -p 47334:47334 -p 47335:47335 -p 47337:47337 -p 47338:47338 mindsdb/mindsdb
15+
```
16+
17+
Note that the `MINDSDB_A2A_HOST` variable is required when running MindsDB on a remote host, such as AWS. If you run MindsDB on `127.0.0.1`, the `MINDSDB_A2A_HOST` variable is not required.
18+
</Note>
19+
20+
<p align="center">
21+
<img src="/assets/mindsdb_gui_respond.png" />
22+
</p>
23+
24+
Select an agent from the list of existing agents, or create one if none exists yet.
25+
26+
<p align="center">
27+
<img src="/assets/mindsdb_gui_respond_agents.png" />
28+
</p>
29+
30+
Now the chat interface is connected to this agent via [Agent2Agent Protocol](https://google.github.io/A2A/) and users can chat with the data connected to this agent.
31+
32+
<p align="center">
33+
<img src="/assets/mindsdb_gui_respond_chat.png" />
34+
</p>

0 commit comments

Comments
 (0)