Palico provides complete flexibility over the implementation details of your LLM Application, and as such, you can libraries like LangChain to help build your LLM application logic.
LangChain provides an uniform interface to communicate with lots of different LLM models. Here is an example of how to use LangChain to call an LLM model within a Palico Agent.
import { Chat } from "@palico-ai/app";import { ChatOpenAI } from "@langchain/openai";import { HumanMessage } from "@langchain/core/messages";const handler: Chat = async ({ userMessage }) => { const model = new ChatOpenAI({ model: "gpt-4o-mini", temperature: 0, }); const response = await model.invoke([ new HumanMessage({ content: userMessage }), ]); return { message: response.content, };};
LangChain provides lots of utility libraries to help you the actual implementation of your LLM Application whereas Palico provides the overall architecture. You can build powerful LLM application by combining the two. For example, you can build the core of your application with LangChain, then use Palico to preview changes, run experiments, add logs and tracing, and publish your application behind a REST API
When building a RAG Application, you need to first index your documents to a Vector Database, then retrieve it from that database. LangChain provides variety of tools to communicate with Vector Databases like Pinecone, PGVector, and more. Learn more from the LangChain Documentation.
The primary input to an LLM model is the prompt, and as such, we this prompt can become complex. LangChain provides a tool to build these complex prompts using templates. Learn more from the LangChain Documentation.
LangChain provides a unified interface to communicate with different LLM models. You can use LangChain to call models from OpenAI, Claude, and more. Learn more from the LangChain Documentation.
{"docsConfig":{"$schema":"https://mintlify.com/docs.json","theme":"mint","name":"Palico AI","colors":{"primary":"#a855f7","light":"#c084fc","dark":"#a855f7"},"favicon":"/favicon.png","logo":{"light":"https://mintcdn.com/palicoai-c392fb7d/Sh3FtY8afZy7cfIf/logo/logo.png?fit=max\u0026auto=format\u0026n=Sh3FtY8afZy7cfIf\u0026q=85\u0026s=ce39e2077b08239926967b35c9effce5","dark":"https://mintcdn.com/palicoai-c392fb7d/Sh3FtY8afZy7cfIf/logo/logo.png?fit=max\u0026auto=format\u0026n=Sh3FtY8afZy7cfIf\u0026q=85\u0026s=ce39e2077b08239926967b35c9effce5"},"api":{"playground":{"display":"none"},"mdx":{"server":"http://localhost:8000","auth":{"method":"bearer","name":null}}},"navbar":{"links":[{"label":"Support","href":"mailto:asif@palico.ai"}],"primary":{"type":"button","label":"GitHub","href":"https://github.com/palico-ai/palico-ai"}},"footer":{"socials":{"x":"https://x.com/shikderNYC","github":"https://github.com/palico-ai/palico-ai","linkedin":"https://www.linkedin.com/company/102658123"}},"integrations":{"ga4":{"measurementId":"G-Q39NFM4PTV"},"gtm":{"tagId":"GTM-5C2WKP72"}},"navigation":{"global":{"anchors":[{"anchor":"Palico.AI","href":"https://www.palico.ai/","icon":"globe"},{"anchor":"Blog","href":"https://blog.palico.ai/","icon":"newspaper"},{"anchor":"Community","href":"https://discord.gg/TyQPVSXa","icon":"discord"}]},"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"palicoai-c392fb7d","hasAudioNarration":false,"actualSubdomain":"palicoai-c392fb7d","customDomains":["docs.palico.ai"],"gitSource":{"type":"github","owner":"palico-ai","repo":"palico-ai","deployBranch":"main","contentDirectory":"apps/docs","isPrivate":true,"mountPath":"","label":""},"chroma":{"liveDeploymentHistoryId":"6a21e63e4c43fec466d796c4","collectionId":"d90dbf93-a04a-4ace-b354-8a511bac3e23","schemaVersion":"v2"},"entitlements":{},"buildId":"6a21e63e4c43fec466d796c4:success","clientVersion":"0.0.4044","searchFilterCounts":[{"language":"default","tag":"Palico App","count":16},{"language":"default","tag":"Guides","count":10},{"language":"default","tag":"Client SDKs","count":5},{"language":"default","tag":"Integrations","count":4},{"language":"default","tag":"REST API","count":3},{"language":"default","tag":"Get Started","count":2},{"language":"default","tag":"@palico-ai / client-js","count":1},{"language":"default","tag":"@palico-ai / react","count":1}]},"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":"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":"byok-sep-25","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":"billing-updated-9-15","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}],"googleFontsInlined":false},"customCss":[],"page":{"pagePath":"integrations/langchain","slug":"/integrations/langchain","pageMetadata":{"title":"LangChain","description":"Palico provides complete flexibility over the implementation details of your LLM Application, and as such, you can libraries like LangChain to help build your LLM application logic.","href":"/integrations/langchain"},"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: \"Palico provides complete flexibility over the implementation details of your LLM Application, and as such, you can libraries like LangChain to help build your LLM application logic.\"\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`,p:`p`,pre:`pre`,span:`span`,..._provideComponents(),...props.components},{CodeBlock,Heading}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);return _jsxs(_Fragment,{children:[_jsx(Heading,{level:`2`,id:`example-using-langchain-to-call-llm-model`,children:`Example Using LangChain to Call LLM Model`}),`\n`,_jsx(_components.p,{children:`LangChain provides an uniform interface to communicate with lots of different LLM models. Here is an example of how to use LangChain to call an LLM model within a Palico Agent.`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`16`,language:`typescript`,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:`typescript`,children:_jsxs(_components.code,{language:`typescript`,numberOfLines:`16`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Chat`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` } `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"@palico-ai/app\"`}),_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\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`ChatOpenAI`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` } `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"@langchain/openai\"`}),_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\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`HumanMessage`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` } `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"@langchain/core/messages\"`}),_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:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` handler`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`:`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` Chat`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--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:`userMessage`}),_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:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` model`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` new`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` ChatOpenAI`}),_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:` model:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"gpt-4o-mini\"`}),_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:` temperature:`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 0`}),_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:`#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:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` model`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`invoke`}),_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:` new`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` HumanMessage`}),_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\":`#9CDCFE`},children:` userMessage`}),_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:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` return`}),_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:` message:`}),_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:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`content`}),_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:`2`,id:`using-langchain-with-palico-effectively`,children:`Using LangChain with Palico Effectively`}),`\n`,_jsx(_components.p,{children:`LangChain provides lots of utility libraries to help you the actual implementation of your LLM Application whereas Palico provides the overall architecture. You can build powerful LLM application by combining the two. For example, you can build the core of your application with LangChain, then use Palico to preview changes, run experiments, add logs and tracing, and publish your application behind a REST API`}),`\n`,_jsx(Heading,{level:`2`,id:`common-use-cases-with-langchain`,children:`Common Use-Cases with LangChain`}),`\n`,_jsx(_components.p,{children:`Langchain provides lots of component libraries to help build implement your LLM Application. Here are some common use-cases.`}),`\n`,_jsx(Heading,{level:`3`,id:`index-and-retrieve-documents-for-rag-applications`,children:`Index and Retrieve Documents for RAG Applications`}),`\n`,_jsxs(_components.p,{children:[`When building a RAG Application, you need to first index your documents to a Vector Database, then retrieve it from that database. LangChain provides variety of tools to communicate with Vector Databases like Pinecone, PGVector, and more. Learn more from the `,_jsx(_components.a,{href:`https://js.langchain.com/v0.2/docs/tutorials/rag/`,children:`LangChain Documentation`}),`.`]}),`\n`,_jsx(Heading,{level:`3`,id:`prompt-templates`,children:`Prompt Templates`}),`\n`,_jsxs(_components.p,{children:[`The primary input to an LLM model is the prompt, and as such, we this prompt can become complex. LangChain provides a tool to build these complex prompts using templates. Learn more from the `,_jsx(_components.a,{href:`https://js.langchain.com/v0.2/docs/concepts/#prompt-templates`,children:`LangChain Documentation`}),`.`]}),`\n`,_jsx(Heading,{level:`3`,id:`communicating-with-llm-models`,children:`Communicating with LLM Models`}),`\n`,_jsxs(_components.p,{children:[`LangChain provides a unified interface to communicate with different LLM models. You can use LangChain to call models from OpenAI, Claude, and more. Learn more from the `,_jsx(_components.a,{href:`https://js.langchain.com/v0.2/docs/how_to/#llms`,children:`LangChain Documentation`}),`.`]})]})}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":"LangChain","description":"Palico provides complete flexibility over the implementation details of your LLM Application, and as such, you can libraries like LangChain to help build your LLM application logic.","href":"/integrations/langchain"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Example Using LangChain to Call LLM Model","slug":"example-using-langchain-to-call-llm-model","depth":2,"children":[]},{"title":"Using LangChain with Palico Effectively","slug":"using-langchain-with-palico-effectively","depth":2,"children":[]},{"title":"Common Use-Cases with LangChain","slug":"common-use-cases-with-langchain","depth":2,"children":[{"title":"Index and Retrieve Documents for RAG Applications","slug":"index-and-retrieve-documents-for-rag-applications","depth":3,"children":[]},{"title":"Prompt Templates","slug":"prompt-templates","depth":3,"children":[]},{"title":"Communicating with LLM Models","slug":"communicating-with-llm-models","depth":3,"children":[]}]}],"codeExamples":{}},"jsLinks":[],"subdomain":"palicoai-c392fb7d","siteName":"Palico AI","title":"LangChain - Palico AI","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-01-07T02:43:36.494Z","originalFileLocation":"integrations/langchain.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=\"Palico provides complete flexibility over the implementation details of your LLM Application, and as such, you can libraries like LangChain to help build your LLM application logic.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Palico AI\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/palicoai-c392fb7d/MB3Iu3SxfCiDAX-Q/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/palicoai-c392fb7d/MB3Iu3SxfCiDAX-Q/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/palicoai-c392fb7d/MB3Iu3SxfCiDAX-Q/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/palicoai-c392fb7d/MB3Iu3SxfCiDAX-Q/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/palicoai-c392fb7d/MB3Iu3SxfCiDAX-Q/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/palicoai-c392fb7d/MB3Iu3SxfCiDAX-Q/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/palicoai-c392fb7d/MB3Iu3SxfCiDAX-Q/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/palicoai-c392fb7d/MB3Iu3SxfCiDAX-Q/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/palicoai-c392fb7d/MB3Iu3SxfCiDAX-Q/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"LangChain - Palico AI\">\u003cmeta data-mint-head property=\"og:description\" content=\"Palico provides complete flexibility over the implementation details of your LLM Application, and as such, you can libraries like LangChain to help build your LLM application logic.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Palico AI\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.palico.ai/integrations/langchain\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://palicoai-c392fb7d.mintlify.app/_mintlify/api/og/v2?division=Integrations\u0026amp;title=LangChain\u0026amp;description=Palico+provides+complete+flexibility+over+the+implementation+details+of+your+LLM+Application%2C+and+as+such%2C+you+can+libraries+like+LangChain+to+help+build+your+L\u0026amp;theme=e0df6142e860ac0fe5d788ce\u0026amp;signature=21bb3d78aac23b1b43b2216f268cae978fc844d30018ed21c4123d36c51b010a\">\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=\"LangChain - Palico AI\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Palico provides complete flexibility over the implementation details of your LLM Application, and as such, you can libraries like LangChain to help build your LLM application logic.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://palicoai-c392fb7d.mintlify.app/_mintlify/api/og/v2?division=Integrations\u0026amp;title=LangChain\u0026amp;description=Palico+provides+complete+flexibility+over+the+implementation+details+of+your+LLM+Application%2C+and+as+such%2C+you+can+libraries+like+LangChain+to+help+build+your+L\u0026amp;theme=e0df6142e860ac0fe5d788ce\u0026amp;signature=21bb3d78aac23b1b43b2216f268cae978fc844d30018ed21c4123d36c51b010a\">\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=\"/mintlify-assets/_mintlify/favicons/palicoai-c392fb7d/MB3Iu3SxfCiDAX-Q/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Palico AI\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#a855f7\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.palico.ai/integrations/langchain\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/integrations/langchain.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.palico.ai/#organization\",\"name\":\"Palico AI\",\"url\":\"https://docs.palico.ai\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/palicoai-c392fb7d/Sh3FtY8afZy7cfIf/logo/logo.png?fit=max\u0026auto=format\u0026n=Sh3FtY8afZy7cfIf\u0026q=85\u0026s=ce39e2077b08239926967b35c9effce5\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.palico.ai#website\",\"name\":\"Palico AI\",\"url\":\"https://docs.palico.ai\",\"publisher\":{\"@id\":\"https://docs.palico.ai/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.palico.ai/integrations/langchain#webpage\",\"url\":\"https://docs.palico.ai/integrations/langchain\",\"name\":\"LangChain\",\"description\":\"Palico provides complete flexibility over the implementation details of your LLM Application, and as such, you can libraries like LangChain to help build your LLM application logic.\",\"dateModified\":\"2026-01-07T02:43:36.494Z\",\"isPartOf\":{\"@id\":\"https://docs.palico.ai#website\"},\"breadcrumb\":{\"@id\":\"https://docs.palico.ai/integrations/langchain#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.palico.ai/integrations/langchain#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Palico AI\",\"item\":\"https://docs.palico.ai\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"LangChain\",\"item\":\"https://docs.palico.ai/integrations/langchain\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.palico.ai/integrations/langchain#article\",\"headline\":\"LangChain\",\"name\":\"LangChain\",\"description\":\"Palico provides complete flexibility over the implementation details of your LLM Application, and as such, you can libraries like LangChain to help build your LLM application logic.\",\"url\":\"https://docs.palico.ai/integrations/langchain\",\"mainEntityOfPage\":{\"@id\":\"https://docs.palico.ai/integrations/langchain#webpage\"},\"dateModified\":\"2026-01-07T02:43:36.494Z\",\"publisher\":{\"@id\":\"https://docs.palico.ai/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.palico.ai#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Palico AI\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"Palico AI","nav":{"global":{"anchors":[{"anchor":"Palico.AI","href":"https://www.palico.ai/","icon":"globe"},{"anchor":"Blog","href":"https://blog.palico.ai/","icon":"newspaper"},{"anchor":"Community","href":"https://discord.gg/TyQPVSXa","icon":"discord"}]},"tabs":[{"tab":"Palico App","groups":[{"group":"Get Started","pages":[{"title":"Quickstart","href":"/quickstart"},{"title":"Components","href":"/components"}]},{"group":"Guides","pages":[{"title":"Build You Application","href":"/guides/build"},{"title":"Agent With Tools","href":"/guides/agents"},{"title":"Feature Flags","href":"/guides/feature_flag"},{"title":"Streaming","href":"/guides/streaming"},{"title":"Long-Term Memory","href":"/guides/conversation_state"},{"title":"Logs And Traces","href":"/guides/telemetry"},{"title":"Experiments","href":"/guides/experiments"},{"title":"AI Gateway","href":"/guides/ai_gateway"},{"title":"Prompt Management","href":"/guides/prompt_management"},{"title":"Deployment","description":"Deploy your Palico app to production with Docker. Setup CI/CD and Pull Request Preview with Coolify.","href":"/guides/deployment"}]},{"group":"Integrations","pages":[{"title":"LangChain","href":"/integrations/langchain"},{"title":"Llama Index","description":"Palico provides complete flexibility over the implementation details of your LLM Application, and as such, you can libraries like LlamaIndex to help build your LLM application logic.","href":"/integrations/llamaindex"},{"title":"Model Providers","href":"/integrations/llm_providers"},{"title":"Vector Database","href":"/integrations/vector_db"}]}]},{"tab":"Client SDKs","pages":[{"title":"Client SDKs","href":"/client-sdk/introduction"}]},{"tab":"Types","href":"https://typedoc.palico.ai/"}]},"basePath":"","title":"LangChain - Palico AI","buildId":"dpl_DeHjVRGfFnhYQwHnfC2pjeXXv8h9","deploymentId":"dpl_DeHjVRGfFnhYQwHnfC2pjeXXv8h9","dynamics":[],"chunks":[]}