Python
import os
from meibel import MeibelClient
from meibel.models import CreateAgentDefinitionRequest, AgentToolDefinition
client = MeibelClient(api_key=os.environ["MEIBEL_API_KEY"])
request = CreateAgentDefinitionRequest(
display_name="Support Assistant",
instructions="You are a helpful support assistant. Answer customer questions using the provided knowledge base.",
description="Handles tier-1 customer support inquiries",
llm_model="gpt-4o",
fallback_models=["gpt-4o-mini"],
datasources=["ds_support_kb_001"],
tools=[
AgentToolDefinition(
name="knowledge_base_search",
type="rag_search",
description="Search the support knowledge base for relevant articles",
config={"datasource_id": "ds_support_kb_001"},
use_for=["answering product questions"],
avoid_for=["billing disputes"],
)
],
temperature=0.3,
max_tokens=1024,
tags=["support", "customer-facing"],
icon="headset",
)
agent = client.agents.create(request)
print(f"{agent.display_name} ({agent.id}) v{agent.version}")import { MeibelClient } from "meibel";
const client = new MeibelClient({ apiKey: process.env.MEIBEL_API_KEY });
const agent = await client.agents.create({
display_name: "Customer Support Agent",
instructions:
"You are a helpful customer support agent for Acme Corp. Answer questions using the provided knowledge base and escalate billing issues to a human.",
description: "Handles tier-1 customer support inquiries",
llm_model: "gpt-4o",
fallback_models: ["gpt-4o-mini"],
datasources: ["ds_support_kb_001"],
tools: [
{
name: "search_knowledge_base",
type: "rag_search",
description: "Search the support knowledge base for relevant articles",
config: { datasource_id: "ds_support_kb_001" },
use_for: ["answering product questions"],
avoid_for: ["billing disputes"],
},
],
execution_policy: {
datasources: {
ds_support_kb_001: {
documents: {
filter: { document_type: { $eq: "public" } },
},
},
},
tools: {
search_knowledge_base: {
disabled: false,
},
},
},
temperature: 0.3,
max_tokens: 1024,
tags: ["support", "customer-facing"],
});
console.log(`${agent.display_name} (${agent.id}) v${agent.version}`);package main
import (
"context"
"fmt"
"os"
v2 "github.com/meibel-ai/meibel-go/v2"
)
func main() {
client := v2.NewClient(v2.WithAPIKey(os.Getenv("MEIBEL_API_KEY")))
agent, err := client.Agents.Create(context.Background(), v2.CreateAgentDefinitionRequest{
DisplayName: "Customer Support Agent",
Instructions: "You are a helpful customer support agent for Acme Corp. Answer questions using the provided knowledge base and escalate when unsure.",
LlmModel: v2.String("gpt-4o"),
Datasources: []string{"ds_support_kb_001"},
Tools: []v2.AgentToolDefinition{
{
Name: "kb_search",
Type: "rag_search",
Description: v2.String("Search the support knowledge base for relevant articles"),
Config: map[string]any{
"datasource_id": "ds_support_kb_001",
},
UseFor: []string{"answering product questions", "troubleshooting issues"},
},
},
Temperature: v2.Float64(0.3),
MaxTokens: v2.Int(2048),
Tags: []string{"support", "production"},
})
if err != nil {
panic(err)
}
fmt.Printf("Created agent %s (%s), version %s\n", agent.DisplayName, agent.ID, agent.Version)
}curl --request POST \
--url https://api.meibel.ai/v2/agents \
--header 'Content-Type: application/json' \
--header 'Meibel-API-Key: <api-key>' \
--data '
{
"display_name": "Sales Analytics Agent",
"instructions": "You are a helpful sales analytics agent. Answer questions about sales data clearly and concisely.",
"llm_model": "claude-sonnet-4-6",
"tools": [],
"datasources": [
"ds_abc123"
],
"execution_policy": {
"datasources": {
"ds_abc123": {
"tables": {
"filter": {
"table.__name__": {
"$in": [
"orders",
"customers"
]
},
"orders.region": {
"$eq": "EU"
}
},
"hidden_columns": {
"customers": [
"ssn",
"credit_card"
]
}
},
"documents": {
"filter": {
"data_element.__id__": {
"$in": [
"de_abc",
"de_def"
]
}
}
}
},
"ds_xyz789": {
"disabled": true
}
},
"tools": {
"send_email": {
"variables": {
"to": {
"$eq": "support@acme.com"
},
"max_attachments": {
"$lte": 3
}
}
},
"web_search": {
"disabled": true
}
}
},
"execution_policy_ids": []
}
'const options = {
method: 'POST',
headers: {'Meibel-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
display_name: 'Sales Analytics Agent',
instructions: 'You are a helpful sales analytics agent. Answer questions about sales data clearly and concisely.',
llm_model: 'claude-sonnet-4-6',
tools: [],
datasources: ['ds_abc123'],
execution_policy: {
datasources: {
ds_abc123: {
tables: {
filter: {'table.__name__': {$in: ['orders', 'customers']}, 'orders.region': {$eq: 'EU'}},
hidden_columns: {customers: ['ssn', 'credit_card']}
},
documents: {filter: {'data_element.__id__': {$in: ['de_abc', 'de_def']}}}
},
ds_xyz789: {disabled: true}
},
tools: {
send_email: {variables: {to: {$eq: 'support@acme.com'}, max_attachments: {$lte: 3}}},
web_search: {disabled: true}
}
},
execution_policy_ids: []
})
};
fetch('https://api.meibel.ai/v2/agents', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.meibel.ai/v2/agents",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'display_name' => 'Sales Analytics Agent',
'instructions' => 'You are a helpful sales analytics agent. Answer questions about sales data clearly and concisely.',
'llm_model' => 'claude-sonnet-4-6',
'tools' => [
],
'datasources' => [
'ds_abc123'
],
'execution_policy' => [
'datasources' => [
'ds_abc123' => [
'tables' => [
'filter' => [
'table.__name__' => [
'$in' => [
'orders',
'customers'
]
],
'orders.region' => [
'$eq' => 'EU'
]
],
'hidden_columns' => [
'customers' => [
'ssn',
'credit_card'
]
]
],
'documents' => [
'filter' => [
'data_element.__id__' => [
'$in' => [
'de_abc',
'de_def'
]
]
]
]
],
'ds_xyz789' => [
'disabled' => true
]
],
'tools' => [
'send_email' => [
'variables' => [
'to' => [
'$eq' => 'support@acme.com'
],
'max_attachments' => [
'$lte' => 3
]
]
],
'web_search' => [
'disabled' => true
]
]
],
'execution_policy_ids' => [
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"Meibel-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.post("https://api.meibel.ai/v2/agents")
.header("Meibel-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"display_name\": \"Sales Analytics Agent\",\n \"instructions\": \"You are a helpful sales analytics agent. Answer questions about sales data clearly and concisely.\",\n \"llm_model\": \"claude-sonnet-4-6\",\n \"tools\": [],\n \"datasources\": [\n \"ds_abc123\"\n ],\n \"execution_policy\": {\n \"datasources\": {\n \"ds_abc123\": {\n \"tables\": {\n \"filter\": {\n \"table.__name__\": {\n \"$in\": [\n \"orders\",\n \"customers\"\n ]\n },\n \"orders.region\": {\n \"$eq\": \"EU\"\n }\n },\n \"hidden_columns\": {\n \"customers\": [\n \"ssn\",\n \"credit_card\"\n ]\n }\n },\n \"documents\": {\n \"filter\": {\n \"data_element.__id__\": {\n \"$in\": [\n \"de_abc\",\n \"de_def\"\n ]\n }\n }\n }\n },\n \"ds_xyz789\": {\n \"disabled\": true\n }\n },\n \"tools\": {\n \"send_email\": {\n \"variables\": {\n \"to\": {\n \"$eq\": \"support@acme.com\"\n },\n \"max_attachments\": {\n \"$lte\": 3\n }\n }\n },\n \"web_search\": {\n \"disabled\": true\n }\n }\n },\n \"execution_policy_ids\": []\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.meibel.ai/v2/agents")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Meibel-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"display_name\": \"Sales Analytics Agent\",\n \"instructions\": \"You are a helpful sales analytics agent. Answer questions about sales data clearly and concisely.\",\n \"llm_model\": \"claude-sonnet-4-6\",\n \"tools\": [],\n \"datasources\": [\n \"ds_abc123\"\n ],\n \"execution_policy\": {\n \"datasources\": {\n \"ds_abc123\": {\n \"tables\": {\n \"filter\": {\n \"table.__name__\": {\n \"$in\": [\n \"orders\",\n \"customers\"\n ]\n },\n \"orders.region\": {\n \"$eq\": \"EU\"\n }\n },\n \"hidden_columns\": {\n \"customers\": [\n \"ssn\",\n \"credit_card\"\n ]\n }\n },\n \"documents\": {\n \"filter\": {\n \"data_element.__id__\": {\n \"$in\": [\n \"de_abc\",\n \"de_def\"\n ]\n }\n }\n }\n },\n \"ds_xyz789\": {\n \"disabled\": true\n }\n },\n \"tools\": {\n \"send_email\": {\n \"variables\": {\n \"to\": {\n \"$eq\": \"support@acme.com\"\n },\n \"max_attachments\": {\n \"$lte\": 3\n }\n }\n },\n \"web_search\": {\n \"disabled\": true\n }\n }\n },\n \"execution_policy_ids\": []\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"name": "<string>",
"display_name": "<string>",
"version": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Agents
Create Agent
POST
/
agents
Python
import os
from meibel import MeibelClient
from meibel.models import CreateAgentDefinitionRequest, AgentToolDefinition
client = MeibelClient(api_key=os.environ["MEIBEL_API_KEY"])
request = CreateAgentDefinitionRequest(
display_name="Support Assistant",
instructions="You are a helpful support assistant. Answer customer questions using the provided knowledge base.",
description="Handles tier-1 customer support inquiries",
llm_model="gpt-4o",
fallback_models=["gpt-4o-mini"],
datasources=["ds_support_kb_001"],
tools=[
AgentToolDefinition(
name="knowledge_base_search",
type="rag_search",
description="Search the support knowledge base for relevant articles",
config={"datasource_id": "ds_support_kb_001"},
use_for=["answering product questions"],
avoid_for=["billing disputes"],
)
],
temperature=0.3,
max_tokens=1024,
tags=["support", "customer-facing"],
icon="headset",
)
agent = client.agents.create(request)
print(f"{agent.display_name} ({agent.id}) v{agent.version}")import { MeibelClient } from "meibel";
const client = new MeibelClient({ apiKey: process.env.MEIBEL_API_KEY });
const agent = await client.agents.create({
display_name: "Customer Support Agent",
instructions:
"You are a helpful customer support agent for Acme Corp. Answer questions using the provided knowledge base and escalate billing issues to a human.",
description: "Handles tier-1 customer support inquiries",
llm_model: "gpt-4o",
fallback_models: ["gpt-4o-mini"],
datasources: ["ds_support_kb_001"],
tools: [
{
name: "search_knowledge_base",
type: "rag_search",
description: "Search the support knowledge base for relevant articles",
config: { datasource_id: "ds_support_kb_001" },
use_for: ["answering product questions"],
avoid_for: ["billing disputes"],
},
],
execution_policy: {
datasources: {
ds_support_kb_001: {
documents: {
filter: { document_type: { $eq: "public" } },
},
},
},
tools: {
search_knowledge_base: {
disabled: false,
},
},
},
temperature: 0.3,
max_tokens: 1024,
tags: ["support", "customer-facing"],
});
console.log(`${agent.display_name} (${agent.id}) v${agent.version}`);package main
import (
"context"
"fmt"
"os"
v2 "github.com/meibel-ai/meibel-go/v2"
)
func main() {
client := v2.NewClient(v2.WithAPIKey(os.Getenv("MEIBEL_API_KEY")))
agent, err := client.Agents.Create(context.Background(), v2.CreateAgentDefinitionRequest{
DisplayName: "Customer Support Agent",
Instructions: "You are a helpful customer support agent for Acme Corp. Answer questions using the provided knowledge base and escalate when unsure.",
LlmModel: v2.String("gpt-4o"),
Datasources: []string{"ds_support_kb_001"},
Tools: []v2.AgentToolDefinition{
{
Name: "kb_search",
Type: "rag_search",
Description: v2.String("Search the support knowledge base for relevant articles"),
Config: map[string]any{
"datasource_id": "ds_support_kb_001",
},
UseFor: []string{"answering product questions", "troubleshooting issues"},
},
},
Temperature: v2.Float64(0.3),
MaxTokens: v2.Int(2048),
Tags: []string{"support", "production"},
})
if err != nil {
panic(err)
}
fmt.Printf("Created agent %s (%s), version %s\n", agent.DisplayName, agent.ID, agent.Version)
}curl --request POST \
--url https://api.meibel.ai/v2/agents \
--header 'Content-Type: application/json' \
--header 'Meibel-API-Key: <api-key>' \
--data '
{
"display_name": "Sales Analytics Agent",
"instructions": "You are a helpful sales analytics agent. Answer questions about sales data clearly and concisely.",
"llm_model": "claude-sonnet-4-6",
"tools": [],
"datasources": [
"ds_abc123"
],
"execution_policy": {
"datasources": {
"ds_abc123": {
"tables": {
"filter": {
"table.__name__": {
"$in": [
"orders",
"customers"
]
},
"orders.region": {
"$eq": "EU"
}
},
"hidden_columns": {
"customers": [
"ssn",
"credit_card"
]
}
},
"documents": {
"filter": {
"data_element.__id__": {
"$in": [
"de_abc",
"de_def"
]
}
}
}
},
"ds_xyz789": {
"disabled": true
}
},
"tools": {
"send_email": {
"variables": {
"to": {
"$eq": "support@acme.com"
},
"max_attachments": {
"$lte": 3
}
}
},
"web_search": {
"disabled": true
}
}
},
"execution_policy_ids": []
}
'const options = {
method: 'POST',
headers: {'Meibel-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
display_name: 'Sales Analytics Agent',
instructions: 'You are a helpful sales analytics agent. Answer questions about sales data clearly and concisely.',
llm_model: 'claude-sonnet-4-6',
tools: [],
datasources: ['ds_abc123'],
execution_policy: {
datasources: {
ds_abc123: {
tables: {
filter: {'table.__name__': {$in: ['orders', 'customers']}, 'orders.region': {$eq: 'EU'}},
hidden_columns: {customers: ['ssn', 'credit_card']}
},
documents: {filter: {'data_element.__id__': {$in: ['de_abc', 'de_def']}}}
},
ds_xyz789: {disabled: true}
},
tools: {
send_email: {variables: {to: {$eq: 'support@acme.com'}, max_attachments: {$lte: 3}}},
web_search: {disabled: true}
}
},
execution_policy_ids: []
})
};
fetch('https://api.meibel.ai/v2/agents', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.meibel.ai/v2/agents",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'display_name' => 'Sales Analytics Agent',
'instructions' => 'You are a helpful sales analytics agent. Answer questions about sales data clearly and concisely.',
'llm_model' => 'claude-sonnet-4-6',
'tools' => [
],
'datasources' => [
'ds_abc123'
],
'execution_policy' => [
'datasources' => [
'ds_abc123' => [
'tables' => [
'filter' => [
'table.__name__' => [
'$in' => [
'orders',
'customers'
]
],
'orders.region' => [
'$eq' => 'EU'
]
],
'hidden_columns' => [
'customers' => [
'ssn',
'credit_card'
]
]
],
'documents' => [
'filter' => [
'data_element.__id__' => [
'$in' => [
'de_abc',
'de_def'
]
]
]
]
],
'ds_xyz789' => [
'disabled' => true
]
],
'tools' => [
'send_email' => [
'variables' => [
'to' => [
'$eq' => 'support@acme.com'
],
'max_attachments' => [
'$lte' => 3
]
]
],
'web_search' => [
'disabled' => true
]
]
],
'execution_policy_ids' => [
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"Meibel-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.post("https://api.meibel.ai/v2/agents")
.header("Meibel-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"display_name\": \"Sales Analytics Agent\",\n \"instructions\": \"You are a helpful sales analytics agent. Answer questions about sales data clearly and concisely.\",\n \"llm_model\": \"claude-sonnet-4-6\",\n \"tools\": [],\n \"datasources\": [\n \"ds_abc123\"\n ],\n \"execution_policy\": {\n \"datasources\": {\n \"ds_abc123\": {\n \"tables\": {\n \"filter\": {\n \"table.__name__\": {\n \"$in\": [\n \"orders\",\n \"customers\"\n ]\n },\n \"orders.region\": {\n \"$eq\": \"EU\"\n }\n },\n \"hidden_columns\": {\n \"customers\": [\n \"ssn\",\n \"credit_card\"\n ]\n }\n },\n \"documents\": {\n \"filter\": {\n \"data_element.__id__\": {\n \"$in\": [\n \"de_abc\",\n \"de_def\"\n ]\n }\n }\n }\n },\n \"ds_xyz789\": {\n \"disabled\": true\n }\n },\n \"tools\": {\n \"send_email\": {\n \"variables\": {\n \"to\": {\n \"$eq\": \"support@acme.com\"\n },\n \"max_attachments\": {\n \"$lte\": 3\n }\n }\n },\n \"web_search\": {\n \"disabled\": true\n }\n }\n },\n \"execution_policy_ids\": []\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.meibel.ai/v2/agents")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Meibel-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"display_name\": \"Sales Analytics Agent\",\n \"instructions\": \"You are a helpful sales analytics agent. Answer questions about sales data clearly and concisely.\",\n \"llm_model\": \"claude-sonnet-4-6\",\n \"tools\": [],\n \"datasources\": [\n \"ds_abc123\"\n ],\n \"execution_policy\": {\n \"datasources\": {\n \"ds_abc123\": {\n \"tables\": {\n \"filter\": {\n \"table.__name__\": {\n \"$in\": [\n \"orders\",\n \"customers\"\n ]\n },\n \"orders.region\": {\n \"$eq\": \"EU\"\n }\n },\n \"hidden_columns\": {\n \"customers\": [\n \"ssn\",\n \"credit_card\"\n ]\n }\n },\n \"documents\": {\n \"filter\": {\n \"data_element.__id__\": {\n \"$in\": [\n \"de_abc\",\n \"de_def\"\n ]\n }\n }\n }\n },\n \"ds_xyz789\": {\n \"disabled\": true\n }\n },\n \"tools\": {\n \"send_email\": {\n \"variables\": {\n \"to\": {\n \"$eq\": \"support@acme.com\"\n },\n \"max_attachments\": {\n \"$lte\": 3\n }\n }\n },\n \"web_search\": {\n \"disabled\": true\n }\n }\n },\n \"execution_policy_ids\": []\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"name": "<string>",
"display_name": "<string>",
"version": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Authorizations
Body
application/json
Request model for creating a new agent definition.
Human-readable name of the agent (letters, numbers, and spaces only). Converted to kebab-case internally.
System prompt/instructions for the agent
Agent type
Description of the agent
LLM model to use
List of fallback models
Datasource IDs the agent has access to
Tools configuration
Show child attributes
Show child attributes
Catalog URNs of artifacts the agent produces
Confidence scoring module names to apply during execution
LLM temperature
Required range:
0 <= x <= 2Maximum tokens in response
Tags for categorization
UI icon identifier
Inline execution policy constraints (datasources, tools)
Show child attributes
Show child attributes
IDs of stored ExecutionPolicies to compose
Was this page helpful?
⌘I