User-facing: Agent directly interacts with users conversationally in a Q&A fashion.
Only a single user-facing Agent engages with the user when a new query is input into the chatbot.
Background: Agent never interacts with users directly and instead monitors the conversation
in an ongoing fashion. All background Agents are run whenever the user submits a new query to the chatbot.
Unlike user-facing Agents, background Agents are designed to monitor conversations and provide
assistance in the background by assigning tags or calling functions when certain criteria are met.
Agents are completely isolated from one another. This means that you cannot
direct the behavior, bias, or selection priority of one Agent from inside
another Agent.
Background Agents are always run whenever the user submits a new query into the chatbot.
This enables you to create “multi-threaded” workflows that significantly improves the accuracy and
consistency of your chatbots. Instead of tasking a single Agent to coordinate among a multitude of
potentially independent and unrelated tasks, having multiple specialized Agents simultaneously
monitor the conversation and handle subsequent actions will yield much better results.When configuring a background Agent, the prompt should be very simple and concise. Since background
Agents do not generate direct “conversational” output, your instructions should be restricted to variations of
“monitor the conversation for certain user behavior or intent”. You can instruct the background Agent
to set tags or call functions when the corresponding triggers are met.In certain cases, you may still wish to enable RAG for background Agents (if you need to evaluate a
user’s claim against certain policies or historical records before assigning a tag, for instance).
If this is true, you should give the Agent access to the necessary knowledge sources by going to the “Knowledge” tab in the Agent edit dialog.A common user case for background Agents is conversation tagging. For an example of how to use background Agents to assign
conversation tags, see Frustration Detection.
Here’s a fun setup that detects any mention of various fruits during the conversation and assigns the appropriate tags.
{"docsConfig":{"$schema":"https://mintlify.com/docs.json","theme":"mint","name":"GPT-trainer API","colors":{"primary":"#2E3F51","light":"#516F90","dark":"#0D001D"},"favicon":"/logo/favicon.png","logo":{"light":"https://mintlify.s3-us-west-1.amazonaws.com/donnajameseasy/logo/light.svg","dark":"https://mintlify.s3-us-west-1.amazonaws.com/donnajameseasy/logo/dark.svg"},"api":{"openapi":"https://app.gpt-trainer.com/api/apidoc/openapi.json","mdx":{"server":"https://app.gpt-trainer.com/api","auth":{"method":"bearer","name":null}}},"background":{"decoration":null,"color":{"light":null,"dark":"#111827"}},"navbar":{"links":[{"label":"Support","href":"mailto:hello@gpt-trainer.com"}],"primary":null},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"donnajameseasy","hasAudioNarration":false,"actualSubdomain":"donnajameseasy","customDomains":["docs.donnajames.app"],"gitSource":{"type":"github","owner":"donnajames","repo":"docs","deployBranch":"main","contentDirectory":"","isPrivate":false,"mountPath":"","label":""},"chroma":{"liveDeploymentHistoryId":"6a21e667bd0a90f91cb449cb","collectionId":"f9fab44b-edd5-43bd-99cc-be98de3699ad","schemaVersion":"v2"},"entitlements":{},"buildId":"6ae92303416fcb78afb057e0:success","clientVersion":"0.0.4067","searchFilterCounts":[{"language":"default","tag":"API References","count":37},{"language":"default","tag":"Documentation","count":13},{"language":"default","tag":"Guides","count":10},{"language":"default","tag":"Data Sources","count":9},{"language":"default","tag":"Chatbots","count":6},{"language":"default","tag":"Agents","count":5},{"language":"default","tag":"Session Messages","count":5},{"language":"default","tag":"API Usage Guides","count":4},{"language":"default","tag":"Chatbot Sessions","count":4},{"language":"default","tag":"Data Source Tags","count":4}]},"assistantConfig":{},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","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":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","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":"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":"assistant-v5","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":"vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","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":"workos-signup","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":"workos-enabled","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":"sso-setup-deadline-banner","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}],"googleFontsInlined":false},"customCss":[],"page":{"pagePath":"background-agents","slug":"/background-agents","pageMetadata":{"title":"Background Agents","description":null,"href":"/background-agents"},"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`,li:`li`,p:`p`,strong:`strong`,ul:`ul`,..._provideComponents(),...props.components},{Frame,Note,OptimizedImage}=_components;if(!Frame)_missingMdxReference(`Frame`,true);if(!Note)_missingMdxReference(`Note`,true);if(!OptimizedImage)_missingMdxReference(`OptimizedImage`,true);return _jsxs(_Fragment,{children:[_jsx(_components.p,{children:`DONNAJAMES Easy has 2 types of Agents:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`User-facing:`}),` Agent directly interacts with users conversationally in a Q\u0026A fashion.\nOnly a single user-facing Agent engages with the user when a new query is input into the chatbot.`]}),`\n`]}),`\n`,_jsxs(_components.li,{children:[`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Background:`}),` Agent never interacts with users directly and instead monitors the conversation\nin an ongoing fashion. All background Agents are run whenever the user submits a new query to the chatbot.`]}),`\n`]}),`\n`]}),`\n`,_jsxs(_components.p,{children:[`Unlike user-facing Agents, background Agents are designed to monitor conversations and provide\nassistance in the background by `,_jsx(_components.strong,{children:`assigning tags or calling functions`}),` when certain criteria are met.`]}),`\n`,_jsx(Note,{children:_jsx(_components.p,{children:`Agents are completely isolated from one another. This means that you cannot\ndirect the behavior, bias, or selection priority of one Agent from inside\nanother Agent.`})}),`\n`,_jsx(_components.p,{children:`Background Agents are always run whenever the user submits a new query into the chatbot.\nThis enables you to create “multi-threaded” workflows that significantly improves the accuracy and\nconsistency of your chatbots. Instead of tasking a single Agent to coordinate among a multitude of\npotentially independent and unrelated tasks, having multiple specialized Agents simultaneously\nmonitor the conversation and handle subsequent actions will yield much better results.`}),`\n`,_jsx(_components.p,{children:`When configuring a background Agent, the prompt should be very simple and concise. Since background\nAgents do not generate direct “conversational” output, your instructions should be restricted to variations of\n“monitor the conversation for certain user behavior or intent”. You can instruct the background Agent\nto set tags or call functions when the corresponding triggers are met.`}),`\n`,_jsx(_components.p,{children:`In certain cases, you may still wish to enable RAG for background Agents (if you need to evaluate a\nuser’s claim against certain policies or historical records before assigning a tag, for instance).\nIf this is true, you should give the Agent access to the necessary knowledge sources by going to the “Knowledge” tab in the Agent edit dialog.`}),`\n`,_jsxs(_components.p,{children:[`A common user case for background Agents is conversation tagging. For an example of how to use background Agents to assign\nconversation tags, see `,_jsx(_components.a,{href:`/frustration-detection`,children:`Frustration Detection`}),`.`]}),`\n`,_jsx(Frame,{caption:`Here’s a fun setup that detects any mention of various fruits during the conversation and assigns the appropriate tags.`,children:_jsx(OptimizedImage,{src:`https://mintlify.s3-us-west-1.amazonaws.com/donnajameseasy/images/background-agent-1.png`})})]})}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":"Background Agents","description":null,"href":"/background-agents"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[],"codeExamples":{}},"jsLinks":[],"subdomain":"donnajameseasy","siteName":"GPT-trainer API","title":"Background Agents - GPT-trainer API","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"originalFileLocation":"background-agents.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=\"application-name\" content=\"GPT-trainer API\">\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/donnajameseasy/_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/donnajameseasy/_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/donnajameseasy/_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/donnajameseasy/_generated/favicon/favicon.ico?v=3\">\u003cmeta data-mint-head property=\"og:title\" content=\"Background Agents - GPT-trainer API\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"GPT-trainer API\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.donnajames.app/background-agents\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://donnajameseasy.mintlify.app/_mintlify/api/og/v2?division=Guides\u0026amp;title=Background+Agents\u0026amp;theme=9e3ddbe218d2b3a5efb5224e\u0026amp;signature=1725c406640fe9ef7e6c4f2d6220a3acd11aaae6a3e129176b41b8a6781abd05\">\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=\"Background Agents - GPT-trainer API\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://donnajameseasy.mintlify.app/_mintlify/api/og/v2?division=Guides\u0026amp;title=Background+Agents\u0026amp;theme=9e3ddbe218d2b3a5efb5224e\u0026amp;signature=1725c406640fe9ef7e6c4f2d6220a3acd11aaae6a3e129176b41b8a6781abd05\">\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/donnajameseasy/_generated/favicon/browserconfig.xml?v=3\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"GPT-trainer API\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#2E3F51\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.donnajames.app/background-agents\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/background-agents.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.donnajames.app/#organization\",\"name\":\"GPT-trainer API\",\"url\":\"https://docs.donnajames.app\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintlify.s3-us-west-1.amazonaws.com/donnajameseasy/logo/light.svg\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.donnajames.app#website\",\"name\":\"GPT-trainer API\",\"url\":\"https://docs.donnajames.app\",\"publisher\":{\"@id\":\"https://docs.donnajames.app/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.donnajames.app/background-agents#webpage\",\"url\":\"https://docs.donnajames.app/background-agents\",\"name\":\"Background Agents\",\"isPartOf\":{\"@id\":\"https://docs.donnajames.app#website\"},\"breadcrumb\":{\"@id\":\"https://docs.donnajames.app/background-agents#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.donnajames.app/background-agents#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Guides\",\"item\":\"https://docs.donnajames.app/creating-first-chatbot\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Background Agents\",\"item\":\"https://docs.donnajames.app/background-agents\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.donnajames.app/background-agents#article\",\"headline\":\"Background Agents\",\"name\":\"Background Agents\",\"url\":\"https://docs.donnajames.app/background-agents\",\"mainEntityOfPage\":{\"@id\":\"https://docs.donnajames.app/background-agents#webpage\"},\"publisher\":{\"@id\":\"https://docs.donnajames.app/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.donnajames.app#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"GPT-trainer API\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"GPT-trainer API","nav":{"global":null,"anchors":[{"anchor":"Documentation","icon":"book-open","groups":[{"group":"Getting Started","pages":[{"title":"Introduction","href":"/introduction"}]},{"group":"Guides","pages":[{"title":"Create Your First Chatbot","href":"/creating-first-chatbot"},{"title":"Lead Collection","href":"/lead-collection"},{"title":"Human support escalation","href":"/human-support-escalation"},{"title":"Inbox Notifications","href":"/inbox-notifications"},{"title":"Frustration detection","href":"/frustration-detection"},{"title":"Background Agents","href":"/background-agents"},{"title":"Multi agents chatbot","href":"/multi-agents-chatbot"},{"title":"Fine Tuning Agent Intents","href":"/fine-tuning-agent-intents"},{"title":"AI Supervisor Overrides","href":"/supervisor-overrides"},{"title":"Bring Your Own Key (BYOK) and Pricing","href":"/byok-pricing-guide"},{"title":"Working with Tables and CSV","href":"/working-with-tables"},{"title":"Best practices for preparing training data","href":"/best-practices"},{"title":"Why does my chatbot not answer correctly?","href":"/help"}]},{"group":"Function Calling","pages":[{"title":"RAG from an External Data Provider","href":"/rag-from-external-data-provider"}]},{"group":"Authentication Webhook","pages":[{"title":"User Identity Verification","href":"/user-identity"}]}]},{"anchor":"API References","icon":"code","pages":[{"title":"API References","href":"/api-reference/api-key-setup"}]},{"anchor":"Tools","icon":"gear","pages":[{"title":"Tools","href":"/tools/tools-intro"}]},{"anchor":"Whitelabel","icon":"browser","pages":[{"title":"Whitelabel","href":"/whitelabel/whitelabel-intro"}]}]},"basePath":"","title":"Background Agents - GPT-trainer API","buildId":"dpl_9VVk5y1P8k1ATeJguVngy9Q3cmbD","deploymentId":"dpl_9VVk5y1P8k1ATeJguVngy9Q3cmbD","dynamics":["07c022d89b","a74be98ba7"],"chunks":["Frame-BdiBGm0H.js","DynamicMarkdown-CbqEDjbV.js","zoom-image-lightbox-CvtNkYOX.js","lightbox-handle-r17bVUz3.js"]}