Add agentic loops and MCP servers for responses grounded in real data
Take your support bot to the next level by adding Agentic Loops that can search your knowledge base, look up orders, check inventory, and provide responses grounded in real data. This intermediate guide builds on the basic support bot with tool-calling capabilities.
What You’ll Learn
By the end of this guide, you’ll be able to:
Understand how Agentic Loops enhance bot responses
Connect MCP servers to provide tools for your bot
Ground AI responses in real-time data
Handle complex support queries that require data lookups
Combine multiple tools for sophisticated workflows
Access to data sources you want the bot to query (optional)
Understanding Agentic Loops
Regular bots send messages to an AI integration and return the response. This works well for general questions, but falls short when you need to:
Search a knowledge base for specific information
Look up order status in a database
Check real-time inventory levels
Fetch current weather or other external data
Perform calculations or data transformations
Agentic Loops solve this by giving your AI access to tools (MCP servers) that can interact with external systems. The AI can decide when to use these tools, call them automatically, and incorporate the results into its response.
How It Works
User: "What's the status of order #12345?"1. Bot receives message → Integration processes → Identifies need for order lookup2. Integration calls Agentic Loop with user message3. Agentic Loop runs with access to MCP servers: - AI identifies it needs to look up order data - Calls HTTP MCP server to query order API - Receives order status data - Formats response with actual order information4. Response sent back through bot to userUser receives: "Order #12345 was shipped on Jan 15 via USPS.Tracking: 9400123456789. Estimated delivery: Jan 18."
Step 1: Create an Agentic Loop
1
Navigate to Agentic Loops
From your dashboard, click Agentic Loops in the sidebar.
2
Create New Loop
Click Create Agentic Loop.
Agentic Loops dashboard
3
Configure the Loop
Enter the following details:
Name: “Support Bot Knowledge Search”
Description: “Searches knowledge base for accurate support answers”
Max Iterations: 10 (allow up to 10 reasoning steps)
Create agentic loop form
4
Write System Prompt
Define the agent’s role and available tools:
You are a customer support assistant with access to toolsto search the knowledge base and look up real-time data.When a customer asks a question:1. Determine if you need to search for information2. Use the http tool to search the knowledge base API3. Use the search results to provide an accurate answer4. Cite sources when possibleGuidelines:- Always search the knowledge base before answering- If the knowledge base doesn't have the answer, say so- Never make up information- Keep responses concise and helpful
5
Add Initial User Message
This message starts the loop. You can leave it blank if the bot will provide the message dynamically:
{{user_message}}
This placeholder will be replaced with the actual user question when triggered from your bot.
6
Save the Loop
Click Create to save your agentic loop.
Step 2: Add MCP Servers
MCP servers provide tools that your agentic loop can use. Let’s add servers for common support scenarios.
1
Add HTTP Client Server
The HTTP Client MCP server allows the agent to make API calls.
In your agentic loop, go to the MCP Servers tab
Click Add MCP Server
Select HTTP Client
Configure access:
Allow all domains: Enable if your APIs are on different domains
Allowed domains: Or specify specific domains (e.g., api.yourcompany.com)
Click Add
MCP server configuration
2
Add Time Server (Optional)
If your bot needs to know the current time for date-based queries:
Click Add MCP Server
Select Time
Set timezone: America/New_York (or your timezone)
Click Add
3
Add Google Maps Server (Optional)
For location-based support (store locator, service areas):
Click Add MCP Server
Select Google Maps
Enter your Google Maps API key
Click Add
The agent will automatically see available tools from all connected MCP servers and decide when to use them based on the user’s question.
Step 3: Connect Loop to Your Bot
Now we need to modify your bot’s integration to use the agentic loop.
Option A: Update Existing Integration
Modify your webhook integration to call the agentic loop:
You have access to a knowledge base search tool via HTTP.To search the knowledge base:1. Use the http tool to POST to https://api.yourcompany.com/search-knowledge-base2. Send body: {"query": "user's question"}3. You'll receive relevant articles with titles, URLs, and excerptsExample workflow:User: "How do I reset my password?"Step 1: Search knowledge basePOST https://api.yourcompany.com/search-knowledge-baseBody: {"query": "reset password"}Step 2: Get results like:[{ "title": "Password Reset Guide", "url": "https://help.yourcompany.com/password-reset", "excerpt": "To reset your password, click 'Forgot Password'..."}]Step 3: Provide answer based on results:"To reset your password, click the 'Forgot Password' link on the loginpage. You can find detailed instructions here: [Password Reset Guide](https://help.yourcompany.com/password-reset)"
Step 5: Test the Grounded Bot
1
Send a Knowledge Base Question
Ask something that requires searching your documentation:
User: How do I update my billing information?
2
Observe the Agent Working
The agentic loop will:
Receive the question
Decide it needs to search the knowledge base
Call the HTTP tool to search
Receive search results
Format a response with accurate information
Return the answer to the user
3
Check the Logs
View the loop execution logs to see:
Number of iterations used
Which tools were called
API responses received
Agent’s reasoning process
Loop execution logs
4
Verify Accuracy
Confirm the response includes:
Accurate information from your knowledge base
Links to relevant documentation
No hallucinated or made-up information
Advanced Patterns
Pattern 1: Multi-Step Order Lookup
Handle complex queries that require multiple API calls:
User: "I ordered a blue shirt last week. Has it shipped?"Agent workflow:1. Extract: product="blue shirt", timeframe="last week"2. Call API: GET /api/orders?user_id=123&product_type=shirt&color=blue3. Filter results by date (last 7 days)4. For matching order, call: GET /api/orders/{id}/shipping5. Format response with order number, status, and tracking
Pattern 2: Inventory Check
Check product availability before answering:
User: "Do you have the XL red hoodie in stock?"Agent workflow:1. Parse: size="XL", color="red", product="hoodie"2. Call API: GET /api/inventory?sku=hoodie-red-xl3. Check quantity > 04. Respond with availability and estimated delivery
Pattern 3: Context-Aware Support
Use conversation history to provide better answers:
User: "I bought a laptop last month"Bot: "Great! How can I help with your laptop?"User: "It won't turn on"Bot: *Searches knowledge base for "laptop won't turn on"* *Finds troubleshooting guide* "Let's troubleshoot this. First, please try these steps: 1. Check if the charging cable is connected 2. Hold the power button for 10 seconds..."
API Examples
Execute an agentic loop
cURL
JavaScript
PHP
Python
curl -X POST https://api.chatbotplatform.io/v1/agentic-loops/loop_123/execute \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "user_message": "What is the status of order #12345?", "conversation_id": "conv_456" }'
const response = await fetch( 'https://api.chatbotplatform.io/v1/agentic-loops/loop_123/execute', { method: 'POST', headers: { 'Authorization': 'Bearer YOUR_API_KEY', 'Content-Type': 'application/json' }, body: JSON.stringify({ user_message: 'What is the status of order #12345?', conversation_id: 'conv_456' }) });const result = await response.json();console.log('Response:', result.final_response);console.log('Iterations:', result.iterations);
$response = Http::withToken('YOUR_API_KEY') ->post('https://api.chatbotplatform.io/v1/agentic-loops/loop_123/execute', [ 'user_message' => 'What is the status of order #12345?', 'conversation_id' => 'conv_456' ]);$result = $response->json();
response = requests.post( 'https://api.chatbotplatform.io/v1/agentic-loops/loop_123/execute', headers={'Authorization': 'Bearer YOUR_API_KEY'}, json={ 'user_message': 'What is the status of order #12345?', 'conversation_id': 'conv_456' })result = response.json()print('Response:', result['final_response'])
If an API returns an error:- Try once more- If it fails again, apologize and tell the user to contact support- Never expose error details to users
Set Response Format:
Always format responses as:1. Direct answer to the user's question2. Supporting details if helpful3. Link to documentation if available4. Ask if they need anything else
Troubleshooting
Loop times out before completing
Cause: Too many iterations needed or slow API callsSolutions:
Increase max iterations
Optimize your API endpoints for speed
Simplify the agent’s task
Cache frequently accessed data
Agent doesn’t use tools
Cause: System prompt doesn’t clearly explain when/how to use toolsSolutions:
Add explicit instructions about tool usage
Provide examples in the system prompt
Test with questions that definitely require tool usage
Check MCP server logs for errors
Responses are inaccurate
Cause: Agent may be hallucinating or misinterpreting API responsesSolutions:
Tell agent to only use information from API responses
Add explicit instruction to say “I don’t know” when unsure
Format API responses more clearly
Review execution logs to see what data agent received
API calls fail
Cause: Authentication issues, rate limits, or incorrect endpointsSolutions:
{"docsConfig":{"theme":"maple","$schema":"https://mintlify.com/docs.json","name":"Chatbot Platform Documentation","colors":{"primary":"#6366F1"},"footer":{},"styling":{"latex":true},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"chatbotplatform","hasAudioNarration":false,"actualSubdomain":"chatbotplatform","customDomains":["docs.chatbotplatform.io"],"gitSource":{"type":"github","owner":"jonnx","repo":"docs.chatbotplatform.io","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"entitlements":{},"buildId":"6b09daf3bc2b2d94fb276943","clientVersion":"0.0.4342","searchFilterCounts":[{"language":"default","tag":"Bots","count":40},{"language":"default","tag":"Guides","count":16},{"language":"default","tag":"MCP Servers","count":12},{"language":"default","tag":"Agentic Loops","count":10},{"language":"default","tag":"Channels","count":8},{"language":"default","tag":"Behaviors","count":3},{"language":"default","tag":"Conversations","count":3},{"language":"default","tag":"Integrations","count":3},{"language":"default","tag":"Getting Started","count":2}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-rbac-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"site-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"starter-pricing","enabled":true,"variant":{"name":"treatment","enabled":true,"payload":{"type":"string","value":"treatment"},"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"wildcard-email-auth","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"starterQuestions":[],"googleFontsInlined":false},"customCss":[]}
{"page":{"pagePath":"guides/grounded-support-bot","slug":"/guides/grounded-support-bot","pageMetadata":{"title":"Building a Grounded Support Bot","description":"Add agentic loops and MCP servers for responses grounded in real data","href":"/guides/grounded-support-bot"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Add agentic loops and MCP servers for responses grounded in real data\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,li:`li`,ol:`ol`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,ul:`ul`,..._provideComponents(),...props.components},{Accordion,AccordionGroup,Callout,Card,CardGroup,CodeBlock,Frame,Heading,OptimizedImage,Step,Steps,Tab,Tabs}=_components;if(!Accordion)_missingMdxReference(`Accordion`,true);if(!AccordionGroup)_missingMdxReference(`AccordionGroup`,true);if(!Callout)_missingMdxReference(`Callout`,true);if(!Card)_missingMdxReference(`Card`,true);if(!CardGroup)_missingMdxReference(`CardGroup`,true);if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Frame)_missingMdxReference(`Frame`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!OptimizedImage)_missingMdxReference(`OptimizedImage`,true);if(!Step)_missingMdxReference(`Step`,true);if(!Steps)_missingMdxReference(`Steps`,true);if(!Tab)_missingMdxReference(`Tab`,true);if(!Tabs)_missingMdxReference(`Tabs`,true);return _jsxs(_Fragment,{children:[_jsx(_components.p,{children:`Take your support bot to the next level by adding Agentic Loops that can search your knowledge base, look up orders, check inventory, and provide responses grounded in real data. This intermediate guide builds on the basic support bot with tool-calling capabilities.`}),`\n`,_jsx(Heading,{level:`2`,id:`what-you’ll-learn`,children:`What You’ll Learn`}),`\n`,_jsx(_components.p,{children:`By the end of this guide, you’ll be able to:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`Understand how Agentic Loops enhance bot responses`}),`\n`,_jsx(_components.li,{children:`Connect MCP servers to provide tools for your bot`}),`\n`,_jsx(_components.li,{children:`Ground AI responses in real-time data`}),`\n`,_jsx(_components.li,{children:`Handle complex support queries that require data lookups`}),`\n`,_jsx(_components.li,{children:`Combine multiple tools for sophisticated workflows`}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`prerequisites`,children:`Prerequisites`}),`\n`,_jsx(_components.p,{children:`Before starting, you should have:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`Completed the `,_jsx(_components.a,{href:`/guides/support-bot-basics`,children:`Basic Support Bot`}),` guide`]}),`\n`,_jsx(_components.li,{children:`A working bot connected to at least one channel`}),`\n`,_jsx(_components.li,{children:`Basic understanding of APIs and webhooks`}),`\n`,_jsx(_components.li,{children:`Access to data sources you want the bot to query (optional)`}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`understanding-agentic-loops`,children:`Understanding Agentic Loops`}),`\n`,_jsx(_components.p,{children:`Regular bots send messages to an AI integration and return the response. This works well for general questions, but falls short when you need to:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`Search a knowledge base for specific information`}),`\n`,_jsx(_components.li,{children:`Look up order status in a database`}),`\n`,_jsx(_components.li,{children:`Check real-time inventory levels`}),`\n`,_jsx(_components.li,{children:`Fetch current weather or other external data`}),`\n`,_jsx(_components.li,{children:`Perform calculations or data transformations`}),`\n`]}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Agentic Loops`}),` solve this by giving your AI access to tools (MCP servers) that can interact with external systems. The AI can decide when to use these tools, call them automatically, and incorporate the results into its response.`]}),`\n`,_jsx(Heading,{level:`3`,id:`how-it-works`,children:`How It Works`}),`\n`,_jsx(CodeBlock,{numberOfLines:`14`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`14`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`User: \"What's the status of order #12345?\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`1. Bot receives message → Integration processes → Identifies need for order lookup`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`2. Integration calls Agentic Loop with user message`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`3. Agentic Loop runs with access to MCP servers:`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` - AI identifies it needs to look up order data`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` - Calls HTTP MCP server to query order API`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` - Receives order status data`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` - Formats response with actual order information`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`4. Response sent back through bot to user`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`User receives: \"Order #12345 was shipped on Jan 15 via USPS.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`Tracking: 9400123456789. Estimated delivery: Jan 18.\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsx(Heading,{level:`2`,id:`step-1-create-an-agentic-loop`,children:`Step 1: Create an Agentic Loop`}),`\n`,_jsxs(Steps,{children:[_jsx(Step,{title:`Navigate to Agentic Loops`,children:_jsxs(_components.p,{children:[`From your dashboard, click `,_jsx(_components.strong,{children:`Agentic Loops`}),` in the sidebar.`]})}),_jsxs(Step,{title:`Create New Loop`,children:[_jsxs(_components.p,{children:[`Click `,_jsx(_components.strong,{children:`Create Agentic Loop`}),`.`]}),_jsx(Frame,{caption:`Agentic Loops dashboard`,children:_jsx(OptimizedImage,{src:`https://mintlify.s3.us-west-1.amazonaws.com/chatbotplatform/images/screenshots/04-agentic/01_loops_index.png`,alt:`Agentic loops list`})})]}),_jsxs(Step,{title:`Configure the Loop`,children:[_jsx(_components.p,{children:`Enter the following details:`}),_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Name`}),`: “Support Bot Knowledge Search”`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Description`}),`: “Searches knowledge base for accurate support answers”`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Max Iterations`}),`: 10 (allow up to 10 reasoning steps)`]}),`\n`]}),_jsx(Frame,{caption:`Create agentic loop form`,children:_jsx(OptimizedImage,{src:`https://mintlify.s3.us-west-1.amazonaws.com/chatbotplatform/images/screenshots/04-agentic/02_create_loop_form.png`,alt:`Create loop form`})})]}),_jsxs(Step,{title:`Write System Prompt`,children:[_jsx(_components.p,{children:`Define the agent’s role and available tools:`}),_jsx(CodeBlock,{numberOfLines:`15`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`15`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`You are a customer support assistant with access to tools`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`to search the knowledge base and look up real-time data.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`When a customer asks a question:`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`1. Determine if you need to search for information`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`2. Use the http tool to search the knowledge base API`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`3. Use the search results to provide an accurate answer`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`4. Cite sources when possible`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`Guidelines:`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Always search the knowledge base before answering`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- If the knowledge base doesn't have the answer, say so`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Never make up information`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Keep responses concise and helpful`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})})]}),_jsxs(Step,{title:`Add Initial User Message`,children:[_jsx(_components.p,{children:`This message starts the loop. You can leave it blank if the bot will provide the message dynamically:`}),_jsx(CodeBlock,{numberOfLines:`2`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`2`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`{{user_message}}`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),_jsx(_components.p,{children:`This placeholder will be replaced with the actual user question when triggered from your bot.`})]}),_jsx(Step,{title:`Save the Loop`,children:_jsxs(_components.p,{children:[`Click `,_jsx(_components.strong,{children:`Create`}),` to save your agentic loop.`]})})]}),`\n`,_jsx(Heading,{level:`2`,id:`step-2-add-mcp-servers`,children:`Step 2: Add MCP Servers`}),`\n`,_jsx(_components.p,{children:`MCP servers provide tools that your agentic loop can use. Let’s add servers for common support scenarios.`}),`\n`,_jsxs(Steps,{children:[_jsxs(Step,{title:`Add HTTP Client Server`,children:[_jsx(_components.p,{children:`The HTTP Client MCP server allows the agent to make API calls.`}),_jsxs(_components.ol,{children:[`\n`,_jsxs(_components.li,{children:[`In your agentic loop, go to the `,_jsx(_components.strong,{children:`MCP Servers`}),` tab`]}),`\n`,_jsxs(_components.li,{children:[`Click `,_jsx(_components.strong,{children:`Add MCP Server`})]}),`\n`,_jsxs(_components.li,{children:[`Select `,_jsx(_components.strong,{children:`HTTP Client`})]}),`\n`,_jsxs(_components.li,{children:[`Configure access:`,`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Allow all domains`}),`: Enable if your APIs are on different domains`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Allowed domains`}),`: Or specify specific domains (e.g., `,_jsx(_components.code,{children:`api.yourcompany.com`}),`)`]}),`\n`]}),`\n`]}),`\n`,_jsxs(_components.li,{children:[`Click `,_jsx(_components.strong,{children:`Add`})]}),`\n`]}),_jsx(Frame,{caption:`MCP server configuration`,children:_jsx(OptimizedImage,{src:`https://mintlify.s3.us-west-1.amazonaws.com/chatbotplatform/images/screenshots/04-agentic/03_mcp_server_config.png`,alt:`MCP server setup`})})]}),_jsxs(Step,{title:`Add Time Server (Optional)`,children:[_jsx(_components.p,{children:`If your bot needs to know the current time for date-based queries:`}),_jsxs(_components.ol,{children:[`\n`,_jsxs(_components.li,{children:[`Click `,_jsx(_components.strong,{children:`Add MCP Server`})]}),`\n`,_jsxs(_components.li,{children:[`Select `,_jsx(_components.strong,{children:`Time`})]}),`\n`,_jsxs(_components.li,{children:[`Set timezone: `,_jsx(_components.code,{children:`America/New_York`}),` (or your timezone)`]}),`\n`,_jsxs(_components.li,{children:[`Click `,_jsx(_components.strong,{children:`Add`})]}),`\n`]})]}),_jsxs(Step,{title:`Add Google Maps Server (Optional)`,children:[_jsx(_components.p,{children:`For location-based support (store locator, service areas):`}),_jsxs(_components.ol,{children:[`\n`,_jsxs(_components.li,{children:[`Click `,_jsx(_components.strong,{children:`Add MCP Server`})]}),`\n`,_jsxs(_components.li,{children:[`Select `,_jsx(_components.strong,{children:`Google Maps`})]}),`\n`,_jsx(_components.li,{children:`Enter your Google Maps API key`}),`\n`,_jsxs(_components.li,{children:[`Click `,_jsx(_components.strong,{children:`Add`})]}),`\n`]})]})]}),`\n`,_jsx(Callout,{type:`info`,children:_jsx(_components.p,{children:`The agent will automatically see available tools from all connected MCP servers and decide when to use them based on the user’s question.`})}),`\n`,_jsx(Heading,{level:`2`,id:`step-3-connect-loop-to-your-bot`,children:`Step 3: Connect Loop to Your Bot`}),`\n`,_jsx(_components.p,{children:`Now we need to modify your bot’s integration to use the agentic loop.`}),`\n`,_jsx(Heading,{level:`3`,id:`option-a-update-existing-integration`,children:`Option A: Update Existing Integration`}),`\n`,_jsx(_components.p,{children:`Modify your webhook integration to call the agentic loop:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`32`,language:`javascript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`javascript`,children:_jsxs(_components.code,{language:`javascript`,numberOfLines:`32`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// Your integration endpoint`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`app`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`post`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'/support-bot'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`async`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`req`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`res`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`=>`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` const`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:`messages`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:`conversation_id`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:`user`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` } `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` req`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`body`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` userMessage`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` messages`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`[`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`messages`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#9CDCFE`},children:`length`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` -`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 1`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`].`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`content`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` // Call Chatbot Platform Agentic Loop API`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` loopResponse`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` fetch`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'https://api.chatbotplatform.io/v1/agentic-loops/loop_123/execute'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` method:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'POST'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` headers:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'Authorization'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'Bearer YOUR_API_KEY'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'Content-Type'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'application/json'`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` body:`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` JSON`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`stringify`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` user_message:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` userMessage`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` conversation_id:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` conversation_id`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` })`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` );`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` result`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` loopResponse`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`json`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`();`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` // Return the agent's response`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` res`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`json`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` content:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` result`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`final_response`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` metadata:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` iterations_used:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` result`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`iterations`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` tools_called:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` result`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`tools_used`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` });`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`});`})}),`\n`]})})}),`\n`,_jsx(Heading,{level:`3`,id:`option-b-use-agentic-loop-directly`,children:`Option B: Use Agentic Loop Directly`}),`\n`,_jsx(_components.p,{children:`Set the agentic loop as your bot’s integration:`}),`\n`,_jsxs(Steps,{children:[_jsxs(Step,{title:`Get Loop Webhook URL`,children:[_jsx(_components.p,{children:`Copy the webhook URL from your agentic loop settings:`}),_jsx(CodeBlock,{numberOfLines:`2`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`2`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`https://api.chatbotplatform.io/v1/agentic-loops/loop_123/webhook`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})})]}),_jsxs(Step,{title:`Create New Integration`,children:[_jsx(_components.p,{children:`In your bot’s Integrations tab:`}),_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Name`}),`: “Agentic Support Loop”`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Webhook URL`}),`: Paste the loop webhook URL`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Headers`}),`: Add authentication`]}),`\n`]}),_jsx(CodeBlock,{numberOfLines:`2`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`2`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`Authorization: Bearer YOUR_API_KEY`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})})]}),_jsx(Step,{title:`Set as Primary`,children:_jsx(_components.p,{children:`Set this integration’s weight to 100 to use it for all messages.`})})]}),`\n`,_jsx(Heading,{level:`2`,id:`step-4-create-knowledge-base-search`,children:`Step 4: Create Knowledge Base Search`}),`\n`,_jsx(_components.p,{children:`To search your knowledge base, you’ll need an API endpoint that the agent can call.`}),`\n`,_jsx(Heading,{level:`3`,id:`example-search-api`,children:`Example: Search API`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`17`,language:`javascript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`javascript`,children:_jsxs(_components.code,{language:`javascript`,numberOfLines:`17`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// Your knowledge base search API`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`app`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`post`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'/api/search-knowledge-base'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`async`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`req`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`res`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`=>`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` const`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:`query`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` } `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` req`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`body`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` // Search your documentation`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` results`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` searchDocs`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`query`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` // Return relevant articles`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` res`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`json`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` results:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` results`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`map`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`doc`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` =>`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ({`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` title:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` doc`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`title`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` url:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` doc`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`url`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` excerpt:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` doc`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`excerpt`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` relevance:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` doc`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`score`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }))`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` });`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`});`})}),`\n`]})})}),`\n`,_jsx(Heading,{level:`3`,id:`update-system-prompt`,children:`Update System Prompt`}),`\n`,_jsx(_components.p,{children:`Tell the agent how to use this API:`}),`\n`,_jsx(CodeBlock,{numberOfLines:`26`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`26`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`You have access to a knowledge base search tool via HTTP.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`To search the knowledge base:`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`1. Use the http tool to POST to https://api.yourcompany.com/search-knowledge-base`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`2. Send body: {\"query\": \"user's question\"}`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`3. You'll receive relevant articles with titles, URLs, and excerpts`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`Example workflow:`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`User: \"How do I reset my password?\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`Step 1: Search knowledge base`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`POST https://api.yourcompany.com/search-knowledge-base`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`Body: {\"query\": \"reset password\"}`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`Step 2: Get results like:`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`[{`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` \"title\": \"Password Reset Guide\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` \"url\": \"https://help.yourcompany.com/password-reset\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` \"excerpt\": \"To reset your password, click 'Forgot Password'...\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`}]`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`Step 3: Provide answer based on results:`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`\"To reset your password, click the 'Forgot Password' link on the login`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`page. You can find detailed instructions here: [Password Reset Guide]`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`(https://help.yourcompany.com/password-reset)\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsx(Heading,{level:`2`,id:`step-5-test-the-grounded-bot`,children:`Step 5: Test the Grounded Bot`}),`\n`,_jsxs(Steps,{children:[_jsxs(Step,{title:`Send a Knowledge Base Question`,children:[_jsx(_components.p,{children:`Ask something that requires searching your documentation:`}),_jsx(CodeBlock,{numberOfLines:`2`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`2`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`User: How do I update my billing information?`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})})]}),_jsxs(Step,{title:`Observe the Agent Working`,children:[_jsx(_components.p,{children:`The agentic loop will:`}),_jsxs(_components.ol,{children:[`\n`,_jsx(_components.li,{children:`Receive the question`}),`\n`,_jsx(_components.li,{children:`Decide it needs to search the knowledge base`}),`\n`,_jsx(_components.li,{children:`Call the HTTP tool to search`}),`\n`,_jsx(_components.li,{children:`Receive search results`}),`\n`,_jsx(_components.li,{children:`Format a response with accurate information`}),`\n`,_jsx(_components.li,{children:`Return the answer to the user`}),`\n`]})]}),_jsxs(Step,{title:`Check the Logs`,children:[_jsx(_components.p,{children:`View the loop execution logs to see:`}),_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`Number of iterations used`}),`\n`,_jsx(_components.li,{children:`Which tools were called`}),`\n`,_jsx(_components.li,{children:`API responses received`}),`\n`,_jsx(_components.li,{children:`Agent’s reasoning process`}),`\n`]}),_jsx(Frame,{caption:`Loop execution logs`,children:_jsx(OptimizedImage,{src:`https://mintlify.s3.us-west-1.amazonaws.com/chatbotplatform/images/screenshots/04-agentic/04_loop_logs.png`,alt:`Execution logs`})})]}),_jsxs(Step,{title:`Verify Accuracy`,children:[_jsx(_components.p,{children:`Confirm the response includes:`}),_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`Accurate information from your knowledge base`}),`\n`,_jsx(_components.li,{children:`Links to relevant documentation`}),`\n`,_jsx(_components.li,{children:`No hallucinated or made-up information`}),`\n`]})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`advanced-patterns`,children:`Advanced Patterns`}),`\n`,_jsx(Heading,{level:`3`,id:`pattern-1-multi-step-order-lookup`,children:`Pattern 1: Multi-Step Order Lookup`}),`\n`,_jsx(_components.p,{children:`Handle complex queries that require multiple API calls:`}),`\n`,_jsx(CodeBlock,{numberOfLines:`9`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`9`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`User: \"I ordered a blue shirt last week. Has it shipped?\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`Agent workflow:`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`1. Extract: product=\"blue shirt\", timeframe=\"last week\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`2. Call API: GET /api/orders?user_id=123\u0026product_type=shirt\u0026color=blue`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`3. Filter results by date (last 7 days)`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`4. For matching order, call: GET /api/orders/{id}/shipping`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`5. Format response with order number, status, and tracking`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsx(Heading,{level:`3`,id:`pattern-2-inventory-check`,children:`Pattern 2: Inventory Check`}),`\n`,_jsx(_components.p,{children:`Check product availability before answering:`}),`\n`,_jsx(CodeBlock,{numberOfLines:`8`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`8`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`User: \"Do you have the XL red hoodie in stock?\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`Agent workflow:`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`1. Parse: size=\"XL\", color=\"red\", product=\"hoodie\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`2. Call API: GET /api/inventory?sku=hoodie-red-xl`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`3. Check quantity > 0`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`4. Respond with availability and estimated delivery`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsx(Heading,{level:`3`,id:`pattern-3-context-aware-support`,children:`Pattern 3: Context-Aware Support`}),`\n`,_jsx(_components.p,{children:`Use conversation history to provide better answers:`}),`\n`,_jsx(CodeBlock,{numberOfLines:`10`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`10`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`User: \"I bought a laptop last month\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`Bot: \"Great! How can I help with your laptop?\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`User: \"It won't turn on\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`Bot: *Searches knowledge base for \"laptop won't turn on\"*`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` *Finds troubleshooting guide*`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` \"Let's troubleshoot this. First, please try these steps:`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` 1. Check if the charging cable is connected`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` 2. Hold the power button for 10 seconds...\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsx(Heading,{level:`2`,id:`api-examples`,children:`API Examples`}),`\n`,_jsxs(AccordionGroup,{children:[_jsx(Accordion,{title:`Execute an agentic loop`,id:`execute-an-agentic-loop`,children:_jsxs(Tabs,{children:[_jsx(Tab,{title:`cURL`,id:`curl`,children:_jsx(CodeBlock,{filename:``,numberOfLines:`7`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`7`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -X`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` POST`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` https://api.chatbotplatform.io/v1/agentic-loops/loop_123/execute`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Authorization: Bearer YOUR_API_KEY\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Content-Type: application/json\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -d`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '{`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"user_message\": \"What is the status of order #12345?\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"conversation_id\": \"conv_456\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` }'`})}),`\n`]})})})}),_jsx(Tab,{title:`JavaScript`,id:`javascript`,children:_jsx(CodeBlock,{filename:``,numberOfLines:`18`,language:`javascript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`javascript`,children:_jsxs(_components.code,{language:`javascript`,numberOfLines:`18`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` response`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` fetch`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'https://api.chatbotplatform.io/v1/agentic-loops/loop_123/execute'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` method:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'POST'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` headers:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'Authorization'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'Bearer YOUR_API_KEY'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'Content-Type'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'application/json'`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` body:`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` JSON`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`stringify`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` user_message:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'What is the status of order #12345?'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` conversation_id:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'conv_456'`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` })`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` result`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` response`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`json`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`();`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`console`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`log`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'Response:'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`result`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`final_response`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`console`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`log`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'Iterations:'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`result`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`iterations`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`]})})})}),_jsx(Tab,{title:`PHP`,id:`php`,children:_jsx(CodeBlock,{filename:``,numberOfLines:`7`,language:`php`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`php`,children:_jsxs(_components.code,{language:`php`,numberOfLines:`7`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$response`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` Http`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`::`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`withToken`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'YOUR_API_KEY'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` ->`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`post`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'https://api.chatbotplatform.io/v1/agentic-loops/loop_123/execute'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, [`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'user_message'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =>`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'What is the status of order #12345?'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'conversation_id'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =>`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'conv_456'`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ]);`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$result`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` $response`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`json`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`();`})]}),`\n`]})})})}),_jsx(Tab,{title:`Python`,id:`python`,children:_jsx(CodeBlock,{filename:``,numberOfLines:`11`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`11`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`response `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` requests.post(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'https://api.chatbotplatform.io/v1/agentic-loops/loop_123/execute'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` headers`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'Authorization'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'Bearer YOUR_API_KEY'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`},`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` json`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'user_message'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'What is the status of order #12345?'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'conversation_id'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'conv_456'`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`result `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` response.json()`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`print`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'Response:'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, result[`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'final_response'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`])`})]}),`\n`]})})})})]})}),_jsx(Accordion,{title:`Get loop execution history`,id:`get-loop-execution-history`,children:_jsxs(Tabs,{children:[_jsx(Tab,{title:`cURL`,id:`curl-2`,children:_jsx(CodeBlock,{filename:``,numberOfLines:`2`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`2`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` https://api.chatbotplatform.io/v1/agentic-loops/loop_123/executions`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Authorization: Bearer YOUR_API_KEY\"`})]}),`\n`]})})})}),_jsx(Tab,{title:`JavaScript`,id:`javascript-2`,children:_jsx(CodeBlock,{filename:``,numberOfLines:`10`,language:`javascript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`javascript`,children:_jsxs(_components.code,{language:`javascript`,numberOfLines:`10`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` response`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` fetch`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'https://api.chatbotplatform.io/v1/agentic-loops/loop_123/executions'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` headers:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'Authorization'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'Bearer YOUR_API_KEY'`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` executions`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` response`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`json`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`();`})]}),`\n`]})})})}),_jsx(Tab,{title:`PHP`,id:`php-2`,children:_jsx(CodeBlock,{filename:``,numberOfLines:`3`,language:`php`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`php`,children:_jsxs(_components.code,{language:`php`,numberOfLines:`3`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$executions`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` Http`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`::`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`withToken`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'YOUR_API_KEY'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` ->`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`get`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'https://api.chatbotplatform.io/v1/agentic-loops/loop_123/executions'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` ->`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`json`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`();`})]}),`\n`]})})})}),_jsx(Tab,{title:`Python`,id:`python-2`,children:_jsx(CodeBlock,{filename:``,numberOfLines:`6`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`6`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`response `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` requests.get(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'https://api.chatbotplatform.io/v1/agentic-loops/loop_123/executions'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` headers`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'Authorization'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'Bearer YOUR_API_KEY'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`executions `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` response.json()`})]}),`\n`]})})})})]})})]}),`\n`,_jsxs(_components.p,{children:[`For complete API documentation, see the `,_jsx(_components.a,{href:`https://app.chatbotplatform.io/openapi`,children:`OpenAPI specification`}),`.`]}),`\n`,_jsx(Heading,{level:`2`,id:`best-practices`,children:`Best Practices`}),`\n`,_jsxs(CardGroup,{cols:2,children:[_jsx(Card,{title:`Clear Tool Instructions`,icon:`book`,children:_jsx(_components.p,{children:`Document exactly how to use each tool in the system prompt`})}),_jsx(Card,{title:`Error Handling`,icon:`shield-check`,children:_jsx(_components.p,{children:`Tell the agent what to do when API calls fail`})}),_jsx(Card,{title:`Limit Iterations`,icon:`gauge`,children:_jsx(_components.p,{children:`Set appropriate max iterations to prevent infinite loops`})}),_jsx(Card,{title:`Monitor Usage`,icon:`chart-line`,children:_jsx(_components.p,{children:`Track which tools are used most often and optimize`})})]}),`\n`,_jsx(Heading,{level:`3`,id:`system-prompt-tips`,children:`System Prompt Tips`}),`\n`,_jsx(_components.p,{children:_jsx(_components.strong,{children:`Be Explicit About APIs:`})}),`\n`,_jsx(CodeBlock,{numberOfLines:`5`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`5`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`To search orders:`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`POST https://api.yourcompany.com/orders/search`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`Headers: {\"Authorization\": \"Bearer {{API_KEY}}\"}`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`Body: {\"query\": \"search terms\", \"user_id\": \"{{user_id}}\"}`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsx(_components.p,{children:_jsx(_components.strong,{children:`Define Error Responses:`})}),`\n`,_jsx(CodeBlock,{numberOfLines:`5`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`5`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`If an API returns an error:`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Try once more`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- If it fails again, apologize and tell the user to contact support`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Never expose error details to users`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsx(_components.p,{children:_jsx(_components.strong,{children:`Set Response Format:`})}),`\n`,_jsx(CodeBlock,{numberOfLines:`6`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`6`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`Always format responses as:`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`1. Direct answer to the user's question`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`2. Supporting details if helpful`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`3. Link to documentation if available`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`4. Ask if they need anything else`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsx(Heading,{level:`2`,id:`troubleshooting`,children:`Troubleshooting`}),`\n`,_jsx(Heading,{level:`3`,id:`loop-times-out-before-completing`,children:`Loop times out before completing`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Cause:`}),` Too many iterations needed or slow API calls`]}),`\n`,_jsx(_components.p,{children:_jsx(_components.strong,{children:`Solutions:`})}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`Increase max iterations`}),`\n`,_jsx(_components.li,{children:`Optimize your API endpoints for speed`}),`\n`,_jsx(_components.li,{children:`Simplify the agent’s task`}),`\n`,_jsx(_components.li,{children:`Cache frequently accessed data`}),`\n`]}),`\n`,_jsx(Heading,{level:`3`,id:`agent-doesn’t-use-tools`,children:`Agent doesn’t use tools`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Cause:`}),` System prompt doesn’t clearly explain when/how to use tools`]}),`\n`,_jsx(_components.p,{children:_jsx(_components.strong,{children:`Solutions:`})}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`Add explicit instructions about tool usage`}),`\n`,_jsx(_components.li,{children:`Provide examples in the system prompt`}),`\n`,_jsx(_components.li,{children:`Test with questions that definitely require tool usage`}),`\n`,_jsx(_components.li,{children:`Check MCP server logs for errors`}),`\n`]}),`\n`,_jsx(Heading,{level:`3`,id:`responses-are-inaccurate`,children:`Responses are inaccurate`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Cause:`}),` Agent may be hallucinating or misinterpreting API responses`]}),`\n`,_jsx(_components.p,{children:_jsx(_components.strong,{children:`Solutions:`})}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`Tell agent to only use information from API responses`}),`\n`,_jsx(_components.li,{children:`Add explicit instruction to say “I don’t know” when unsure`}),`\n`,_jsx(_components.li,{children:`Format API responses more clearly`}),`\n`,_jsx(_components.li,{children:`Review execution logs to see what data agent received`}),`\n`]}),`\n`,_jsx(Heading,{level:`3`,id:`api-calls-fail`,children:`API calls fail`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Cause:`}),` Authentication issues, rate limits, or incorrect endpoints`]}),`\n`,_jsx(_components.p,{children:_jsx(_components.strong,{children:`Solutions:`})}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`Verify API credentials are correct`}),`\n`,_jsx(_components.li,{children:`Check allowed domains in MCP server settings`}),`\n`,_jsx(_components.li,{children:`Review API logs for specific errors`}),`\n`,_jsx(_components.li,{children:`Add retry logic for transient failures`}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`next-steps`,children:`Next Steps`}),`\n`,_jsxs(CardGroup,{cols:2,children:[_jsx(Card,{title:`Build a Personal Assistant`,icon:`user`,href:`/guides/personal-assistant`,children:_jsx(_components.p,{children:`Use multiple MCP servers for advanced workflows`})}),_jsx(Card,{title:`Deploy to Multiple Channels`,icon:`globe`,href:`/guides/multi-channel-deployment`,children:_jsx(_components.p,{children:`Use the same grounded bot across platforms`})}),_jsx(Card,{title:`MCP Server Reference`,icon:`server`,href:`/mcp-servers/overview`,children:_jsx(_components.p,{children:`Learn about all available MCP servers`})}),_jsx(Card,{title:`Agentic Loops Documentation`,icon:`rotate`,href:`/agentic-loops/overview`,children:_jsx(_components.p,{children:`Deep dive into agentic loop features`})})]}),`\n`,_jsx(Heading,{level:`2`,id:`related-documentation`,children:`Related Documentation`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.a,{href:`/agentic-loops/overview`,children:`Agentic Loops Overview`}),` - Core concepts and architecture`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.a,{href:`/mcp-servers/overview`,children:`MCP Servers`}),` - Available tools and how to build custom servers`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.a,{href:`/mcp-servers/building-servers`,children:`Building Custom MCP Servers`}),` - Create your own tools`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.a,{href:`https://app.chatbotplatform.io/openapi`,children:`API Reference`}),` - Complete API documentation`]}),`\n`]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Building a Grounded Support Bot","description":"Add agentic loops and MCP servers for responses grounded in real data","href":"/guides/grounded-support-bot"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"What You’ll Learn","slug":"what-you’ll-learn","depth":2,"children":[]},{"title":"Prerequisites","slug":"prerequisites","depth":2,"children":[]},{"title":"Understanding Agentic Loops","slug":"understanding-agentic-loops","depth":2,"children":[{"title":"How It Works","slug":"how-it-works","depth":3,"children":[]}]},{"title":"Step 1: Create an Agentic Loop","slug":"step-1-create-an-agentic-loop","depth":2,"children":[]},{"title":"Step 2: Add MCP Servers","slug":"step-2-add-mcp-servers","depth":2,"children":[]},{"title":"Step 3: Connect Loop to Your Bot","slug":"step-3-connect-loop-to-your-bot","depth":2,"children":[{"title":"Option A: Update Existing Integration","slug":"option-a-update-existing-integration","depth":3,"children":[]},{"title":"Option B: Use Agentic Loop Directly","slug":"option-b-use-agentic-loop-directly","depth":3,"children":[]}]},{"title":"Step 4: Create Knowledge Base Search","slug":"step-4-create-knowledge-base-search","depth":2,"children":[{"title":"Example: Search API","slug":"example-search-api","depth":3,"children":[]},{"title":"Update System Prompt","slug":"update-system-prompt","depth":3,"children":[]}]},{"title":"Step 5: Test the Grounded Bot","slug":"step-5-test-the-grounded-bot","depth":2,"children":[]},{"title":"Advanced Patterns","slug":"advanced-patterns","depth":2,"children":[{"title":"Pattern 1: Multi-Step Order Lookup","slug":"pattern-1-multi-step-order-lookup","depth":3,"children":[]},{"title":"Pattern 2: Inventory Check","slug":"pattern-2-inventory-check","depth":3,"children":[]},{"title":"Pattern 3: Context-Aware Support","slug":"pattern-3-context-aware-support","depth":3,"children":[]}]},{"title":"API Examples","slug":"api-examples","depth":2,"children":[]},{"title":"Best Practices","slug":"best-practices","depth":2,"children":[{"title":"System Prompt Tips","slug":"system-prompt-tips","depth":3,"children":[]}]},{"title":"Troubleshooting","slug":"troubleshooting","depth":2,"children":[{"title":"Loop times out before completing","slug":"loop-times-out-before-completing","depth":3,"children":[]},{"title":"Agent doesn’t use tools","slug":"agent-doesn’t-use-tools","depth":3,"children":[]},{"title":"Responses are inaccurate","slug":"responses-are-inaccurate","depth":3,"children":[]},{"title":"API calls fail","slug":"api-calls-fail","depth":3,"children":[]}]},{"title":"Next Steps","slug":"next-steps","depth":2,"children":[]},{"title":"Related Documentation","slug":"related-documentation","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"subdomain":"chatbotplatform","siteName":"Chatbot Platform Documentation","title":"Building a Grounded Support Bot - Chatbot Platform Documentation","contextualStarterQuestions":[],"navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-10-28T19:20:14.782Z","originalFileLocation":"guides/grounded-support-bot.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Add agentic loops and MCP servers for responses grounded in real data\">\u003cmeta data-mint-head name=\"application-name\" content=\"Chatbot Platform Documentation\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"https://mintlify.s3.us-west-1.amazonaws.com/chatbotplatform/_generated/favicon/apple-touch-icon.png?v=3\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"https://mintlify.s3.us-west-1.amazonaws.com/chatbotplatform/_generated/favicon/favicon-32x32.png?v=3\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"https://mintlify.s3.us-west-1.amazonaws.com/chatbotplatform/_generated/favicon/favicon-16x16.png?v=3\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"https://mintlify.s3.us-west-1.amazonaws.com/chatbotplatform/_generated/favicon/favicon.ico?v=3\">\u003cmeta data-mint-head property=\"og:title\" content=\"Building a Grounded Support Bot - Chatbot Platform Documentation\">\u003cmeta data-mint-head property=\"og:description\" content=\"Add agentic loops and MCP servers for responses grounded in real data\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Chatbot Platform Documentation\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.chatbotplatform.io/guides/grounded-support-bot\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://chatbotplatform.mintlify.site/_mintlify/api/og/v2?division=Guides\u0026amp;title=Building+a+Grounded+Support+Bot\u0026amp;description=Add+agentic+loops+and+MCP+servers+for+responses+grounded+in+real+data\u0026amp;theme=c1a9ad670a5314018887f4f9\u0026amp;signature=8999ab202edebe81a37cfb67e1c76f0bb3b5f376b604d26579c925f5dd816554\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Building a Grounded Support Bot - Chatbot Platform Documentation\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Add agentic loops and MCP servers for responses grounded in real data\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://chatbotplatform.mintlify.site/_mintlify/api/og/v2?division=Guides\u0026amp;title=Building+a+Grounded+Support+Bot\u0026amp;description=Add+agentic+loops+and+MCP+servers+for+responses+grounded+in+real+data\u0026amp;theme=c1a9ad670a5314018887f4f9\u0026amp;signature=8999ab202edebe81a37cfb67e1c76f0bb3b5f376b604d26579c925f5dd816554\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"https://mintlify.s3.us-west-1.amazonaws.com/chatbotplatform/_generated/favicon/browserconfig.xml?v=3\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Chatbot Platform Documentation\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#6366F1\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.chatbotplatform.io/guides/grounded-support-bot\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/guides/grounded-support-bot.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.chatbotplatform.io/#organization\",\"name\":\"Chatbot Platform Documentation\",\"url\":\"https://docs.chatbotplatform.io\"},{\"@type\":\"WebSite\",\"@id\":\"https://docs.chatbotplatform.io#website\",\"name\":\"Chatbot Platform Documentation\",\"url\":\"https://docs.chatbotplatform.io\",\"publisher\":{\"@id\":\"https://docs.chatbotplatform.io/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.chatbotplatform.io/guides/grounded-support-bot#webpage\",\"url\":\"https://docs.chatbotplatform.io/guides/grounded-support-bot\",\"name\":\"Building a Grounded Support Bot\",\"description\":\"Add agentic loops and MCP servers for responses grounded in real data\",\"dateModified\":\"2026-10-28T19:20:14.782Z\",\"isPartOf\":{\"@id\":\"https://docs.chatbotplatform.io#website\"},\"breadcrumb\":{\"@id\":\"https://docs.chatbotplatform.io/guides/grounded-support-bot#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.chatbotplatform.io/guides/grounded-support-bot#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Guides\",\"item\":\"https://docs.chatbotplatform.io/guides/embedded-assistant-with-mcp\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Building a Grounded Support Bot\",\"item\":\"https://docs.chatbotplatform.io/guides/grounded-support-bot\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.chatbotplatform.io/guides/grounded-support-bot#article\",\"headline\":\"Building a Grounded Support Bot\",\"name\":\"Building a Grounded Support Bot\",\"description\":\"Add agentic loops and MCP servers for responses grounded in real data\",\"url\":\"https://docs.chatbotplatform.io/guides/grounded-support-bot\",\"mainEntityOfPage\":{\"@id\":\"https://docs.chatbotplatform.io/guides/grounded-support-bot#webpage\"},\"dateModified\":\"2026-10-28T19:20:14.782Z\",\"publisher\":{\"@id\":\"https://docs.chatbotplatform.io/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.chatbotplatform.io#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Chatbot Platform Documentation\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"Chatbot Platform Documentation\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/guides/grounded-support-bot.md","siteName":"Chatbot Platform Documentation","nav":{"global":null,"tabs":[{"tab":"Guides","groups":[{"group":"Getting Started","pages":[{"title":"Welcome to Chatbot Platform","href":"/introduction"},{"title":"Quickstart","href":"/quickstart"}]},{"group":"Guides","pages":[{"title":"Embed an AI assistant backed by your product's MCP server","href":"/guides/embedded-assistant-with-mcp"},{"title":"Building a Basic Support Bot","description":"Step-by-step guide to creating your first AI-powered customer support chatbot","href":"/guides/support-bot-basics"},{"title":"Building a Grounded Support Bot","href":"/guides/grounded-support-bot"},{"title":"Building a Personal Assistant Bot","description":"Create an advanced AI assistant with multiple MCP servers for complex workflows","href":"/guides/personal-assistant"},{"title":"Multi-Channel Bot Deployment","href":"/guides/multi-channel-deployment"},{"title":"Webhook Integration Guide","href":"/guides/webhook-integration-guide"},{"title":"Managing Conversation Context","href":"/guides/conversation-context"}]}]},{"tab":"Bots","pages":[{"title":"Bots","href":"/bots/overview"}]},{"tab":"Agentic Loops","pages":[{"title":"Agentic Loops","href":"/agentic-loops/overview"}]},{"tab":"MCP Servers","pages":[{"title":"MCP Servers","href":"/mcp-servers/overview"}]}]},"basePath":"","title":"Building a Grounded Support Bot - Chatbot Platform Documentation","deploymentId":"dpl_QQ3G2kinQNQFFK6Sh8dmX2teK74w","buildId":"dpl_QQ3G2kinQNQFFK6Sh8dmX2teK74w","dynamics":["07c022d89b","a74be98ba7"],"chunks":["Frame-CUYDhsh7.js","DynamicMarkdown-D8KwOkxZ.js","zoom-image-lightbox-lceUjs6n.js","lightbox-handle-r17bVUz3.js"]}