Skip to main contentü¶úÔ∏èüîó LangChainDocsUse casesIntegrationsAPICommunityChat our docsLangSmithJS/TS DocsSearchCTRLKGet startedIntroductionInstallationQuickstartLangChain Expression LanguageInterfaceHow toCookbookLangChain Expression Language (LCEL)Why use LCEL?ModulesModel I/‚ÄãORetrievalChainsMemoryAgentsAgent TypesHow-toAdd Memory to OpenAI Functions AgentRunning Agent as an IteratorReturning Structured OutputCombine agents and vector storesAsync APICreate ChatGPT cloneCustom functions with OpenAI Functions AgentCustom agentCustom agent with tool retrievalCustom LLM agentCustom LLM Agent (with a ChatModel)Custom MRKL agentCustom multi-action agentHandle parsing errorsAccess intermediate stepsCap the max number of iterationsTimeouts for agentsReplicating MRKLShared memory across agents and toolsStreaming final agent outputUse ToolKits with OpenAI FunctionsToolsToolkitsCallbacksModulesSecurityGuidesMoreModulesAgentsHow-toCustom LLM agentOn this pageCustom LLM agentThis notebook goes through how to create your own custom LLM agent.An LLM agent consists of three parts:PromptTemplate: This is the prompt template that can be used to instruct the language model on what to doLLM: This is the language model that powers the agentstop sequence: Instructs the LLM to stop generating as soon as this string is foundOutputParser: This determines how to parse the LLM output into an AgentAction or AgentFinish objectThe LLM Agent is used in an AgentExecutor. This AgentExecutor can largely be thought of as a loop that:Passes user input and any previous steps to the Agent (in this case, the LLM Agent)If the Agent returns an AgentFinish, then return that directly to the userIf the Agent returns an AgentAction, then use that to call a tool and get an ObservationRepeat, passing the AgentAction and Observation back to the Agent until an AgentFinish is emitted.AgentAction is a response that consists of action and action_input. action refers to which tool to use, and action_input
This notebook goes through how to create your own custom LLM agent.
This notebook goes through how to create your own custom LLM agent. ->: Skip to main contentü¶úÔ∏èüîó LangChainDocsUse casesIntegrationsAPICommunityChat our docsLangSmithJS/TS DocsSearchCTRLKGet startedIntroductionInstallationQuickstartLangChain Expression LanguageInterfaceHow toCookbookLangChain Expression Language (LCEL)Why use LCEL?ModulesModel I/‚ÄãORetrievalChainsMemoryAgentsAgent TypesHow-toAdd Memory to OpenAI Functions AgentRunning Agent as an IteratorReturning Structured OutputCombine agents and vector storesAsync APICreate ChatGPT cloneCustom functions with OpenAI Functions AgentCustom agentCustom agent with tool retrievalCustom LLM agentCustom LLM Agent (with a ChatModel)Custom MRKL agentCustom multi-action agentHandle parsing errorsAccess intermediate stepsCap the max number of iterationsTimeouts for agentsReplicating MRKLShared memory across agents and toolsStreaming final agent outputUse ToolKits with OpenAI FunctionsToolsToolkitsCallbacksModulesSecurityGuidesMoreModulesAgentsHow-toCustom LLM agentOn this pageCustom LLM agentThis notebook goes through how to create your own custom LLM agent.An LLM agent consists of three parts:PromptTemplate: This is the prompt template that can be used to instruct the language model on what to doLLM: This is the language model that powers the agentstop sequence: Instructs the LLM to stop generating as soon as this string is foundOutputParser: This determines how to parse the LLM output into an AgentAction or AgentFinish objectThe LLM Agent is used in an AgentExecutor. This AgentExecutor can largely be thought of as a loop that:Passes user input and any previous steps to the Agent (in this case, the LLM Agent)If the Agent returns an AgentFinish, then return that directly to the userIf the Agent returns an AgentAction, then use that to call a tool and get an ObservationRepeat, passing the AgentAction and Observation back to the Agent until an AgentFinish is emitted.AgentAction is a response that consists of action and action_input. action refers to which tool to use, and action_input