From 75aee6a3578fe5b1461418cdfb4f4e4cd5bfdfab Mon Sep 17 00:00:00 2001 From: aimurphy Date: Fri, 19 Dec 2025 15:42:58 +0000 Subject: [PATCH] deploy: 7a4817473d806756f224b75f93fcac78b4bfe6a6 --- 404.html | 2 +- agents/index.html | 2 +- assets/js/27b4a875.5585873a.js | 1 + assets/js/27b4a875.a11e6996.js | 1 - .../{af920ffe.492f9e55.js => af920ffe.5a239774.js} | 2 +- assets/js/ca2c3c0c.039bf965.js | 1 + assets/js/ca2c3c0c.ca722922.js | 1 - ...ime~main.28b5001d.js => runtime~main.0ec053c5.js} | 2 +- chat/index.html | 12 ++++++------ docker/index.html | 2 +- index.html | 2 +- ingestion/index.html | 10 +++++----- install-options/index.html | 2 +- install-uv/index.html | 2 +- install-uvx/index.html | 2 +- install-windows/index.html | 2 +- install/index.html | 2 +- knowledge-filters/index.html | 2 +- knowledge/index.html | 2 +- manage-services/index.html | 2 +- quickstart/index.html | 4 ++-- reference/configuration/index.html | 2 +- reinstall/index.html | 2 +- support/troubleshoot/index.html | 2 +- tui/index.html | 2 +- uninstall/index.html | 2 +- upgrade/index.html | 2 +- 27 files changed, 35 insertions(+), 35 deletions(-) create mode 100644 assets/js/27b4a875.5585873a.js delete mode 100644 assets/js/27b4a875.a11e6996.js rename assets/js/{af920ffe.492f9e55.js => af920ffe.5a239774.js} (96%) create mode 100644 assets/js/ca2c3c0c.039bf965.js delete mode 100644 assets/js/ca2c3c0c.ca722922.js rename assets/js/{runtime~main.28b5001d.js => runtime~main.0ec053c5.js} (96%) diff --git a/404.html b/404.html index a9bb480e..269e3ad4 100644 --- a/404.html +++ b/404.html @@ -4,7 +4,7 @@ OpenRAG - + diff --git a/agents/index.html b/agents/index.html index b783f9cd..7e966531 100644 --- a/agents/index.html +++ b/agents/index.html @@ -4,7 +4,7 @@ Use Langflow in OpenRAG | OpenRAG - + diff --git a/assets/js/27b4a875.5585873a.js b/assets/js/27b4a875.5585873a.js new file mode 100644 index 00000000..162c42a9 --- /dev/null +++ b/assets/js/27b4a875.5585873a.js @@ -0,0 +1 @@ +"use strict";(globalThis.webpackChunkopenrag_docs=globalThis.webpackChunkopenrag_docs||[]).push([[3207],{1470:(e,n,t)=>{t.d(n,{A:()=>A});var s=t(6540),o=t(4164),r=t(7559),a=t(3104),i=t(6347),l=t(205),c=t(7485),h=t(1682),d=t(679);function u(e){return s.Children.toArray(e).filter(e=>"\n"!==e).map(e=>{if(!e||(0,s.isValidElement)(e)&&function(e){const{props:n}=e;return!!n&&"object"==typeof n&&"value"in n}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)})?.filter(Boolean)??[]}function p(e){const{values:n,children:t}=e;return(0,s.useMemo)(()=>{const e=n??function(e){return u(e).map(({props:{value:e,label:n,attributes:t,default:s}})=>({value:e,label:n,attributes:t,default:s}))}(t);return function(e){const n=(0,h.XI)(e,(e,n)=>e.value===n.value);if(n.length>0)throw new Error(`Docusaurus error: Duplicate values "${n.map(e=>e.value).join(", ")}" found in . Every value needs to be unique.`)}(e),e},[n,t])}function g({value:e,tabValues:n}){return n.some(n=>n.value===e)}function f({queryString:e=!1,groupId:n}){const t=(0,i.W6)(),o=function({queryString:e=!1,groupId:n}){if("string"==typeof e)return e;if(!1===e)return null;if(!0===e&&!n)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return n??null}({queryString:e,groupId:n});return[(0,c.aZ)(o),(0,s.useCallback)(e=>{if(!o)return;const n=new URLSearchParams(t.location.search);n.set(o,e),t.replace({...t.location,search:n.toString()})},[o,t])]}function m(e){const{defaultValue:n,queryString:t=!1,groupId:o}=e,r=p(e),[a,i]=(0,s.useState)(()=>function({defaultValue:e,tabValues:n}){if(0===n.length)throw new Error("Docusaurus error: the component requires at least one children component");if(e){if(!g({value:e,tabValues:n}))throw new Error(`Docusaurus error: The has a defaultValue "${e}" but none of its children has the corresponding value. Available values are: ${n.map(e=>e.value).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return e}const t=n.find(e=>e.default)??n[0];if(!t)throw new Error("Unexpected error: 0 tabValues");return t.value}({defaultValue:n,tabValues:r})),[c,h]=f({queryString:t,groupId:o}),[u,m]=function({groupId:e}){const n=function(e){return e?`docusaurus.tab.${e}`:null}(e),[t,o]=(0,d.Dv)(n);return[t,(0,s.useCallback)(e=>{n&&o.set(e)},[n,o])]}({groupId:o}),x=(()=>{const e=c??u;return g({value:e,tabValues:r})?e:null})();(0,l.A)(()=>{x&&i(x)},[x]);return{selectedValue:a,selectValue:(0,s.useCallback)(e=>{if(!g({value:e,tabValues:r}))throw new Error(`Can't select invalid tab value=${e}`);i(e),h(e),m(e)},[h,m,r]),tabValues:r}}var x=t(2303);const j={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var y=t(4848);function w({className:e,block:n,selectedValue:t,selectValue:s,tabValues:r}){const i=[],{blockElementScrollPositionUntilNextRender:l}=(0,a.a_)(),c=e=>{const n=e.currentTarget,o=i.indexOf(n),a=r[o].value;a!==t&&(l(n),s(a))},h=e=>{let n=null;switch(e.key){case"Enter":c(e);break;case"ArrowRight":{const t=i.indexOf(e.currentTarget)+1;n=i[t]??i[0];break}case"ArrowLeft":{const t=i.indexOf(e.currentTarget)-1;n=i[t]??i[i.length-1];break}}n?.focus()};return(0,y.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,o.A)("tabs",{"tabs--block":n},e),children:r.map(({value:e,label:n,attributes:s})=>(0,y.jsx)("li",{role:"tab",tabIndex:t===e?0:-1,"aria-selected":t===e,ref:e=>{i.push(e)},onKeyDown:h,onClick:c,...s,className:(0,o.A)("tabs__item",j.tabItem,s?.className,{"tabs__item--active":t===e}),children:n??e},e))})}function b({lazy:e,children:n,selectedValue:t}){const r=(Array.isArray(n)?n:[n]).filter(Boolean);if(e){const e=r.find(e=>e.props.value===t);return e?(0,s.cloneElement)(e,{className:(0,o.A)("margin-top--md",e.props.className)}):null}return(0,y.jsx)("div",{className:"margin-top--md",children:r.map((e,n)=>(0,s.cloneElement)(e,{key:n,hidden:e.props.value!==t}))})}function v(e){const n=m(e);return(0,y.jsxs)("div",{className:(0,o.A)(r.G.tabs.container,"tabs-container",j.tabList),children:[(0,y.jsx)(w,{...n,...e}),(0,y.jsx)(b,{...n,...e})]})}function A(e){const n=(0,x.A)();return(0,y.jsx)(v,{...e,children:u(e.children)},String(n))}},2361:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>d,contentTitle:()=>h,default:()=>g,frontMatter:()=>c,metadata:()=>s,toc:()=>u});const s=JSON.parse('{"id":"core-components/chat","title":"Chat in OpenRAG","description":"After you upload documents to your knowledge base, you can use the OpenRAG Chat feature to interact with your knowledge through natural language queries.","source":"@site/docs/core-components/chat.mdx","sourceDirName":"core-components","slug":"/chat","permalink":"/chat","draft":false,"unlisted":false,"editUrl":"https://github.com/openrag/openrag/tree/main/docs/docs/core-components/chat.mdx","tags":[],"version":"current","frontMatter":{"title":"Chat in OpenRAG","slug":"/chat"},"sidebar":"tutorialSidebar","previous":{"title":"Filter knowledge","permalink":"/knowledge-filters"},"next":{"title":"Environment variables","permalink":"/reference/configuration"}}');var o=t(4848),r=t(8453),a=t(9179),i=(t(1470),t(9365),t(7224)),l=t(8401);const c={title:"Chat in OpenRAG",slug:"/chat"},h=void 0,d={},u=[{value:"OpenRAG OpenSearch Agent flow",id:"flow",level:2},{value:"Nudges",id:"nudges",level:2},{value:"Upload documents to the chat",id:"upload-documents-to-the-chat",level:2},...l.RM,{value:"Inspect tool calls and knowledge",id:"inspect-tool-calls-and-knowledge",level:2},{value:"Integrate OpenRAG chat into an application",id:"integrate-openrag-chat-into-an-application",level:2},...i.RM];function p(e){const n={a:"a",admonition:"admonition",code:"code",h2:"h2",img:"img",li:"li",p:"p",strong:"strong",ul:"ul",...(0,r.R)(),...e.components},{Details:s}=n;return s||function(e,n){throw new Error("Expected "+(n?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}("Details",!0),(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(n.p,{children:["After you ",(0,o.jsx)(n.a,{href:"/ingestion",children:"upload documents to your knowledge base"}),", you can use the OpenRAG ",(0,o.jsx)(a.A,{name:"MessageSquare","aria-hidden":"true"})," ",(0,o.jsx)(n.strong,{children:"Chat"})," feature to interact with your knowledge through natural language queries."]}),"\n",(0,o.jsxs)(n.p,{children:["The OpenRAG ",(0,o.jsx)(n.strong,{children:"Chat"})," uses an LLM-powered agent to understand your queries, retrieve relevant information from your knowledge base, and generate context-aware responses.\nThe agent can also fetch information from URLs and new documents that you provide during the chat session.\nTo limit the knowledge available to the agent, use ",(0,o.jsx)(n.a,{href:"/knowledge-filters",children:"filters"}),"."]}),"\n",(0,o.jsxs)(n.p,{children:["The agent can call specialized Model Context Protocol (MCP) tools to extend its capabilities.\nTo add or change the available tools, you must edit the ",(0,o.jsxs)(n.a,{href:"#flow",children:[(0,o.jsx)(n.strong,{children:"OpenRAG OpenSearch Agent"})," flow"]}),"."]}),"\n",(0,o.jsx)(n.admonition,{type:"tip",children:(0,o.jsxs)(n.p,{children:["Try chatting, uploading documents, and modifying chat settings in the ",(0,o.jsx)(n.a,{href:"/quickstart",children:"quickstart"}),"."]})}),"\n",(0,o.jsx)(n.h2,{id:"flow",children:"OpenRAG OpenSearch Agent flow"}),"\n",(0,o.jsxs)(n.p,{children:["When you use the OpenRAG ",(0,o.jsx)(n.strong,{children:"Chat"}),", the ",(0,o.jsx)(n.strong,{children:"OpenRAG OpenSearch Agent"})," flow runs in the background to retrieve relevant information from your knowledge base and generate a response."]}),"\n",(0,o.jsxs)(n.p,{children:["If you ",(0,o.jsx)(n.a,{href:"/agents#inspect-and-modify-flows",children:"inspect the flow in Langflow"}),", you'll see that it is comprised of eight components that work together to ingest chat messages, retrieve relevant information from your knowledge base, and then generate responses.\nWhen you inspect this flow, you can edit the components to customize the agent's behavior."]}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.img,{alt:"OpenRAG Open Search Agent Flow",src:t(3982).A+"",width:"4084",height:"2176"})}),"\n",(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:[(0,o.jsxs)(n.a,{href:"https://docs.langflow.org/chat-input-and-output#chat-input",children:[(0,o.jsx)(n.strong,{children:"Chat Input"})," component"]}),": This component starts the flow when it receives a chat message. It is connected to the ",(0,o.jsx)(n.strong,{children:"Agent"})," component's ",(0,o.jsx)(n.strong,{children:"Input"})," port.\nWhen you use the OpenRAG ",(0,o.jsx)(n.strong,{children:"Chat"}),", your chat messages are passed to the ",(0,o.jsx)(n.strong,{children:"Chat Input"})," component, which then sends them to the ",(0,o.jsx)(n.strong,{children:"Agent"})," component for processing."]}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:[(0,o.jsxs)(n.a,{href:"https://docs.langflow.org/components-agents",children:[(0,o.jsx)(n.strong,{children:"Agent"})," component"]}),": This component orchestrates the entire flow by processing chat messages, searching the knowledge base, and organizing the retrieved information into a cohesive response.\nThe agent's general behavior is defined by the prompt in the ",(0,o.jsx)(n.strong,{children:"Agent Instructions"})," field and the model connected to the ",(0,o.jsx)(n.strong,{children:"Language Model"})," port.\nOne or more specialized tools can be attached to the ",(0,o.jsx)(n.strong,{children:"Tools"})," port to extend the agent's capabilities. In this case, there are two tools: ",(0,o.jsx)(n.strong,{children:"MCP Tools"})," and ",(0,o.jsx)(n.strong,{children:"OpenSearch"}),"."]}),"\n",(0,o.jsxs)(n.p,{children:["The ",(0,o.jsx)(n.strong,{children:"Agent"})," component is the star of this flow because it powers decision making, tool calling, and an LLM-driven conversational experience."]}),"\n",(0,o.jsxs)(s,{children:[(0,o.jsx)("summary",{children:"How do agents work?"}),(0,o.jsx)(n.p,{children:"Agents extend Large Language Models (LLMs) by integrating tools, which are functions that provide additional context and enable autonomous task execution. These integrations make agents more specialized and powerful than standalone LLMs."}),(0,o.jsx)(n.p,{children:"Whereas an LLM might generate acceptable, inert responses to general queries and tasks, an agent can leverage the integrated context and tools to provide more relevant responses and even take action. For example, you might create an agent that can access your company's documentation, repositories, and other resources to help your team with tasks that require knowledge of your specific products, customers, and code."}),(0,o.jsx)(n.p,{children:"Agents use LLMs as a reasoning engine to process input, determine which actions to take to address the query, and then generate a response. The response could be a typical text-based LLM response, or it could involve an action, like editing a file, running a script, or calling an external API."}),(0,o.jsx)(n.p,{children:"In an agentic context, tools are functions that the agent can run to perform tasks or access external resources. A function is wrapped as a Tool object with a common interface that the agent understands. Agents become aware of tools through tool registration, which is when the agent is provided a list of available tools typically at agent initialization. The Tool object's description tells the agent what the tool can do so that it can decide whether the tool is appropriate for a given request."})]}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:[(0,o.jsxs)(n.a,{href:"https://docs.langflow.org/components-models",children:[(0,o.jsx)(n.strong,{children:"Language Model"})," component"]}),": Connected to the ",(0,o.jsx)(n.strong,{children:"Agent"})," component's ",(0,o.jsx)(n.strong,{children:"Language Model"})," port, this component provides the base language model driver for the agent. The agent cannot function without a model because the model is used for general knowledge, reasoning, and generating responses."]}),"\n",(0,o.jsx)(n.p,{children:"Different models can change the style and content of the agent's responses, and some models might be better suited for certain tasks than others. If the agent doesn't seem to be handling requests well, try changing the model to see how the responses change. For example, fast models might be good for simple queries, but they might not have the depth of reasoning for complex, multi-faceted queries."}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:[(0,o.jsxs)(n.a,{href:"https://docs.langflow.org/mcp-client",children:[(0,o.jsx)(n.strong,{children:"MCP Tools"})," component"]}),": Connected to the ",(0,o.jsx)(n.strong,{children:"Agent"})," component's ",(0,o.jsx)(n.strong,{children:"Tools"})," port, this component can be used to ",(0,o.jsx)(n.a,{href:"https://docs.langflow.org/mcp-server",children:"access any MCP server"})," and the MCP tools provided by that server. In this case, your OpenRAG Langflow instance's ",(0,o.jsx)(n.a,{href:"https://docs.langflow.org/concepts-flows#projects",children:(0,o.jsx)(n.strong,{children:"Starter Project"})})," is the MCP server, and the ",(0,o.jsxs)(n.a,{href:"/ingestion#url-flow",children:[(0,o.jsx)(n.strong,{children:"OpenSearch URL Ingestion"})," flow"]})," is the MCP tool.\nThis flow fetches content from URLs, and then stores the content in your OpenRAG OpenSearch knowledge base. By serving this flow as an MCP tool, the agent can selectively call this tool if a URL is detected in the chat input."]}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:[(0,o.jsxs)(n.a,{href:"https://docs.langflow.org/bundles-elastic#opensearch",children:[(0,o.jsx)(n.strong,{children:"OpenSearch"})," component"]}),": Connected to the ",(0,o.jsx)(n.strong,{children:"Agent"})," component's ",(0,o.jsx)(n.strong,{children:"Tools"})," port, this component lets the agent search your ",(0,o.jsx)(n.a,{href:"/knowledge",children:"OpenRAG OpenSearch knowledge base"}),". The agent might not use this database for every request; the agent uses this connection only if it decides that documents in your knowledge base are relevant to your query."]}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:[(0,o.jsxs)(n.a,{href:"https://docs.langflow.org/components-embedding-models",children:[(0,o.jsx)(n.strong,{children:"Embedding Model"})," component"]}),": Connected to the ",(0,o.jsx)(n.strong,{children:"OpenSearch"})," component's ",(0,o.jsx)(n.strong,{children:"Embedding"})," port, this component generates embeddings from chat input that are used in ",(0,o.jsx)(n.a,{href:"https://www.ibm.com/think/topics/vector-search",children:"similarity search"})," to find content in your knowledge base that is relevant to the chat input. The agent uses this information to generate context-aware responses that are specialized for your data."]}),"\n",(0,o.jsxs)(n.p,{children:["It is critical that the embedding model used here matches the embedding model used when you ",(0,o.jsx)(n.a,{href:"/ingestion",children:"upload documents to your knowledge base"}),". Mismatched models and dimensions can degrade the quality of similarity search results causing the agent to retrieve irrelevant documents from your knowledge base."]}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:[(0,o.jsxs)(n.a,{href:"https://docs.langflow.org/text-input-and-output#text-input",children:[(0,o.jsx)(n.strong,{children:"Text Input"})," component"]}),": Connected to the ",(0,o.jsx)(n.strong,{children:"OpenSearch"})," component's ",(0,o.jsx)(n.strong,{children:"Search Filters"})," port, this component is populated with a Langflow global variable named ",(0,o.jsx)(n.code,{children:"OPENRAG-QUERY-FILTER"}),". If a global or chat-level ",(0,o.jsx)(n.a,{href:"/knowledge-filters",children:"knowledge filter"})," is set, then the variable contains the filter expression, which limits the documents that the agent can access in the knowledge base.\nIf no knowledge filter is set, then the ",(0,o.jsx)(n.code,{children:"OPENRAG-QUERY-FILTER"})," variable is empty, and the agent can access all documents in the knowledge base."]}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:[(0,o.jsxs)(n.a,{href:"https://docs.langflow.org/chat-input-and-output#chat-output",children:[(0,o.jsx)(n.strong,{children:"Chat Output"})," component"]}),": Connected to the ",(0,o.jsx)(n.strong,{children:"Agent"})," component's ",(0,o.jsx)(n.strong,{children:"Output"})," port, this component returns the agent's generated response as a chat message."]}),"\n"]}),"\n"]}),"\n",(0,o.jsx)(n.h2,{id:"nudges",children:"Nudges"}),"\n",(0,o.jsxs)(n.p,{children:["When you use the OpenRAG ",(0,o.jsx)(n.strong,{children:"Chat"}),", the ",(0,o.jsx)(n.strong,{children:"OpenRAG OpenSearch Nudges"})," flow runs in the background to pull additional context from your knowledge base and chat history."]}),"\n",(0,o.jsxs)(n.p,{children:["Nudges appear as prompts in the chat.\nClick a nudge to accept it and provide the nudge's context to the OpenRAG ",(0,o.jsx)(n.strong,{children:"Chat"})," agent (the ",(0,o.jsx)(n.strong,{children:"OpenRAG OpenSearch Agent"})," flow)."]}),"\n",(0,o.jsxs)(n.p,{children:["Like OpenRAG's other built-in flows, you can ",(0,o.jsx)(n.a,{href:"/agents#inspect-and-modify-flows",children:"inspect the flow in Langflow"}),", and you can customize it if you want to change the nudge behavior."]}),"\n",(0,o.jsx)(n.h2,{id:"upload-documents-to-the-chat",children:"Upload documents to the chat"}),"\n",(0,o.jsx)(l.Ay,{}),"\n",(0,o.jsx)(n.h2,{id:"inspect-tool-calls-and-knowledge",children:"Inspect tool calls and knowledge"}),"\n",(0,o.jsxs)(n.p,{children:["During the chat, you'll see information about the agent's process. For more detail, you can inspect individual tool calls. This is helpful for troubleshooting because it shows you how the agent used particular tools. For example, click ",(0,o.jsx)(a.A,{name:"Gear","aria-hidden":"true"})," ",(0,o.jsx)(n.strong,{children:"Function Call: search_documents (tool_call)"})," to view the log of tool calls made by the agent to the ",(0,o.jsx)(n.strong,{children:"OpenSearch"})," component."]}),"\n",(0,o.jsxs)(n.p,{children:["If documents in your knowledge base seem to be missing or interpreted incorrectly, see ",(0,o.jsx)(n.a,{href:"/ingestion#troubleshoot-ingestion",children:"Troubleshoot ingestion"}),"."]}),"\n",(0,o.jsxs)(n.p,{children:["If tool calls and knowledge appear normal, but the agent's responses seem off-topic or incorrect, consider changing the agent's language model or prompt, as explained in ",(0,o.jsx)(n.a,{href:"/agents#inspect-and-modify-flows",children:"Inspect and modify flows"}),"."]}),"\n",(0,o.jsx)(n.h2,{id:"integrate-openrag-chat-into-an-application",children:"Integrate OpenRAG chat into an application"}),"\n",(0,o.jsxs)(n.p,{children:["You can integrate OpenRAG flows into your applications using the ",(0,o.jsx)(n.a,{href:"https://docs.langflow.org/api-reference-api-examples",children:"Langflow API"}),".\nTo simplify this integration, you can get pre-configured code snippets directly from the embedded Langflow visual editor."]}),"\n",(0,o.jsxs)(n.p,{children:["The following example demonstrates how to generate and use code snippets for the ",(0,o.jsx)(n.strong,{children:"OpenRAG OpenSearch Agent"})," flow:"]}),"\n",(0,o.jsx)(i.Ay,{})]})}function g(e={}){const{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,o.jsx)(n,{...e,children:(0,o.jsx)(p,{...e})}):p(e)}},3982:(e,n,t)=>{t.d(n,{A:()=>s});const s=t.p+"assets/images/opensearch-agent-flow-f3b279e02425cd043002eb7749067108.png"},7224:(e,n,t)=>{t.d(n,{Ay:()=>h,RM:()=>l});var s=t(4848),o=t(8453),r=t(9179),a=t(1470),i=t(9365);const l=[];function c(e){const n={a:"a",code:"code",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,o.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(n.ol,{children:["\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["Open the ",(0,s.jsx)(n.strong,{children:"OpenRAG OpenSearch Agent"})," flow in the Langflow visual editor: From the ",(0,s.jsx)(n.strong,{children:"Chat"})," window, click ",(0,s.jsx)(r.A,{name:"Settings2","aria-hidden":"true"})," ",(0,s.jsx)(n.strong,{children:"Settings"}),", click ",(0,s.jsx)(n.strong,{children:"Edit in Langflow"}),", and then click ",(0,s.jsx)(n.strong,{children:"Proceed"}),"."]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["Optional: If you don't want to use the Langflow API key that is generated automatically when you install OpenRAG, you can create a ",(0,s.jsx)(n.a,{href:"https://docs.langflow.org/api-keys-and-authentication",children:"Langflow API key"}),".\nThis key doesn't grant access to OpenRAG; it is only for authenticating with the Langflow API."]}),"\n",(0,s.jsxs)(n.ol,{children:["\n",(0,s.jsxs)(n.li,{children:["In the Langflow visual editor, click your user icon in the header, and then select ",(0,s.jsx)(n.strong,{children:"Settings"}),"."]}),"\n",(0,s.jsxs)(n.li,{children:["Click ",(0,s.jsx)(n.strong,{children:"Langflow API Keys"}),", and then click ",(0,s.jsx)(r.A,{name:"Plus","aria-hidden":"true"})," ",(0,s.jsx)(n.strong,{children:"Add New"}),"."]}),"\n",(0,s.jsxs)(n.li,{children:["Name your key, and then click ",(0,s.jsx)(n.strong,{children:"Create API Key"}),"."]}),"\n",(0,s.jsx)(n.li,{children:"Copy the API key and store it securely."}),"\n",(0,s.jsxs)(n.li,{children:["Exit the Langflow ",(0,s.jsx)(n.strong,{children:"Settings"})," page to return to the visual editor."]}),"\n"]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["Click ",(0,s.jsx)(n.strong,{children:"Share"}),", and then select ",(0,s.jsx)(n.strong,{children:"API access"})," to get pregenerated code snippets that call the Langflow API and run the flow."]}),"\n",(0,s.jsxs)(n.p,{children:["These code snippets construct API requests with your Langflow server URL (",(0,s.jsx)(n.code,{children:"LANGFLOW_SERVER_ADDRESS"}),"), the flow to run (",(0,s.jsx)(n.code,{children:"FLOW_ID"}),"), required headers (",(0,s.jsx)(n.code,{children:"LANGFLOW_API_KEY"}),", ",(0,s.jsx)(n.code,{children:"Content-Type"}),"), and a payload containing the required inputs to run the flow, including a default chat input message."]}),"\n",(0,s.jsx)(n.p,{children:"In production, you would modify the inputs to suit your application logic. For example, you could replace the default chat input message with dynamic user input."}),"\n",(0,s.jsxs)(a.A,{children:[(0,s.jsx)(i.A,{value:"python",label:"Python",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python",children:'import requests\nimport os\nimport uuid\n\napi_key = \'LANGFLOW_API_KEY\'\nurl = "http://LANGFLOW_SERVER_ADDRESS/api/v1/run/FLOW_ID" # The complete API endpoint URL for this flow\n\n# Request payload configuration\npayload = {\n "output_type": "chat",\n "input_type": "chat",\n "input_value": "hello world!"\n}\npayload["session_id"] = str(uuid.uuid4())\n\nheaders = {"x-api-key": api_key}\n\ntry:\n # Send API request\n response = requests.request("POST", url, json=payload, headers=headers)\n response.raise_for_status() # Raise exception for bad status codes\n\n # Print response\n print(response.text)\n\nexcept requests.exceptions.RequestException as e:\n print(f"Error making API request: {e}")\nexcept ValueError as e:\n print(f"Error parsing response: {e}")\n'})})}),(0,s.jsx)(i.A,{value:"typescript",label:"TypeScript",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typescript",children:'const crypto = require(\'crypto\');\nconst apiKey = \'LANGFLOW_API_KEY\';\nconst payload = {\n "output_type": "chat",\n "input_type": "chat",\n "input_value": "hello world!"\n};\npayload.session_id = crypto.randomUUID();\n\nconst options = {\n method: \'POST\',\n headers: {\n \'Content-Type\': \'application/json\',\n "x-api-key": apiKey\n },\n body: JSON.stringify(payload)\n};\n\nfetch(\'http://LANGFLOW_SERVER_ADDRESS/api/v1/run/FLOW_ID\', options)\n .then(response => response.json())\n .then(response => console.warn(response))\n .catch(err => console.error(err));\n'})})}),(0,s.jsx)(i.A,{value:"curl",label:"curl",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-bash",children:'curl --request POST \\\n --url \'http://LANGFLOW_SERVER_ADDRESS/api/v1/run/FLOW_ID?stream=false\' \\\n --header \'Content-Type: application/json\' \\\n --header "x-api-key: LANGFLOW_API_KEY" \\\n --data \'{\n "output_type": "chat",\n "input_type": "chat",\n "input_value": "hello world!"\n }\'\n'})})})]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsx)(n.p,{children:"Copy your preferred snippet, and then run it:"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Python"}),": Paste the snippet into a ",(0,s.jsx)(n.code,{children:".py"})," file, save it, and then run it with ",(0,s.jsx)(n.code,{children:"python filename.py"}),"."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"TypeScript"}),": Paste the snippet into a ",(0,s.jsx)(n.code,{children:".ts"})," file, save it, and then run it with ",(0,s.jsx)(n.code,{children:"ts-node filename.ts"}),"."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"curl"}),": Paste and run snippet directly in your terminal."]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,s.jsx)(n.p,{children:"If the request is successful, the response includes many details about the flow run, including the session ID, inputs, outputs, components, durations, and more."}),"\n",(0,s.jsxs)(n.p,{children:["In production, you won't pass the raw response to the user in its entirety.\nInstead, you extract and reformat relevant fields for different use cases, as demonstrated in the ",(0,s.jsx)(n.a,{href:"https://docs.langflow.org/get-started-quickstart#extract-data-from-the-response",children:"Langflow quickstart"}),".\nFor example, you could pass the chat output text to a front-end user-facing application, and store specific fields in logs and backend data stores for monitoring, chat history, or analytics.\nYou could also pass the output from one flow as input to another flow."]})]})}function h(e={}){const{wrapper:n}={...(0,o.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(c,{...e})}):c(e)}},8401:(e,n,t)=>{t.d(n,{Ay:()=>l,RM:()=>a});var s=t(4848),o=t(8453),r=t(9179);const a=[];function i(e){const n={p:"p",strong:"strong",...(0,o.R)(),...e.components};return(0,s.jsxs)(n.p,{children:["When using the OpenRAG ",(0,s.jsx)(n.strong,{children:"Chat"}),", click ",(0,s.jsx)(r.A,{name:"Plus","aria-hidden":"true"})," in the chat input field to upload a file to the current chat session.\nFiles added this way are processed and made available to the agent for the current conversation only.\nThese files aren't stored in the knowledge base permanently."]})}function l(e={}){const{wrapper:n}={...(0,o.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(i,{...e})}):i(e)}},9179:(e,n,t)=>{t.d(n,{A:()=>r});t(6540);var s=t(7856),o=t(4848);function r({name:e,...n}){const t=s[e];return t?(0,o.jsx)(t,{...n}):null}},9365:(e,n,t)=>{t.d(n,{A:()=>a});t(6540);var s=t(4164);const o={tabItem:"tabItem_Ymn6"};var r=t(4848);function a({children:e,hidden:n,className:t}){return(0,r.jsx)("div",{role:"tabpanel",className:(0,s.A)(o.tabItem,t),hidden:n,children:e})}}}]); \ No newline at end of file diff --git a/assets/js/27b4a875.a11e6996.js b/assets/js/27b4a875.a11e6996.js deleted file mode 100644 index 64fee806..00000000 --- a/assets/js/27b4a875.a11e6996.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(globalThis.webpackChunkopenrag_docs=globalThis.webpackChunkopenrag_docs||[]).push([[3207],{1470:(e,n,t)=>{t.d(n,{A:()=>A});var s=t(6540),o=t(4164),r=t(7559),a=t(3104),i=t(6347),l=t(205),c=t(7485),h=t(1682),d=t(679);function u(e){return s.Children.toArray(e).filter(e=>"\n"!==e).map(e=>{if(!e||(0,s.isValidElement)(e)&&function(e){const{props:n}=e;return!!n&&"object"==typeof n&&"value"in n}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)})?.filter(Boolean)??[]}function p(e){const{values:n,children:t}=e;return(0,s.useMemo)(()=>{const e=n??function(e){return u(e).map(({props:{value:e,label:n,attributes:t,default:s}})=>({value:e,label:n,attributes:t,default:s}))}(t);return function(e){const n=(0,h.XI)(e,(e,n)=>e.value===n.value);if(n.length>0)throw new Error(`Docusaurus error: Duplicate values "${n.map(e=>e.value).join(", ")}" found in . Every value needs to be unique.`)}(e),e},[n,t])}function g({value:e,tabValues:n}){return n.some(n=>n.value===e)}function f({queryString:e=!1,groupId:n}){const t=(0,i.W6)(),o=function({queryString:e=!1,groupId:n}){if("string"==typeof e)return e;if(!1===e)return null;if(!0===e&&!n)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return n??null}({queryString:e,groupId:n});return[(0,c.aZ)(o),(0,s.useCallback)(e=>{if(!o)return;const n=new URLSearchParams(t.location.search);n.set(o,e),t.replace({...t.location,search:n.toString()})},[o,t])]}function m(e){const{defaultValue:n,queryString:t=!1,groupId:o}=e,r=p(e),[a,i]=(0,s.useState)(()=>function({defaultValue:e,tabValues:n}){if(0===n.length)throw new Error("Docusaurus error: the component requires at least one children component");if(e){if(!g({value:e,tabValues:n}))throw new Error(`Docusaurus error: The has a defaultValue "${e}" but none of its children has the corresponding value. Available values are: ${n.map(e=>e.value).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return e}const t=n.find(e=>e.default)??n[0];if(!t)throw new Error("Unexpected error: 0 tabValues");return t.value}({defaultValue:n,tabValues:r})),[c,h]=f({queryString:t,groupId:o}),[u,m]=function({groupId:e}){const n=function(e){return e?`docusaurus.tab.${e}`:null}(e),[t,o]=(0,d.Dv)(n);return[t,(0,s.useCallback)(e=>{n&&o.set(e)},[n,o])]}({groupId:o}),x=(()=>{const e=c??u;return g({value:e,tabValues:r})?e:null})();(0,l.A)(()=>{x&&i(x)},[x]);return{selectedValue:a,selectValue:(0,s.useCallback)(e=>{if(!g({value:e,tabValues:r}))throw new Error(`Can't select invalid tab value=${e}`);i(e),h(e),m(e)},[h,m,r]),tabValues:r}}var x=t(2303);const j={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var y=t(4848);function w({className:e,block:n,selectedValue:t,selectValue:s,tabValues:r}){const i=[],{blockElementScrollPositionUntilNextRender:l}=(0,a.a_)(),c=e=>{const n=e.currentTarget,o=i.indexOf(n),a=r[o].value;a!==t&&(l(n),s(a))},h=e=>{let n=null;switch(e.key){case"Enter":c(e);break;case"ArrowRight":{const t=i.indexOf(e.currentTarget)+1;n=i[t]??i[0];break}case"ArrowLeft":{const t=i.indexOf(e.currentTarget)-1;n=i[t]??i[i.length-1];break}}n?.focus()};return(0,y.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,o.A)("tabs",{"tabs--block":n},e),children:r.map(({value:e,label:n,attributes:s})=>(0,y.jsx)("li",{role:"tab",tabIndex:t===e?0:-1,"aria-selected":t===e,ref:e=>{i.push(e)},onKeyDown:h,onClick:c,...s,className:(0,o.A)("tabs__item",j.tabItem,s?.className,{"tabs__item--active":t===e}),children:n??e},e))})}function b({lazy:e,children:n,selectedValue:t}){const r=(Array.isArray(n)?n:[n]).filter(Boolean);if(e){const e=r.find(e=>e.props.value===t);return e?(0,s.cloneElement)(e,{className:(0,o.A)("margin-top--md",e.props.className)}):null}return(0,y.jsx)("div",{className:"margin-top--md",children:r.map((e,n)=>(0,s.cloneElement)(e,{key:n,hidden:e.props.value!==t}))})}function v(e){const n=m(e);return(0,y.jsxs)("div",{className:(0,o.A)(r.G.tabs.container,"tabs-container",j.tabList),children:[(0,y.jsx)(w,{...n,...e}),(0,y.jsx)(b,{...n,...e})]})}function A(e){const n=(0,x.A)();return(0,y.jsx)(v,{...e,children:u(e.children)},String(n))}},2361:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>d,contentTitle:()=>h,default:()=>g,frontMatter:()=>c,metadata:()=>s,toc:()=>u});const s=JSON.parse('{"id":"core-components/chat","title":"Chat in OpenRAG","description":"After you upload documents to your knowledge base, you can use the OpenRAG Chat feature to interact with your knowledge through natural language queries.","source":"@site/docs/core-components/chat.mdx","sourceDirName":"core-components","slug":"/chat","permalink":"/chat","draft":false,"unlisted":false,"editUrl":"https://github.com/openrag/openrag/tree/main/docs/docs/core-components/chat.mdx","tags":[],"version":"current","frontMatter":{"title":"Chat in OpenRAG","slug":"/chat"},"sidebar":"tutorialSidebar","previous":{"title":"Filter knowledge","permalink":"/knowledge-filters"},"next":{"title":"Environment variables","permalink":"/reference/configuration"}}');var o=t(4848),r=t(8453),a=t(9179),i=(t(1470),t(9365),t(7224)),l=t(8401);const c={title:"Chat in OpenRAG",slug:"/chat"},h=void 0,d={},u=[{value:"OpenRAG OpenSearch Agent flow",id:"flow",level:2},{value:"Nudges",id:"nudges",level:2},{value:"Upload documents to the chat",id:"upload-documents-to-the-chat",level:2},...l.RM,{value:"Inspect tool calls and knowledge",id:"inspect-tool-calls-and-knowledge",level:2},{value:"Integrate OpenRAG chat into an application",id:"integrate-openrag-chat-into-an-application",level:2},...i.RM];function p(e){const n={a:"a",admonition:"admonition",code:"code",h2:"h2",img:"img",li:"li",p:"p",strong:"strong",ul:"ul",...(0,r.R)(),...e.components},{Details:s}=n;return s||function(e,n){throw new Error("Expected "+(n?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}("Details",!0),(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(n.p,{children:["After you ",(0,o.jsx)(n.a,{href:"/ingestion",children:"upload documents to your knowledge base"}),", you can use the OpenRAG ",(0,o.jsx)(a.A,{name:"MessageSquare","aria-hidden":"true"})," ",(0,o.jsx)(n.strong,{children:"Chat"})," feature to interact with your knowledge through natural language queries."]}),"\n",(0,o.jsxs)(n.p,{children:["The OpenRAG ",(0,o.jsx)(n.strong,{children:"Chat"})," uses an LLM-powered agent to understand your queries, retrieve relevant information from your knowledge base, and generate context-aware responses.\nThe agent can also fetch information from URLs and new documents that you provide during the chat session.\nTo limit the knowledge available to the agent, use ",(0,o.jsx)(n.a,{href:"/knowledge-filters",children:"filters"}),"."]}),"\n",(0,o.jsxs)(n.p,{children:["The agent can call specialized Model Context Protocol (MCP) tools to extend its capabilities.\nTo add or change the available tools, you must edit the ",(0,o.jsxs)(n.a,{href:"#flow",children:[(0,o.jsx)(n.strong,{children:"OpenRAG OpenSearch Agent"})," flow"]}),"."]}),"\n",(0,o.jsx)(n.admonition,{type:"tip",children:(0,o.jsxs)(n.p,{children:["Try chatting, uploading documents, and modifying chat settings in the ",(0,o.jsx)(n.a,{href:"/quickstart",children:"quickstart"}),"."]})}),"\n",(0,o.jsx)(n.h2,{id:"flow",children:"OpenRAG OpenSearch Agent flow"}),"\n",(0,o.jsxs)(n.p,{children:["When you use the OpenRAG ",(0,o.jsx)(n.strong,{children:"Chat"}),", the ",(0,o.jsx)(n.strong,{children:"OpenRAG OpenSearch Agent"})," flow runs in the background to retrieve relevant information from your knowledge base and generate a response."]}),"\n",(0,o.jsxs)(n.p,{children:["If you ",(0,o.jsx)(n.a,{href:"/agents#inspect-and-modify-flows",children:"inspect the flow in Langflow"}),", you'll see that it is comprised of eight components that work together to ingest chat messages, retrieve relevant information from your knowledge base, and then generate responses.\nWhen you inspect this flow, you can edit the components to customize the agent's behavior."]}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.img,{alt:"OpenRAG Open Search Agent Flow",src:t(3982).A+"",width:"4084",height:"2176"})}),"\n",(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:[(0,o.jsxs)(n.a,{href:"https://docs.langflow.org/components-io",children:[(0,o.jsx)(n.strong,{children:"Chat Input"})," component"]}),": This component starts the flow when it receives a chat message. It is connected to the ",(0,o.jsx)(n.strong,{children:"Agent"})," component's ",(0,o.jsx)(n.strong,{children:"Input"})," port.\nWhen you use the OpenRAG ",(0,o.jsx)(n.strong,{children:"Chat"}),", your chat messages are passed to the ",(0,o.jsx)(n.strong,{children:"Chat Input"})," component, which then sends them to the ",(0,o.jsx)(n.strong,{children:"Agent"})," component for processing."]}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:[(0,o.jsxs)(n.a,{href:"https://docs.langflow.org/agents",children:[(0,o.jsx)(n.strong,{children:"Agent"})," component"]}),": This component orchestrates the entire flow by processing chat messages, searching the knowledge base, and organizing the retrieved information into a cohesive response.\nThe agent's general behavior is defined by the prompt in the ",(0,o.jsx)(n.strong,{children:"Agent Instructions"})," field and the model connected to the ",(0,o.jsx)(n.strong,{children:"Language Model"})," port.\nOne or more specialized tools can be attached to the ",(0,o.jsx)(n.strong,{children:"Tools"})," port to extend the agent's capabilities. In this case, there are two tools: ",(0,o.jsx)(n.strong,{children:"MCP Tools"})," and ",(0,o.jsx)(n.strong,{children:"OpenSearch"}),"."]}),"\n",(0,o.jsxs)(n.p,{children:["The ",(0,o.jsx)(n.strong,{children:"Agent"})," component is the star of this flow because it powers decision making, tool calling, and an LLM-driven conversational experience."]}),"\n",(0,o.jsxs)(s,{children:[(0,o.jsx)("summary",{children:"How do agents work?"}),(0,o.jsx)(n.p,{children:"Agents extend Large Language Models (LLMs) by integrating tools, which are functions that provide additional context and enable autonomous task execution. These integrations make agents more specialized and powerful than standalone LLMs."}),(0,o.jsx)(n.p,{children:"Whereas an LLM might generate acceptable, inert responses to general queries and tasks, an agent can leverage the integrated context and tools to provide more relevant responses and even take action. For example, you might create an agent that can access your company's documentation, repositories, and other resources to help your team with tasks that require knowledge of your specific products, customers, and code."}),(0,o.jsx)(n.p,{children:"Agents use LLMs as a reasoning engine to process input, determine which actions to take to address the query, and then generate a response. The response could be a typical text-based LLM response, or it could involve an action, like editing a file, running a script, or calling an external API."}),(0,o.jsx)(n.p,{children:"In an agentic context, tools are functions that the agent can run to perform tasks or access external resources. A function is wrapped as a Tool object with a common interface that the agent understands. Agents become aware of tools through tool registration, which is when the agent is provided a list of available tools typically at agent initialization. The Tool object's description tells the agent what the tool can do so that it can decide whether the tool is appropriate for a given request."})]}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:[(0,o.jsxs)(n.a,{href:"https://docs.langflow.org/components-models",children:[(0,o.jsx)(n.strong,{children:"Language Model"})," component"]}),": Connected to the ",(0,o.jsx)(n.strong,{children:"Agent"})," component's ",(0,o.jsx)(n.strong,{children:"Language Model"})," port, this component provides the base language model driver for the agent. The agent cannot function without a model because the model is used for general knowledge, reasoning, and generating responses."]}),"\n",(0,o.jsx)(n.p,{children:"Different models can change the style and content of the agent's responses, and some models might be better suited for certain tasks than others. If the agent doesn't seem to be handling requests well, try changing the model to see how the responses change. For example, fast models might be good for simple queries, but they might not have the depth of reasoning for complex, multi-faceted queries."}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:[(0,o.jsxs)(n.a,{href:"https://docs.langflow.org/mcp-client",children:[(0,o.jsx)(n.strong,{children:"MCP Tools"})," component"]}),": Connected to the ",(0,o.jsx)(n.strong,{children:"Agent"})," component's ",(0,o.jsx)(n.strong,{children:"Tools"})," port, this component can be used to ",(0,o.jsx)(n.a,{href:"https://docs.langflow.org/mcp-server",children:"access any MCP server"})," and the MCP tools provided by that server. In this case, your OpenRAG Langflow instance's ",(0,o.jsx)(n.a,{href:"https://docs.langflow.org/concepts-flows#projects",children:(0,o.jsx)(n.strong,{children:"Starter Project"})})," is the MCP server, and the ",(0,o.jsxs)(n.a,{href:"/ingestion#url-flow",children:[(0,o.jsx)(n.strong,{children:"OpenSearch URL Ingestion"})," flow"]})," is the MCP tool.\nThis flow fetches content from URLs, and then stores the content in your OpenRAG OpenSearch knowledge base. By serving this flow as an MCP tool, the agent can selectively call this tool if a URL is detected in the chat input."]}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:[(0,o.jsxs)(n.a,{href:"https://docs.langflow.org/bundles-elastic#opensearch",children:[(0,o.jsx)(n.strong,{children:"OpenSearch"})," component"]}),": Connected to the ",(0,o.jsx)(n.strong,{children:"Agent"})," component's ",(0,o.jsx)(n.strong,{children:"Tools"})," port, this component lets the agent search your ",(0,o.jsx)(n.a,{href:"/knowledge",children:"OpenRAG OpenSearch knowledge base"}),". The agent might not use this database for every request; the agent uses this connection only if it decides that documents in your knowledge base are relevant to your query."]}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:[(0,o.jsxs)(n.a,{href:"https://docs.langflow.org/components-embedding-models",children:[(0,o.jsx)(n.strong,{children:"Embedding Model"})," component"]}),": Connected to the ",(0,o.jsx)(n.strong,{children:"OpenSearch"})," component's ",(0,o.jsx)(n.strong,{children:"Embedding"})," port, this component generates embeddings from chat input that are used in ",(0,o.jsx)(n.a,{href:"https://www.ibm.com/think/topics/vector-search",children:"similarity search"})," to find content in your knowledge base that is relevant to the chat input. The agent uses this information to generate context-aware responses that are specialized for your data."]}),"\n",(0,o.jsxs)(n.p,{children:["It is critical that the embedding model used here matches the embedding model used when you ",(0,o.jsx)(n.a,{href:"/ingestion",children:"upload documents to your knowledge base"}),". Mismatched models and dimensions can degrade the quality of similarity search results causing the agent to retrieve irrelevant documents from your knowledge base."]}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:[(0,o.jsxs)(n.a,{href:"https://docs.langflow.org/components-io",children:[(0,o.jsx)(n.strong,{children:"Text Input"})," component"]}),": Connected to the ",(0,o.jsx)(n.strong,{children:"OpenSearch"})," component's ",(0,o.jsx)(n.strong,{children:"Search Filters"})," port, this component is populated with a Langflow global variable named ",(0,o.jsx)(n.code,{children:"OPENRAG-QUERY-FILTER"}),". If a global or chat-level ",(0,o.jsx)(n.a,{href:"/knowledge-filters",children:"knowledge filter"})," is set, then the variable contains the filter expression, which limits the documents that the agent can access in the knowledge base.\nIf no knowledge filter is set, then the ",(0,o.jsx)(n.code,{children:"OPENRAG-QUERY-FILTER"})," variable is empty, and the agent can access all documents in the knowledge base."]}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:[(0,o.jsxs)(n.a,{href:"https://docs.langflow.org/components-io",children:[(0,o.jsx)(n.strong,{children:"Chat Output"})," component"]}),": Connected to the ",(0,o.jsx)(n.strong,{children:"Agent"})," component's ",(0,o.jsx)(n.strong,{children:"Output"})," port, this component returns the agent's generated response as a chat message."]}),"\n"]}),"\n"]}),"\n",(0,o.jsx)(n.h2,{id:"nudges",children:"Nudges"}),"\n",(0,o.jsxs)(n.p,{children:["When you use the OpenRAG ",(0,o.jsx)(n.strong,{children:"Chat"}),", the ",(0,o.jsx)(n.strong,{children:"OpenRAG OpenSearch Nudges"})," flow runs in the background to pull additional context from your knowledge base and chat history."]}),"\n",(0,o.jsxs)(n.p,{children:["Nudges appear as prompts in the chat.\nClick a nudge to accept it and provide the nudge's context to the OpenRAG ",(0,o.jsx)(n.strong,{children:"Chat"})," agent (the ",(0,o.jsx)(n.strong,{children:"OpenRAG OpenSearch Agent"})," flow)."]}),"\n",(0,o.jsxs)(n.p,{children:["Like OpenRAG's other built-in flows, you can ",(0,o.jsx)(n.a,{href:"/agents#inspect-and-modify-flows",children:"inspect the flow in Langflow"}),", and you can customize it if you want to change the nudge behavior."]}),"\n",(0,o.jsx)(n.h2,{id:"upload-documents-to-the-chat",children:"Upload documents to the chat"}),"\n",(0,o.jsx)(l.Ay,{}),"\n",(0,o.jsx)(n.h2,{id:"inspect-tool-calls-and-knowledge",children:"Inspect tool calls and knowledge"}),"\n",(0,o.jsxs)(n.p,{children:["During the chat, you'll see information about the agent's process. For more detail, you can inspect individual tool calls. This is helpful for troubleshooting because it shows you how the agent used particular tools. For example, click ",(0,o.jsx)(a.A,{name:"Gear","aria-hidden":"true"})," ",(0,o.jsx)(n.strong,{children:"Function Call: search_documents (tool_call)"})," to view the log of tool calls made by the agent to the ",(0,o.jsx)(n.strong,{children:"OpenSearch"})," component."]}),"\n",(0,o.jsxs)(n.p,{children:["If documents in your knowledge base seem to be missing or interpreted incorrectly, see ",(0,o.jsx)(n.a,{href:"/ingestion#troubleshoot-ingestion",children:"Troubleshoot ingestion"}),"."]}),"\n",(0,o.jsxs)(n.p,{children:["If tool calls and knowledge appear normal, but the agent's responses seem off-topic or incorrect, consider changing the agent's language model or prompt, as explained in ",(0,o.jsx)(n.a,{href:"/agents#inspect-and-modify-flows",children:"Inspect and modify flows"}),"."]}),"\n",(0,o.jsx)(n.h2,{id:"integrate-openrag-chat-into-an-application",children:"Integrate OpenRAG chat into an application"}),"\n",(0,o.jsxs)(n.p,{children:["You can integrate OpenRAG flows into your applications using the ",(0,o.jsx)(n.a,{href:"https://docs.langflow.org/api-reference-api-examples",children:"Langflow API"}),".\nTo simplify this integration, you can get pre-configured code snippets directly from the embedded Langflow visual editor."]}),"\n",(0,o.jsxs)(n.p,{children:["The following example demonstrates how to generate and use code snippets for the ",(0,o.jsx)(n.strong,{children:"OpenRAG OpenSearch Agent"})," flow:"]}),"\n",(0,o.jsx)(i.Ay,{})]})}function g(e={}){const{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,o.jsx)(n,{...e,children:(0,o.jsx)(p,{...e})}):p(e)}},3982:(e,n,t)=>{t.d(n,{A:()=>s});const s=t.p+"assets/images/opensearch-agent-flow-f3b279e02425cd043002eb7749067108.png"},7224:(e,n,t)=>{t.d(n,{Ay:()=>h,RM:()=>l});var s=t(4848),o=t(8453),r=t(9179),a=t(1470),i=t(9365);const l=[];function c(e){const n={a:"a",code:"code",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,o.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(n.ol,{children:["\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["Open the ",(0,s.jsx)(n.strong,{children:"OpenRAG OpenSearch Agent"})," flow in the Langflow visual editor: From the ",(0,s.jsx)(n.strong,{children:"Chat"})," window, click ",(0,s.jsx)(r.A,{name:"Settings2","aria-hidden":"true"})," ",(0,s.jsx)(n.strong,{children:"Settings"}),", click ",(0,s.jsx)(n.strong,{children:"Edit in Langflow"}),", and then click ",(0,s.jsx)(n.strong,{children:"Proceed"}),"."]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["Optional: If you don't want to use the Langflow API key that is generated automatically when you install OpenRAG, you can create a ",(0,s.jsx)(n.a,{href:"https://docs.langflow.org/api-keys-and-authentication",children:"Langflow API key"}),".\nThis key doesn't grant access to OpenRAG; it is only for authenticating with the Langflow API."]}),"\n",(0,s.jsxs)(n.ol,{children:["\n",(0,s.jsxs)(n.li,{children:["In the Langflow visual editor, click your user icon in the header, and then select ",(0,s.jsx)(n.strong,{children:"Settings"}),"."]}),"\n",(0,s.jsxs)(n.li,{children:["Click ",(0,s.jsx)(n.strong,{children:"Langflow API Keys"}),", and then click ",(0,s.jsx)(r.A,{name:"Plus","aria-hidden":"true"})," ",(0,s.jsx)(n.strong,{children:"Add New"}),"."]}),"\n",(0,s.jsxs)(n.li,{children:["Name your key, and then click ",(0,s.jsx)(n.strong,{children:"Create API Key"}),"."]}),"\n",(0,s.jsx)(n.li,{children:"Copy the API key and store it securely."}),"\n",(0,s.jsxs)(n.li,{children:["Exit the Langflow ",(0,s.jsx)(n.strong,{children:"Settings"})," page to return to the visual editor."]}),"\n"]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["Click ",(0,s.jsx)(n.strong,{children:"Share"}),", and then select ",(0,s.jsx)(n.strong,{children:"API access"})," to get pregenerated code snippets that call the Langflow API and run the flow."]}),"\n",(0,s.jsxs)(n.p,{children:["These code snippets construct API requests with your Langflow server URL (",(0,s.jsx)(n.code,{children:"LANGFLOW_SERVER_ADDRESS"}),"), the flow to run (",(0,s.jsx)(n.code,{children:"FLOW_ID"}),"), required headers (",(0,s.jsx)(n.code,{children:"LANGFLOW_API_KEY"}),", ",(0,s.jsx)(n.code,{children:"Content-Type"}),"), and a payload containing the required inputs to run the flow, including a default chat input message."]}),"\n",(0,s.jsx)(n.p,{children:"In production, you would modify the inputs to suit your application logic. For example, you could replace the default chat input message with dynamic user input."}),"\n",(0,s.jsxs)(a.A,{children:[(0,s.jsx)(i.A,{value:"python",label:"Python",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python",children:'import requests\nimport os\nimport uuid\n\napi_key = \'LANGFLOW_API_KEY\'\nurl = "http://LANGFLOW_SERVER_ADDRESS/api/v1/run/FLOW_ID" # The complete API endpoint URL for this flow\n\n# Request payload configuration\npayload = {\n "output_type": "chat",\n "input_type": "chat",\n "input_value": "hello world!"\n}\npayload["session_id"] = str(uuid.uuid4())\n\nheaders = {"x-api-key": api_key}\n\ntry:\n # Send API request\n response = requests.request("POST", url, json=payload, headers=headers)\n response.raise_for_status() # Raise exception for bad status codes\n\n # Print response\n print(response.text)\n\nexcept requests.exceptions.RequestException as e:\n print(f"Error making API request: {e}")\nexcept ValueError as e:\n print(f"Error parsing response: {e}")\n'})})}),(0,s.jsx)(i.A,{value:"typescript",label:"TypeScript",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typescript",children:'const crypto = require(\'crypto\');\nconst apiKey = \'LANGFLOW_API_KEY\';\nconst payload = {\n "output_type": "chat",\n "input_type": "chat",\n "input_value": "hello world!"\n};\npayload.session_id = crypto.randomUUID();\n\nconst options = {\n method: \'POST\',\n headers: {\n \'Content-Type\': \'application/json\',\n "x-api-key": apiKey\n },\n body: JSON.stringify(payload)\n};\n\nfetch(\'http://LANGFLOW_SERVER_ADDRESS/api/v1/run/FLOW_ID\', options)\n .then(response => response.json())\n .then(response => console.warn(response))\n .catch(err => console.error(err));\n'})})}),(0,s.jsx)(i.A,{value:"curl",label:"curl",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-bash",children:'curl --request POST \\\n --url \'http://LANGFLOW_SERVER_ADDRESS/api/v1/run/FLOW_ID?stream=false\' \\\n --header \'Content-Type: application/json\' \\\n --header "x-api-key: LANGFLOW_API_KEY" \\\n --data \'{\n "output_type": "chat",\n "input_type": "chat",\n "input_value": "hello world!"\n }\'\n'})})})]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsx)(n.p,{children:"Copy your preferred snippet, and then run it:"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Python"}),": Paste the snippet into a ",(0,s.jsx)(n.code,{children:".py"})," file, save it, and then run it with ",(0,s.jsx)(n.code,{children:"python filename.py"}),"."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"TypeScript"}),": Paste the snippet into a ",(0,s.jsx)(n.code,{children:".ts"})," file, save it, and then run it with ",(0,s.jsx)(n.code,{children:"ts-node filename.ts"}),"."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"curl"}),": Paste and run snippet directly in your terminal."]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,s.jsx)(n.p,{children:"If the request is successful, the response includes many details about the flow run, including the session ID, inputs, outputs, components, durations, and more."}),"\n",(0,s.jsxs)(n.p,{children:["In production, you won't pass the raw response to the user in its entirety.\nInstead, you extract and reformat relevant fields for different use cases, as demonstrated in the ",(0,s.jsx)(n.a,{href:"https://docs.langflow.org/quickstart#extract-data-from-the-response",children:"Langflow quickstart"}),".\nFor example, you could pass the chat output text to a front-end user-facing application, and store specific fields in logs and backend data stores for monitoring, chat history, or analytics.\nYou could also pass the output from one flow as input to another flow."]})]})}function h(e={}){const{wrapper:n}={...(0,o.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(c,{...e})}):c(e)}},8401:(e,n,t)=>{t.d(n,{Ay:()=>l,RM:()=>a});var s=t(4848),o=t(8453),r=t(9179);const a=[];function i(e){const n={p:"p",strong:"strong",...(0,o.R)(),...e.components};return(0,s.jsxs)(n.p,{children:["When using the OpenRAG ",(0,s.jsx)(n.strong,{children:"Chat"}),", click ",(0,s.jsx)(r.A,{name:"Plus","aria-hidden":"true"})," in the chat input field to upload a file to the current chat session.\nFiles added this way are processed and made available to the agent for the current conversation only.\nThese files aren't stored in the knowledge base permanently."]})}function l(e={}){const{wrapper:n}={...(0,o.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(i,{...e})}):i(e)}},9179:(e,n,t)=>{t.d(n,{A:()=>r});t(6540);var s=t(7856),o=t(4848);function r({name:e,...n}){const t=s[e];return t?(0,o.jsx)(t,{...n}):null}},9365:(e,n,t)=>{t.d(n,{A:()=>a});t(6540);var s=t(4164);const o={tabItem:"tabItem_Ymn6"};var r=t(4848);function a({children:e,hidden:n,className:t}){return(0,r.jsx)("div",{role:"tabpanel",className:(0,s.A)(o.tabItem,t),hidden:n,children:e})}}}]); \ No newline at end of file diff --git a/assets/js/af920ffe.492f9e55.js b/assets/js/af920ffe.5a239774.js similarity index 96% rename from assets/js/af920ffe.492f9e55.js rename to assets/js/af920ffe.5a239774.js index 63b94f0f..f7b2adfa 100644 --- a/assets/js/af920ffe.492f9e55.js +++ b/assets/js/af920ffe.5a239774.js @@ -1 +1 @@ -"use strict";(globalThis.webpackChunkopenrag_docs=globalThis.webpackChunkopenrag_docs||[]).push([[98],{1260:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>u,contentTitle:()=>h,default:()=>x,frontMatter:()=>d,metadata:()=>s,toc:()=>p});const s=JSON.parse('{"id":"get-started/quickstart","title":"Quickstart","description":"Use this quickstart to install OpenRAG, and then try some of OpenRAG\'s core features.","source":"@site/docs/get-started/quickstart.mdx","sourceDirName":"get-started","slug":"/quickstart","permalink":"/quickstart","draft":false,"unlisted":false,"editUrl":"https://github.com/openrag/openrag/tree/main/docs/docs/get-started/quickstart.mdx","tags":[],"version":"current","frontMatter":{"title":"Quickstart","slug":"/quickstart"},"sidebar":"tutorialSidebar","previous":{"title":"About OpenRAG","permalink":"/"},"next":{"title":"Select an installation method","permalink":"/install-options"}}');var r=t(4848),i=t(8453),a=t(9179),o=(t(1470),t(9365),t(7224)),l=t(6149),c=t(4042);const d={title:"Quickstart",slug:"/quickstart"},h=void 0,u={},p=[{value:"Prerequisites",id:"prerequisites",level:2},...c.RM,...l.RM,{value:"Install OpenRAG",id:"install-openrag",level:2},{value:"Load and chat with documents",id:"chat-with-documents",level:2},{value:"Change the language model and chat settings",id:"change-components",level:2},{value:"Integrate OpenRAG into an application",id:"integrate-openrag-into-an-application",level:2},...o.RM,{value:"Next steps",id:"next-steps",level:2}];function g(e){const n={a:"a",code:"code",h2:"h2",img:"img",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,i.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.p,{children:"Use this quickstart to install OpenRAG, and then try some of OpenRAG's core features."}),"\n",(0,r.jsx)(n.h2,{id:"prerequisites",children:"Prerequisites"}),"\n",(0,r.jsx)(c.Ay,{}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["Get an ",(0,r.jsx)(n.a,{href:"https://platform.openai.com/api-keys",children:"OpenAI API key"}),".\nThis quickstart uses OpenAI for simplicity.\nFor other providers, see the other ",(0,r.jsx)(n.a,{href:"/install-options",children:"installation methods"}),"."]}),"\n"]}),"\n",(0,r.jsx)(l.Ay,{}),"\n",(0,r.jsx)(n.h2,{id:"install-openrag",children:"Install OpenRAG"}),"\n",(0,r.jsxs)(n.p,{children:["For this quickstart, install OpenRAG with the automatic installer script and basic setup.\nThe script installs OpenRAG dependencies, including Docker or Podman, and then it installs and runs OpenRAG with ",(0,r.jsx)(n.a,{href:"https://docs.astral.sh/uv/guides/tools/#running-tools",children:(0,r.jsx)(n.code,{children:"uvx"})}),"."]}),"\n",(0,r.jsxs)(n.ol,{children:["\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsx)(n.p,{children:"Create a directory for your OpenRAG installation, and then change to that directory:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:"mkdir openrag-workspace\ncd openrag-workspace\n"})}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.a,{href:"https://docs.openr.ag/files/run_openrag_with_prereqs.sh",children:"Download the OpenRAG install script"}),", move it to your OpenRAG directory, and then run it:"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:"bash run_openrag_with_prereqs.sh\n"})}),"\n",(0,r.jsx)(n.p,{children:"Wait while the installer script prepares your environment and installs OpenRAG.\nYou might be prompted to install certain dependencies if they aren't already present in your environment."}),"\n",(0,r.jsxs)(n.p,{children:["The entire process can take a few minutes.\nOnce the environment is ready, the OpenRAG ",(0,r.jsx)(n.a,{href:"/tui",children:"Terminal User Interface (TUI)"})," starts."]}),"\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.img,{alt:"OpenRAG TUI Interface",src:t(5689).A+"",width:"1995",height:"1099"})}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["In the TUI, click ",(0,r.jsx)(n.strong,{children:"Basic Setup"}),"."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Click ",(0,r.jsx)(n.strong,{children:"Generate Passwords"})," to create administrator passwords for your OpenRAG OpenSearch and Langflow services."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Leave the ",(0,r.jsx)(n.strong,{children:"OpenAI API key"})," field empty."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Click ",(0,r.jsx)(n.strong,{children:"Save Configuration"}),", and then click ",(0,r.jsx)(n.strong,{children:"Start All Services"}),"."]}),"\n",(0,r.jsx)(n.p,{children:"This process can take some time while OpenRAG pulls and runs the container images.\nIf all services start successfully, the TUI prints a confirmation message:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-text",children:"Services started successfully\nCommand completed successfully\n"})}),"\n",(0,r.jsxs)(n.p,{children:["Your OpenRAG configuration and passwords are stored in an ",(0,r.jsxs)(n.a,{href:"/reference/configuration",children:["OpenRAG ",(0,r.jsx)(n.code,{children:".env"})," file"]})," file that is created automatically at ",(0,r.jsx)(n.code,{children:"~/.openrag/tui"}),".\nContainer definitions are stored in the ",(0,r.jsx)(n.code,{children:"docker-compose"})," files in the same directory."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Under ",(0,r.jsx)(n.a,{href:"/manage-services",children:(0,r.jsx)(n.strong,{children:"Native Services"})}),", click ",(0,r.jsx)(n.strong,{children:"Start"})," to start the Docling service."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["From the TUI main menu, click ",(0,r.jsx)(n.strong,{children:"Open App"})," to launch the OpenRAG application and start the application onboarding process."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["For this quickstart, select the ",(0,r.jsx)(n.strong,{children:"OpenAI"})," model provider, enter your OpenAI API key, and then click ",(0,r.jsx)(n.strong,{children:"Complete"}),". Use the default settings for all other model options."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Click through the overview slides for a brief introduction to OpenRAG, or click ",(0,r.jsx)(a.A,{name:"ArrowRight","aria-hidden":"true"})," ",(0,r.jsx)(n.strong,{children:"Skip overview"}),".\nYou can complete this quickstart without going through the overview.\nThe overview demonstrates some basic functionality that is covered in the next section and in other parts of the OpenRAG documentation."]}),"\n"]}),"\n"]}),"\n",(0,r.jsx)(n.h2,{id:"chat-with-documents",children:"Load and chat with documents"}),"\n",(0,r.jsxs)(n.p,{children:["Use the ",(0,r.jsxs)(n.a,{href:"/chat",children:["OpenRAG ",(0,r.jsx)(n.strong,{children:"Chat"})]})," to explore the documents in your OpenRAG database using natural language queries.\nSome documents are included by default to get you started, and you can load your own documents."]}),"\n",(0,r.jsxs)(n.ol,{children:["\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["In OpenRAG, click ",(0,r.jsx)(a.A,{name:"MessageSquare","aria-hidden":"true"})," ",(0,r.jsx)(n.strong,{children:"Chat"}),"."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["For this quickstart, ask the agent what documents are available.\nFor example: ",(0,r.jsx)(n.code,{children:"What documents are available to you?"})]}),"\n",(0,r.jsx)(n.p,{children:"The agent responds with a summary of OpenRAG's default documents."}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["To verify the agent's response, click ",(0,r.jsx)(a.A,{name:"Library","aria-hidden":"true"})," ",(0,r.jsx)(n.strong,{children:"Knowledge"})," to view the documents stored in the OpenRAG OpenSearch database.\nYou can click a document to view the chunks of the document as they are stored in the database."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Click ",(0,r.jsx)(n.strong,{children:"Add Knowledge"})," to add your own documents to your OpenRAG knowledge base."]}),"\n",(0,r.jsxs)(n.p,{children:["For this quickstart, use either the ",(0,r.jsx)(a.A,{name:"File","aria-hidden":"true"})," ",(0,r.jsx)(n.strong,{children:"File"})," or ",(0,r.jsx)(a.A,{name:"Folder","aria-hidden":"true"})," ",(0,r.jsx)(n.strong,{children:"Folder"})," upload options to load documents from your local machine.\n",(0,r.jsx)(n.strong,{children:"Folder"})," uploads an entire directory.\nThe default directory is ",(0,r.jsx)(n.code,{children:"~/.openrag/documents"}),"."]}),"\n",(0,r.jsxs)(n.p,{children:["For information about the cloud storage provider options, see ",(0,r.jsx)(n.a,{href:"/ingestion#oauth-ingestion",children:"Ingest files with OAuth connectors"}),"."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Return to the ",(0,r.jsx)(n.strong,{children:"Chat"})," window, and then ask a question related to the documents that you just uploaded."]}),"\n",(0,r.jsx)(n.p,{children:"If the agent's response doesn't seem to reference your documents correctly, try the following:"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Click ",(0,r.jsx)(a.A,{name:"Gear","aria-hidden":"true"})," ",(0,r.jsx)(n.strong,{children:"Function Call: search_documents (tool_call)"})," to view the log of tool calls made by the agent. This is helpful for troubleshooting because it shows you how the agent used particular tools."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Click ",(0,r.jsx)(a.A,{name:"Library","aria-hidden":"true"})," ",(0,r.jsx)(n.strong,{children:"Knowledge"})," to confirm that the documents are present in the OpenRAG OpenSearch database, and then click each document to see how the document was chunked.\nIf a document was chunked improperly, you might need to tweak the ingestion or modify and reupload the document."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Click ",(0,r.jsx)(a.A,{name:"Settings2","aria-hidden":"true"})," ",(0,r.jsx)(n.strong,{children:"Settings"})," to modify the knowledge ingestion settings."]}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(n.p,{children:["For more information, see ",(0,r.jsx)(n.a,{href:"/knowledge",children:"Configure knowledge"})," and ",(0,r.jsx)(n.a,{href:"/ingestion",children:"Ingest knowledge"}),"."]}),"\n"]}),"\n"]}),"\n",(0,r.jsx)(n.h2,{id:"change-components",children:"Change the language model and chat settings"}),"\n",(0,r.jsxs)(n.ol,{children:["\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["To change the knowledge ingestion settings, agent behavior, or language model, click ",(0,r.jsx)(a.A,{name:"Settings2","aria-hidden":"true"})," ",(0,r.jsx)(n.strong,{children:"Settings"}),"."]}),"\n",(0,r.jsxs)(n.p,{children:["The ",(0,r.jsx)(n.strong,{children:"Settings"})," page provides quick access to commonly used parameters like the ",(0,r.jsx)(n.strong,{children:"Language model"})," and ",(0,r.jsx)(n.strong,{children:"Agent Instructions"}),"."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["For greater insight into the underlying ",(0,r.jsx)(n.a,{href:"/agents",children:"Langflow flow"})," that drives the OpenRAG chat, click ",(0,r.jsx)(n.strong,{children:"Edit in Langflow"})," and then click ",(0,r.jsx)(n.strong,{children:"Proceed"})," to launch the Langflow visual editor in a new browser window."]}),"\n",(0,r.jsxs)(n.p,{children:["If Langflow requests login information, enter the ",(0,r.jsx)(n.code,{children:"LANGFLOW_SUPERUSER"})," and ",(0,r.jsx)(n.code,{children:"LANGFLOW_SUPERUSER_PASSWORD"})," from the ",(0,r.jsx)(n.code,{children:".env"})," file at ",(0,r.jsx)(n.code,{children:"~/.openrag/tui"}),"."]}),"\n",(0,r.jsxs)(n.p,{children:["The ",(0,r.jsx)(n.strong,{children:"OpenRAG OpenSearch Agent"})," flow opens in a new browser window."]}),"\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.img,{alt:"OpenRAG OpenSearch Agent flow",src:t(3982).A+"",width:"4084",height:"2176"})}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["For this quickstart, try changing the model.\nClick the ",(0,r.jsx)(n.strong,{children:"Language Model"})," component, and then change the ",(0,r.jsx)(n.strong,{children:"Model Name"})," to a different OpenAI model."]}),"\n",(0,r.jsxs)(n.p,{children:["After you edit a built-in flow, you can click ",(0,r.jsx)(n.strong,{children:"Restore flow"})," on the ",(0,r.jsx)(n.strong,{children:"Settings"})," page to revert the flow to its original state when you first installed OpenRAG."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Press ",(0,r.jsx)("kbd",{children:"Command"}),"+",(0,r.jsx)("kbd",{children:"S"})," (",(0,r.jsx)("kbd",{children:"Ctrl"}),"+",(0,r.jsx)("kbd",{children:"S"}),") to save your changes."]}),"\n",(0,r.jsx)(n.p,{children:"You can close the Langflow browser window, or leave it open if you want to continue experimenting with the flow editor."}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Switch to your OpenRAG browser window, and then click ",(0,r.jsx)(a.A,{name:"Plus","aria-hidden":"true"})," in the ",(0,r.jsx)(n.strong,{children:"Conversations"})," tab to start a new conversation.\nThis ensures that the chat doesn't persist any context from the previous conversation with the original model."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Ask the same question you asked in ",(0,r.jsx)(n.a,{href:"#chat-with-documents",children:"Load and chat with documents"})," to see how the response differs from the original model."]}),"\n"]}),"\n"]}),"\n",(0,r.jsx)(n.h2,{id:"integrate-openrag-into-an-application",children:"Integrate OpenRAG into an application"}),"\n",(0,r.jsxs)(n.p,{children:["Langflow in OpenRAG includes pre-built flows that you can integrate into your applications using the ",(0,r.jsx)(n.a,{href:"https://docs.langflow.org/api-reference-api-examples",children:"Langflow API"}),".\nYou can use these flows as-is or modify them to better suit your needs, as demonstrated in ",(0,r.jsx)(n.a,{href:"#change-components",children:"Change the language model and chat settings"}),"."]}),"\n",(0,r.jsx)(n.p,{children:"You can send and receive requests with the Langflow API using Python, TypeScript, or curl."}),"\n",(0,r.jsx)(o.Ay,{}),"\n",(0,r.jsx)(n.h2,{id:"next-steps",children:"Next steps"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.strong,{children:"Reinstall OpenRAG with your preferred settings"}),": This quickstart used ",(0,r.jsx)(n.code,{children:"uvx"})," and a minimal setup to demonstrate OpenRAG's core functionality.\nIt is recommended that you ",(0,r.jsx)(n.a,{href:"/reinstall",children:"reinstall OpenRAG"})," with your preferred configuration and ",(0,r.jsx)(n.a,{href:"/install-options",children:"installation method"}),"."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.strong,{children:"Learn more about OpenRAG"}),": Explore OpenRAG and the OpenRAG documentation to learn more about its features and functionality."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.strong,{children:"Learn more about Langflow"}),": For a deep dive on the Langflow API and visual editor, see the ",(0,r.jsx)(n.a,{href:"https://docs.langflow.org/",children:"Langflow documentation"}),"."]}),"\n"]}),"\n"]})]})}function x(e={}){const{wrapper:n}={...(0,i.R)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(g,{...e})}):g(e)}},1470:(e,n,t)=>{t.d(n,{A:()=>b});var s=t(6540),r=t(4164),i=t(7559),a=t(3104),o=t(6347),l=t(205),c=t(7485),d=t(1682),h=t(679);function u(e){return s.Children.toArray(e).filter(e=>"\n"!==e).map(e=>{if(!e||(0,s.isValidElement)(e)&&function(e){const{props:n}=e;return!!n&&"object"==typeof n&&"value"in n}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)})?.filter(Boolean)??[]}function p(e){const{values:n,children:t}=e;return(0,s.useMemo)(()=>{const e=n??function(e){return u(e).map(({props:{value:e,label:n,attributes:t,default:s}})=>({value:e,label:n,attributes:t,default:s}))}(t);return function(e){const n=(0,d.XI)(e,(e,n)=>e.value===n.value);if(n.length>0)throw new Error(`Docusaurus error: Duplicate values "${n.map(e=>e.value).join(", ")}" found in . Every value needs to be unique.`)}(e),e},[n,t])}function g({value:e,tabValues:n}){return n.some(n=>n.value===e)}function x({queryString:e=!1,groupId:n}){const t=(0,o.W6)(),r=function({queryString:e=!1,groupId:n}){if("string"==typeof e)return e;if(!1===e)return null;if(!0===e&&!n)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return n??null}({queryString:e,groupId:n});return[(0,c.aZ)(r),(0,s.useCallback)(e=>{if(!r)return;const n=new URLSearchParams(t.location.search);n.set(r,e),t.replace({...t.location,search:n.toString()})},[r,t])]}function j(e){const{defaultValue:n,queryString:t=!1,groupId:r}=e,i=p(e),[a,o]=(0,s.useState)(()=>function({defaultValue:e,tabValues:n}){if(0===n.length)throw new Error("Docusaurus error: the component requires at least one children component");if(e){if(!g({value:e,tabValues:n}))throw new Error(`Docusaurus error: The has a defaultValue "${e}" but none of its children has the corresponding value. Available values are: ${n.map(e=>e.value).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return e}const t=n.find(e=>e.default)??n[0];if(!t)throw new Error("Unexpected error: 0 tabValues");return t.value}({defaultValue:n,tabValues:i})),[c,d]=x({queryString:t,groupId:r}),[u,j]=function({groupId:e}){const n=function(e){return e?`docusaurus.tab.${e}`:null}(e),[t,r]=(0,h.Dv)(n);return[t,(0,s.useCallback)(e=>{n&&r.set(e)},[n,r])]}({groupId:r}),f=(()=>{const e=c??u;return g({value:e,tabValues:i})?e:null})();(0,l.A)(()=>{f&&o(f)},[f]);return{selectedValue:a,selectValue:(0,s.useCallback)(e=>{if(!g({value:e,tabValues:i}))throw new Error(`Can't select invalid tab value=${e}`);o(e),d(e),j(e)},[d,j,i]),tabValues:i}}var f=t(2303);const m={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var y=t(4848);function w({className:e,block:n,selectedValue:t,selectValue:s,tabValues:i}){const o=[],{blockElementScrollPositionUntilNextRender:l}=(0,a.a_)(),c=e=>{const n=e.currentTarget,r=o.indexOf(n),a=i[r].value;a!==t&&(l(n),s(a))},d=e=>{let n=null;switch(e.key){case"Enter":c(e);break;case"ArrowRight":{const t=o.indexOf(e.currentTarget)+1;n=o[t]??o[0];break}case"ArrowLeft":{const t=o.indexOf(e.currentTarget)-1;n=o[t]??o[o.length-1];break}}n?.focus()};return(0,y.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,r.A)("tabs",{"tabs--block":n},e),children:i.map(({value:e,label:n,attributes:s})=>(0,y.jsx)("li",{role:"tab",tabIndex:t===e?0:-1,"aria-selected":t===e,ref:e=>{o.push(e)},onKeyDown:d,onClick:c,...s,className:(0,r.A)("tabs__item",m.tabItem,s?.className,{"tabs__item--active":t===e}),children:n??e},e))})}function A({lazy:e,children:n,selectedValue:t}){const i=(Array.isArray(n)?n:[n]).filter(Boolean);if(e){const e=i.find(e=>e.props.value===t);return e?(0,s.cloneElement)(e,{className:(0,r.A)("margin-top--md",e.props.className)}):null}return(0,y.jsx)("div",{className:"margin-top--md",children:i.map((e,n)=>(0,s.cloneElement)(e,{key:n,hidden:e.props.value!==t}))})}function v(e){const n=j(e);return(0,y.jsxs)("div",{className:(0,r.A)(i.G.tabs.container,"tabs-container",m.tabList),children:[(0,y.jsx)(w,{...n,...e}),(0,y.jsx)(A,{...n,...e})]})}function b(e){const n=(0,f.A)();return(0,y.jsx)(v,{...e,children:u(e.children)},String(n))}},3982:(e,n,t)=>{t.d(n,{A:()=>s});const s=t.p+"assets/images/opensearch-agent-flow-f3b279e02425cd043002eb7749067108.png"},4042:(e,n,t)=>{t.d(n,{Ay:()=>o,RM:()=>i});var s=t(4848),r=t(8453);const i=[];function a(e){const n={a:"a",li:"li",ul:"ul",...(0,r.R)(),...e.components};return(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:["Install ",(0,s.jsx)(n.a,{href:"https://www.python.org/downloads/release/python-3100/",children:"Python"})," version 3.13 or later."]}),"\n"]})}function o(e={}){const{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(a,{...e})}):a(e)}},5689:(e,n,t)=>{t.d(n,{A:()=>s});const s=t.p+"assets/images/OpenRAG_TUI_2025-09-10T13_04_11_757637-9441c53ba39162a88ac6c11cbeaed0e0.svg"},6149:(e,n,t)=>{t.d(n,{Ay:()=>o,RM:()=>i});var s=t(4848),r=t(8453);const i=[];function a(e){const n={a:"a",li:"li",ul:"ul",...(0,r.R)(),...e.components};return(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:["For Microsoft Windows, you must use the Windows Subsystem for Linux (WSL).\nSee ",(0,s.jsx)(n.a,{href:"/install-windows",children:"Install OpenRAG on Windows"})," before proceeding."]}),"\n"]})}function o(e={}){const{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(a,{...e})}):a(e)}},7224:(e,n,t)=>{t.d(n,{Ay:()=>d,RM:()=>l});var s=t(4848),r=t(8453),i=t(9179),a=t(1470),o=t(9365);const l=[];function c(e){const n={a:"a",code:"code",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,r.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(n.ol,{children:["\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["Open the ",(0,s.jsx)(n.strong,{children:"OpenRAG OpenSearch Agent"})," flow in the Langflow visual editor: From the ",(0,s.jsx)(n.strong,{children:"Chat"})," window, click ",(0,s.jsx)(i.A,{name:"Settings2","aria-hidden":"true"})," ",(0,s.jsx)(n.strong,{children:"Settings"}),", click ",(0,s.jsx)(n.strong,{children:"Edit in Langflow"}),", and then click ",(0,s.jsx)(n.strong,{children:"Proceed"}),"."]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["Optional: If you don't want to use the Langflow API key that is generated automatically when you install OpenRAG, you can create a ",(0,s.jsx)(n.a,{href:"https://docs.langflow.org/api-keys-and-authentication",children:"Langflow API key"}),".\nThis key doesn't grant access to OpenRAG; it is only for authenticating with the Langflow API."]}),"\n",(0,s.jsxs)(n.ol,{children:["\n",(0,s.jsxs)(n.li,{children:["In the Langflow visual editor, click your user icon in the header, and then select ",(0,s.jsx)(n.strong,{children:"Settings"}),"."]}),"\n",(0,s.jsxs)(n.li,{children:["Click ",(0,s.jsx)(n.strong,{children:"Langflow API Keys"}),", and then click ",(0,s.jsx)(i.A,{name:"Plus","aria-hidden":"true"})," ",(0,s.jsx)(n.strong,{children:"Add New"}),"."]}),"\n",(0,s.jsxs)(n.li,{children:["Name your key, and then click ",(0,s.jsx)(n.strong,{children:"Create API Key"}),"."]}),"\n",(0,s.jsx)(n.li,{children:"Copy the API key and store it securely."}),"\n",(0,s.jsxs)(n.li,{children:["Exit the Langflow ",(0,s.jsx)(n.strong,{children:"Settings"})," page to return to the visual editor."]}),"\n"]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["Click ",(0,s.jsx)(n.strong,{children:"Share"}),", and then select ",(0,s.jsx)(n.strong,{children:"API access"})," to get pregenerated code snippets that call the Langflow API and run the flow."]}),"\n",(0,s.jsxs)(n.p,{children:["These code snippets construct API requests with your Langflow server URL (",(0,s.jsx)(n.code,{children:"LANGFLOW_SERVER_ADDRESS"}),"), the flow to run (",(0,s.jsx)(n.code,{children:"FLOW_ID"}),"), required headers (",(0,s.jsx)(n.code,{children:"LANGFLOW_API_KEY"}),", ",(0,s.jsx)(n.code,{children:"Content-Type"}),"), and a payload containing the required inputs to run the flow, including a default chat input message."]}),"\n",(0,s.jsx)(n.p,{children:"In production, you would modify the inputs to suit your application logic. For example, you could replace the default chat input message with dynamic user input."}),"\n",(0,s.jsxs)(a.A,{children:[(0,s.jsx)(o.A,{value:"python",label:"Python",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python",children:'import requests\nimport os\nimport uuid\n\napi_key = \'LANGFLOW_API_KEY\'\nurl = "http://LANGFLOW_SERVER_ADDRESS/api/v1/run/FLOW_ID" # The complete API endpoint URL for this flow\n\n# Request payload configuration\npayload = {\n "output_type": "chat",\n "input_type": "chat",\n "input_value": "hello world!"\n}\npayload["session_id"] = str(uuid.uuid4())\n\nheaders = {"x-api-key": api_key}\n\ntry:\n # Send API request\n response = requests.request("POST", url, json=payload, headers=headers)\n response.raise_for_status() # Raise exception for bad status codes\n\n # Print response\n print(response.text)\n\nexcept requests.exceptions.RequestException as e:\n print(f"Error making API request: {e}")\nexcept ValueError as e:\n print(f"Error parsing response: {e}")\n'})})}),(0,s.jsx)(o.A,{value:"typescript",label:"TypeScript",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typescript",children:'const crypto = require(\'crypto\');\nconst apiKey = \'LANGFLOW_API_KEY\';\nconst payload = {\n "output_type": "chat",\n "input_type": "chat",\n "input_value": "hello world!"\n};\npayload.session_id = crypto.randomUUID();\n\nconst options = {\n method: \'POST\',\n headers: {\n \'Content-Type\': \'application/json\',\n "x-api-key": apiKey\n },\n body: JSON.stringify(payload)\n};\n\nfetch(\'http://LANGFLOW_SERVER_ADDRESS/api/v1/run/FLOW_ID\', options)\n .then(response => response.json())\n .then(response => console.warn(response))\n .catch(err => console.error(err));\n'})})}),(0,s.jsx)(o.A,{value:"curl",label:"curl",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-bash",children:'curl --request POST \\\n --url \'http://LANGFLOW_SERVER_ADDRESS/api/v1/run/FLOW_ID?stream=false\' \\\n --header \'Content-Type: application/json\' \\\n --header "x-api-key: LANGFLOW_API_KEY" \\\n --data \'{\n "output_type": "chat",\n "input_type": "chat",\n "input_value": "hello world!"\n }\'\n'})})})]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsx)(n.p,{children:"Copy your preferred snippet, and then run it:"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Python"}),": Paste the snippet into a ",(0,s.jsx)(n.code,{children:".py"})," file, save it, and then run it with ",(0,s.jsx)(n.code,{children:"python filename.py"}),"."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"TypeScript"}),": Paste the snippet into a ",(0,s.jsx)(n.code,{children:".ts"})," file, save it, and then run it with ",(0,s.jsx)(n.code,{children:"ts-node filename.ts"}),"."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"curl"}),": Paste and run snippet directly in your terminal."]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,s.jsx)(n.p,{children:"If the request is successful, the response includes many details about the flow run, including the session ID, inputs, outputs, components, durations, and more."}),"\n",(0,s.jsxs)(n.p,{children:["In production, you won't pass the raw response to the user in its entirety.\nInstead, you extract and reformat relevant fields for different use cases, as demonstrated in the ",(0,s.jsx)(n.a,{href:"https://docs.langflow.org/quickstart#extract-data-from-the-response",children:"Langflow quickstart"}),".\nFor example, you could pass the chat output text to a front-end user-facing application, and store specific fields in logs and backend data stores for monitoring, chat history, or analytics.\nYou could also pass the output from one flow as input to another flow."]})]})}function d(e={}){const{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(c,{...e})}):c(e)}},9179:(e,n,t)=>{t.d(n,{A:()=>i});t(6540);var s=t(7856),r=t(4848);function i({name:e,...n}){const t=s[e];return t?(0,r.jsx)(t,{...n}):null}},9365:(e,n,t)=>{t.d(n,{A:()=>a});t(6540);var s=t(4164);const r={tabItem:"tabItem_Ymn6"};var i=t(4848);function a({children:e,hidden:n,className:t}){return(0,i.jsx)("div",{role:"tabpanel",className:(0,s.A)(r.tabItem,t),hidden:n,children:e})}}}]); \ No newline at end of file +"use strict";(globalThis.webpackChunkopenrag_docs=globalThis.webpackChunkopenrag_docs||[]).push([[98],{1260:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>u,contentTitle:()=>h,default:()=>x,frontMatter:()=>d,metadata:()=>s,toc:()=>p});const s=JSON.parse('{"id":"get-started/quickstart","title":"Quickstart","description":"Use this quickstart to install OpenRAG, and then try some of OpenRAG\'s core features.","source":"@site/docs/get-started/quickstart.mdx","sourceDirName":"get-started","slug":"/quickstart","permalink":"/quickstart","draft":false,"unlisted":false,"editUrl":"https://github.com/openrag/openrag/tree/main/docs/docs/get-started/quickstart.mdx","tags":[],"version":"current","frontMatter":{"title":"Quickstart","slug":"/quickstart"},"sidebar":"tutorialSidebar","previous":{"title":"About OpenRAG","permalink":"/"},"next":{"title":"Select an installation method","permalink":"/install-options"}}');var r=t(4848),i=t(8453),a=t(9179),o=(t(1470),t(9365),t(7224)),l=t(6149),c=t(4042);const d={title:"Quickstart",slug:"/quickstart"},h=void 0,u={},p=[{value:"Prerequisites",id:"prerequisites",level:2},...c.RM,...l.RM,{value:"Install OpenRAG",id:"install-openrag",level:2},{value:"Load and chat with documents",id:"chat-with-documents",level:2},{value:"Change the language model and chat settings",id:"change-components",level:2},{value:"Integrate OpenRAG into an application",id:"integrate-openrag-into-an-application",level:2},...o.RM,{value:"Next steps",id:"next-steps",level:2}];function g(e){const n={a:"a",code:"code",h2:"h2",img:"img",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,i.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.p,{children:"Use this quickstart to install OpenRAG, and then try some of OpenRAG's core features."}),"\n",(0,r.jsx)(n.h2,{id:"prerequisites",children:"Prerequisites"}),"\n",(0,r.jsx)(c.Ay,{}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["Get an ",(0,r.jsx)(n.a,{href:"https://platform.openai.com/api-keys",children:"OpenAI API key"}),".\nThis quickstart uses OpenAI for simplicity.\nFor other providers, see the other ",(0,r.jsx)(n.a,{href:"/install-options",children:"installation methods"}),"."]}),"\n"]}),"\n",(0,r.jsx)(l.Ay,{}),"\n",(0,r.jsx)(n.h2,{id:"install-openrag",children:"Install OpenRAG"}),"\n",(0,r.jsxs)(n.p,{children:["For this quickstart, install OpenRAG with the automatic installer script and basic setup.\nThe script installs OpenRAG dependencies, including Docker or Podman, and then it installs and runs OpenRAG with ",(0,r.jsx)(n.a,{href:"https://docs.astral.sh/uv/guides/tools/#running-tools",children:(0,r.jsx)(n.code,{children:"uvx"})}),"."]}),"\n",(0,r.jsxs)(n.ol,{children:["\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsx)(n.p,{children:"Create a directory for your OpenRAG installation, and then change to that directory:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:"mkdir openrag-workspace\ncd openrag-workspace\n"})}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.a,{href:"https://docs.openr.ag/files/run_openrag_with_prereqs.sh",children:"Download the OpenRAG install script"}),", move it to your OpenRAG directory, and then run it:"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:"bash run_openrag_with_prereqs.sh\n"})}),"\n",(0,r.jsx)(n.p,{children:"Wait while the installer script prepares your environment and installs OpenRAG.\nYou might be prompted to install certain dependencies if they aren't already present in your environment."}),"\n",(0,r.jsxs)(n.p,{children:["The entire process can take a few minutes.\nOnce the environment is ready, the OpenRAG ",(0,r.jsx)(n.a,{href:"/tui",children:"Terminal User Interface (TUI)"})," starts."]}),"\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.img,{alt:"OpenRAG TUI Interface",src:t(5689).A+"",width:"1995",height:"1099"})}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["In the TUI, click ",(0,r.jsx)(n.strong,{children:"Basic Setup"}),"."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Click ",(0,r.jsx)(n.strong,{children:"Generate Passwords"})," to create administrator passwords for your OpenRAG OpenSearch and Langflow services."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Leave the ",(0,r.jsx)(n.strong,{children:"OpenAI API key"})," field empty."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Click ",(0,r.jsx)(n.strong,{children:"Save Configuration"}),", and then click ",(0,r.jsx)(n.strong,{children:"Start All Services"}),"."]}),"\n",(0,r.jsx)(n.p,{children:"This process can take some time while OpenRAG pulls and runs the container images.\nIf all services start successfully, the TUI prints a confirmation message:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-text",children:"Services started successfully\nCommand completed successfully\n"})}),"\n",(0,r.jsxs)(n.p,{children:["Your OpenRAG configuration and passwords are stored in an ",(0,r.jsxs)(n.a,{href:"/reference/configuration",children:["OpenRAG ",(0,r.jsx)(n.code,{children:".env"})," file"]})," file that is created automatically at ",(0,r.jsx)(n.code,{children:"~/.openrag/tui"}),".\nContainer definitions are stored in the ",(0,r.jsx)(n.code,{children:"docker-compose"})," files in the same directory."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Under ",(0,r.jsx)(n.a,{href:"/manage-services",children:(0,r.jsx)(n.strong,{children:"Native Services"})}),", click ",(0,r.jsx)(n.strong,{children:"Start"})," to start the Docling service."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["From the TUI main menu, click ",(0,r.jsx)(n.strong,{children:"Open App"})," to launch the OpenRAG application and start the application onboarding process."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["For this quickstart, select the ",(0,r.jsx)(n.strong,{children:"OpenAI"})," model provider, enter your OpenAI API key, and then click ",(0,r.jsx)(n.strong,{children:"Complete"}),". Use the default settings for all other model options."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Click through the overview slides for a brief introduction to OpenRAG, or click ",(0,r.jsx)(a.A,{name:"ArrowRight","aria-hidden":"true"})," ",(0,r.jsx)(n.strong,{children:"Skip overview"}),".\nYou can complete this quickstart without going through the overview.\nThe overview demonstrates some basic functionality that is covered in the next section and in other parts of the OpenRAG documentation."]}),"\n"]}),"\n"]}),"\n",(0,r.jsx)(n.h2,{id:"chat-with-documents",children:"Load and chat with documents"}),"\n",(0,r.jsxs)(n.p,{children:["Use the ",(0,r.jsxs)(n.a,{href:"/chat",children:["OpenRAG ",(0,r.jsx)(n.strong,{children:"Chat"})]})," to explore the documents in your OpenRAG database using natural language queries.\nSome documents are included by default to get you started, and you can load your own documents."]}),"\n",(0,r.jsxs)(n.ol,{children:["\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["In OpenRAG, click ",(0,r.jsx)(a.A,{name:"MessageSquare","aria-hidden":"true"})," ",(0,r.jsx)(n.strong,{children:"Chat"}),"."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["For this quickstart, ask the agent what documents are available.\nFor example: ",(0,r.jsx)(n.code,{children:"What documents are available to you?"})]}),"\n",(0,r.jsx)(n.p,{children:"The agent responds with a summary of OpenRAG's default documents."}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["To verify the agent's response, click ",(0,r.jsx)(a.A,{name:"Library","aria-hidden":"true"})," ",(0,r.jsx)(n.strong,{children:"Knowledge"})," to view the documents stored in the OpenRAG OpenSearch database.\nYou can click a document to view the chunks of the document as they are stored in the database."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Click ",(0,r.jsx)(n.strong,{children:"Add Knowledge"})," to add your own documents to your OpenRAG knowledge base."]}),"\n",(0,r.jsxs)(n.p,{children:["For this quickstart, use either the ",(0,r.jsx)(a.A,{name:"File","aria-hidden":"true"})," ",(0,r.jsx)(n.strong,{children:"File"})," or ",(0,r.jsx)(a.A,{name:"Folder","aria-hidden":"true"})," ",(0,r.jsx)(n.strong,{children:"Folder"})," upload options to load documents from your local machine.\n",(0,r.jsx)(n.strong,{children:"Folder"})," uploads an entire directory.\nThe default directory is ",(0,r.jsx)(n.code,{children:"~/.openrag/documents"}),"."]}),"\n",(0,r.jsxs)(n.p,{children:["For information about the cloud storage provider options, see ",(0,r.jsx)(n.a,{href:"/ingestion#oauth-ingestion",children:"Ingest files with OAuth connectors"}),"."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Return to the ",(0,r.jsx)(n.strong,{children:"Chat"})," window, and then ask a question related to the documents that you just uploaded."]}),"\n",(0,r.jsx)(n.p,{children:"If the agent's response doesn't seem to reference your documents correctly, try the following:"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Click ",(0,r.jsx)(a.A,{name:"Gear","aria-hidden":"true"})," ",(0,r.jsx)(n.strong,{children:"Function Call: search_documents (tool_call)"})," to view the log of tool calls made by the agent. This is helpful for troubleshooting because it shows you how the agent used particular tools."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Click ",(0,r.jsx)(a.A,{name:"Library","aria-hidden":"true"})," ",(0,r.jsx)(n.strong,{children:"Knowledge"})," to confirm that the documents are present in the OpenRAG OpenSearch database, and then click each document to see how the document was chunked.\nIf a document was chunked improperly, you might need to tweak the ingestion or modify and reupload the document."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Click ",(0,r.jsx)(a.A,{name:"Settings2","aria-hidden":"true"})," ",(0,r.jsx)(n.strong,{children:"Settings"})," to modify the knowledge ingestion settings."]}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(n.p,{children:["For more information, see ",(0,r.jsx)(n.a,{href:"/knowledge",children:"Configure knowledge"})," and ",(0,r.jsx)(n.a,{href:"/ingestion",children:"Ingest knowledge"}),"."]}),"\n"]}),"\n"]}),"\n",(0,r.jsx)(n.h2,{id:"change-components",children:"Change the language model and chat settings"}),"\n",(0,r.jsxs)(n.ol,{children:["\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["To change the knowledge ingestion settings, agent behavior, or language model, click ",(0,r.jsx)(a.A,{name:"Settings2","aria-hidden":"true"})," ",(0,r.jsx)(n.strong,{children:"Settings"}),"."]}),"\n",(0,r.jsxs)(n.p,{children:["The ",(0,r.jsx)(n.strong,{children:"Settings"})," page provides quick access to commonly used parameters like the ",(0,r.jsx)(n.strong,{children:"Language model"})," and ",(0,r.jsx)(n.strong,{children:"Agent Instructions"}),"."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["For greater insight into the underlying ",(0,r.jsx)(n.a,{href:"/agents",children:"Langflow flow"})," that drives the OpenRAG chat, click ",(0,r.jsx)(n.strong,{children:"Edit in Langflow"})," and then click ",(0,r.jsx)(n.strong,{children:"Proceed"})," to launch the Langflow visual editor in a new browser window."]}),"\n",(0,r.jsxs)(n.p,{children:["If Langflow requests login information, enter the ",(0,r.jsx)(n.code,{children:"LANGFLOW_SUPERUSER"})," and ",(0,r.jsx)(n.code,{children:"LANGFLOW_SUPERUSER_PASSWORD"})," from the ",(0,r.jsx)(n.code,{children:".env"})," file at ",(0,r.jsx)(n.code,{children:"~/.openrag/tui"}),"."]}),"\n",(0,r.jsxs)(n.p,{children:["The ",(0,r.jsx)(n.strong,{children:"OpenRAG OpenSearch Agent"})," flow opens in a new browser window."]}),"\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.img,{alt:"OpenRAG OpenSearch Agent flow",src:t(3982).A+"",width:"4084",height:"2176"})}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["For this quickstart, try changing the model.\nClick the ",(0,r.jsx)(n.strong,{children:"Language Model"})," component, and then change the ",(0,r.jsx)(n.strong,{children:"Model Name"})," to a different OpenAI model."]}),"\n",(0,r.jsxs)(n.p,{children:["After you edit a built-in flow, you can click ",(0,r.jsx)(n.strong,{children:"Restore flow"})," on the ",(0,r.jsx)(n.strong,{children:"Settings"})," page to revert the flow to its original state when you first installed OpenRAG."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Press ",(0,r.jsx)("kbd",{children:"Command"}),"+",(0,r.jsx)("kbd",{children:"S"})," (",(0,r.jsx)("kbd",{children:"Ctrl"}),"+",(0,r.jsx)("kbd",{children:"S"}),") to save your changes."]}),"\n",(0,r.jsx)(n.p,{children:"You can close the Langflow browser window, or leave it open if you want to continue experimenting with the flow editor."}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Switch to your OpenRAG browser window, and then click ",(0,r.jsx)(a.A,{name:"Plus","aria-hidden":"true"})," in the ",(0,r.jsx)(n.strong,{children:"Conversations"})," tab to start a new conversation.\nThis ensures that the chat doesn't persist any context from the previous conversation with the original model."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Ask the same question you asked in ",(0,r.jsx)(n.a,{href:"#chat-with-documents",children:"Load and chat with documents"})," to see how the response differs from the original model."]}),"\n"]}),"\n"]}),"\n",(0,r.jsx)(n.h2,{id:"integrate-openrag-into-an-application",children:"Integrate OpenRAG into an application"}),"\n",(0,r.jsxs)(n.p,{children:["Langflow in OpenRAG includes pre-built flows that you can integrate into your applications using the ",(0,r.jsx)(n.a,{href:"https://docs.langflow.org/api-reference-api-examples",children:"Langflow API"}),".\nYou can use these flows as-is or modify them to better suit your needs, as demonstrated in ",(0,r.jsx)(n.a,{href:"#change-components",children:"Change the language model and chat settings"}),"."]}),"\n",(0,r.jsx)(n.p,{children:"You can send and receive requests with the Langflow API using Python, TypeScript, or curl."}),"\n",(0,r.jsx)(o.Ay,{}),"\n",(0,r.jsx)(n.h2,{id:"next-steps",children:"Next steps"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.strong,{children:"Reinstall OpenRAG with your preferred settings"}),": This quickstart used ",(0,r.jsx)(n.code,{children:"uvx"})," and a minimal setup to demonstrate OpenRAG's core functionality.\nIt is recommended that you ",(0,r.jsx)(n.a,{href:"/reinstall",children:"reinstall OpenRAG"})," with your preferred configuration and ",(0,r.jsx)(n.a,{href:"/install-options",children:"installation method"}),"."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.strong,{children:"Learn more about OpenRAG"}),": Explore OpenRAG and the OpenRAG documentation to learn more about its features and functionality."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.strong,{children:"Learn more about Langflow"}),": For a deep dive on the Langflow API and visual editor, see the ",(0,r.jsx)(n.a,{href:"https://docs.langflow.org/",children:"Langflow documentation"}),"."]}),"\n"]}),"\n"]})]})}function x(e={}){const{wrapper:n}={...(0,i.R)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(g,{...e})}):g(e)}},1470:(e,n,t)=>{t.d(n,{A:()=>b});var s=t(6540),r=t(4164),i=t(7559),a=t(3104),o=t(6347),l=t(205),c=t(7485),d=t(1682),h=t(679);function u(e){return s.Children.toArray(e).filter(e=>"\n"!==e).map(e=>{if(!e||(0,s.isValidElement)(e)&&function(e){const{props:n}=e;return!!n&&"object"==typeof n&&"value"in n}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)})?.filter(Boolean)??[]}function p(e){const{values:n,children:t}=e;return(0,s.useMemo)(()=>{const e=n??function(e){return u(e).map(({props:{value:e,label:n,attributes:t,default:s}})=>({value:e,label:n,attributes:t,default:s}))}(t);return function(e){const n=(0,d.XI)(e,(e,n)=>e.value===n.value);if(n.length>0)throw new Error(`Docusaurus error: Duplicate values "${n.map(e=>e.value).join(", ")}" found in . Every value needs to be unique.`)}(e),e},[n,t])}function g({value:e,tabValues:n}){return n.some(n=>n.value===e)}function x({queryString:e=!1,groupId:n}){const t=(0,o.W6)(),r=function({queryString:e=!1,groupId:n}){if("string"==typeof e)return e;if(!1===e)return null;if(!0===e&&!n)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return n??null}({queryString:e,groupId:n});return[(0,c.aZ)(r),(0,s.useCallback)(e=>{if(!r)return;const n=new URLSearchParams(t.location.search);n.set(r,e),t.replace({...t.location,search:n.toString()})},[r,t])]}function j(e){const{defaultValue:n,queryString:t=!1,groupId:r}=e,i=p(e),[a,o]=(0,s.useState)(()=>function({defaultValue:e,tabValues:n}){if(0===n.length)throw new Error("Docusaurus error: the component requires at least one children component");if(e){if(!g({value:e,tabValues:n}))throw new Error(`Docusaurus error: The has a defaultValue "${e}" but none of its children has the corresponding value. Available values are: ${n.map(e=>e.value).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return e}const t=n.find(e=>e.default)??n[0];if(!t)throw new Error("Unexpected error: 0 tabValues");return t.value}({defaultValue:n,tabValues:i})),[c,d]=x({queryString:t,groupId:r}),[u,j]=function({groupId:e}){const n=function(e){return e?`docusaurus.tab.${e}`:null}(e),[t,r]=(0,h.Dv)(n);return[t,(0,s.useCallback)(e=>{n&&r.set(e)},[n,r])]}({groupId:r}),f=(()=>{const e=c??u;return g({value:e,tabValues:i})?e:null})();(0,l.A)(()=>{f&&o(f)},[f]);return{selectedValue:a,selectValue:(0,s.useCallback)(e=>{if(!g({value:e,tabValues:i}))throw new Error(`Can't select invalid tab value=${e}`);o(e),d(e),j(e)},[d,j,i]),tabValues:i}}var f=t(2303);const m={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var y=t(4848);function w({className:e,block:n,selectedValue:t,selectValue:s,tabValues:i}){const o=[],{blockElementScrollPositionUntilNextRender:l}=(0,a.a_)(),c=e=>{const n=e.currentTarget,r=o.indexOf(n),a=i[r].value;a!==t&&(l(n),s(a))},d=e=>{let n=null;switch(e.key){case"Enter":c(e);break;case"ArrowRight":{const t=o.indexOf(e.currentTarget)+1;n=o[t]??o[0];break}case"ArrowLeft":{const t=o.indexOf(e.currentTarget)-1;n=o[t]??o[o.length-1];break}}n?.focus()};return(0,y.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,r.A)("tabs",{"tabs--block":n},e),children:i.map(({value:e,label:n,attributes:s})=>(0,y.jsx)("li",{role:"tab",tabIndex:t===e?0:-1,"aria-selected":t===e,ref:e=>{o.push(e)},onKeyDown:d,onClick:c,...s,className:(0,r.A)("tabs__item",m.tabItem,s?.className,{"tabs__item--active":t===e}),children:n??e},e))})}function A({lazy:e,children:n,selectedValue:t}){const i=(Array.isArray(n)?n:[n]).filter(Boolean);if(e){const e=i.find(e=>e.props.value===t);return e?(0,s.cloneElement)(e,{className:(0,r.A)("margin-top--md",e.props.className)}):null}return(0,y.jsx)("div",{className:"margin-top--md",children:i.map((e,n)=>(0,s.cloneElement)(e,{key:n,hidden:e.props.value!==t}))})}function v(e){const n=j(e);return(0,y.jsxs)("div",{className:(0,r.A)(i.G.tabs.container,"tabs-container",m.tabList),children:[(0,y.jsx)(w,{...n,...e}),(0,y.jsx)(A,{...n,...e})]})}function b(e){const n=(0,f.A)();return(0,y.jsx)(v,{...e,children:u(e.children)},String(n))}},3982:(e,n,t)=>{t.d(n,{A:()=>s});const s=t.p+"assets/images/opensearch-agent-flow-f3b279e02425cd043002eb7749067108.png"},4042:(e,n,t)=>{t.d(n,{Ay:()=>o,RM:()=>i});var s=t(4848),r=t(8453);const i=[];function a(e){const n={a:"a",li:"li",ul:"ul",...(0,r.R)(),...e.components};return(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:["Install ",(0,s.jsx)(n.a,{href:"https://www.python.org/downloads/release/python-3100/",children:"Python"})," version 3.13 or later."]}),"\n"]})}function o(e={}){const{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(a,{...e})}):a(e)}},5689:(e,n,t)=>{t.d(n,{A:()=>s});const s=t.p+"assets/images/OpenRAG_TUI_2025-09-10T13_04_11_757637-9441c53ba39162a88ac6c11cbeaed0e0.svg"},6149:(e,n,t)=>{t.d(n,{Ay:()=>o,RM:()=>i});var s=t(4848),r=t(8453);const i=[];function a(e){const n={a:"a",li:"li",ul:"ul",...(0,r.R)(),...e.components};return(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:["For Microsoft Windows, you must use the Windows Subsystem for Linux (WSL).\nSee ",(0,s.jsx)(n.a,{href:"/install-windows",children:"Install OpenRAG on Windows"})," before proceeding."]}),"\n"]})}function o(e={}){const{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(a,{...e})}):a(e)}},7224:(e,n,t)=>{t.d(n,{Ay:()=>d,RM:()=>l});var s=t(4848),r=t(8453),i=t(9179),a=t(1470),o=t(9365);const l=[];function c(e){const n={a:"a",code:"code",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,r.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(n.ol,{children:["\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["Open the ",(0,s.jsx)(n.strong,{children:"OpenRAG OpenSearch Agent"})," flow in the Langflow visual editor: From the ",(0,s.jsx)(n.strong,{children:"Chat"})," window, click ",(0,s.jsx)(i.A,{name:"Settings2","aria-hidden":"true"})," ",(0,s.jsx)(n.strong,{children:"Settings"}),", click ",(0,s.jsx)(n.strong,{children:"Edit in Langflow"}),", and then click ",(0,s.jsx)(n.strong,{children:"Proceed"}),"."]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["Optional: If you don't want to use the Langflow API key that is generated automatically when you install OpenRAG, you can create a ",(0,s.jsx)(n.a,{href:"https://docs.langflow.org/api-keys-and-authentication",children:"Langflow API key"}),".\nThis key doesn't grant access to OpenRAG; it is only for authenticating with the Langflow API."]}),"\n",(0,s.jsxs)(n.ol,{children:["\n",(0,s.jsxs)(n.li,{children:["In the Langflow visual editor, click your user icon in the header, and then select ",(0,s.jsx)(n.strong,{children:"Settings"}),"."]}),"\n",(0,s.jsxs)(n.li,{children:["Click ",(0,s.jsx)(n.strong,{children:"Langflow API Keys"}),", and then click ",(0,s.jsx)(i.A,{name:"Plus","aria-hidden":"true"})," ",(0,s.jsx)(n.strong,{children:"Add New"}),"."]}),"\n",(0,s.jsxs)(n.li,{children:["Name your key, and then click ",(0,s.jsx)(n.strong,{children:"Create API Key"}),"."]}),"\n",(0,s.jsx)(n.li,{children:"Copy the API key and store it securely."}),"\n",(0,s.jsxs)(n.li,{children:["Exit the Langflow ",(0,s.jsx)(n.strong,{children:"Settings"})," page to return to the visual editor."]}),"\n"]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["Click ",(0,s.jsx)(n.strong,{children:"Share"}),", and then select ",(0,s.jsx)(n.strong,{children:"API access"})," to get pregenerated code snippets that call the Langflow API and run the flow."]}),"\n",(0,s.jsxs)(n.p,{children:["These code snippets construct API requests with your Langflow server URL (",(0,s.jsx)(n.code,{children:"LANGFLOW_SERVER_ADDRESS"}),"), the flow to run (",(0,s.jsx)(n.code,{children:"FLOW_ID"}),"), required headers (",(0,s.jsx)(n.code,{children:"LANGFLOW_API_KEY"}),", ",(0,s.jsx)(n.code,{children:"Content-Type"}),"), and a payload containing the required inputs to run the flow, including a default chat input message."]}),"\n",(0,s.jsx)(n.p,{children:"In production, you would modify the inputs to suit your application logic. For example, you could replace the default chat input message with dynamic user input."}),"\n",(0,s.jsxs)(a.A,{children:[(0,s.jsx)(o.A,{value:"python",label:"Python",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python",children:'import requests\nimport os\nimport uuid\n\napi_key = \'LANGFLOW_API_KEY\'\nurl = "http://LANGFLOW_SERVER_ADDRESS/api/v1/run/FLOW_ID" # The complete API endpoint URL for this flow\n\n# Request payload configuration\npayload = {\n "output_type": "chat",\n "input_type": "chat",\n "input_value": "hello world!"\n}\npayload["session_id"] = str(uuid.uuid4())\n\nheaders = {"x-api-key": api_key}\n\ntry:\n # Send API request\n response = requests.request("POST", url, json=payload, headers=headers)\n response.raise_for_status() # Raise exception for bad status codes\n\n # Print response\n print(response.text)\n\nexcept requests.exceptions.RequestException as e:\n print(f"Error making API request: {e}")\nexcept ValueError as e:\n print(f"Error parsing response: {e}")\n'})})}),(0,s.jsx)(o.A,{value:"typescript",label:"TypeScript",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typescript",children:'const crypto = require(\'crypto\');\nconst apiKey = \'LANGFLOW_API_KEY\';\nconst payload = {\n "output_type": "chat",\n "input_type": "chat",\n "input_value": "hello world!"\n};\npayload.session_id = crypto.randomUUID();\n\nconst options = {\n method: \'POST\',\n headers: {\n \'Content-Type\': \'application/json\',\n "x-api-key": apiKey\n },\n body: JSON.stringify(payload)\n};\n\nfetch(\'http://LANGFLOW_SERVER_ADDRESS/api/v1/run/FLOW_ID\', options)\n .then(response => response.json())\n .then(response => console.warn(response))\n .catch(err => console.error(err));\n'})})}),(0,s.jsx)(o.A,{value:"curl",label:"curl",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-bash",children:'curl --request POST \\\n --url \'http://LANGFLOW_SERVER_ADDRESS/api/v1/run/FLOW_ID?stream=false\' \\\n --header \'Content-Type: application/json\' \\\n --header "x-api-key: LANGFLOW_API_KEY" \\\n --data \'{\n "output_type": "chat",\n "input_type": "chat",\n "input_value": "hello world!"\n }\'\n'})})})]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsx)(n.p,{children:"Copy your preferred snippet, and then run it:"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Python"}),": Paste the snippet into a ",(0,s.jsx)(n.code,{children:".py"})," file, save it, and then run it with ",(0,s.jsx)(n.code,{children:"python filename.py"}),"."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"TypeScript"}),": Paste the snippet into a ",(0,s.jsx)(n.code,{children:".ts"})," file, save it, and then run it with ",(0,s.jsx)(n.code,{children:"ts-node filename.ts"}),"."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"curl"}),": Paste and run snippet directly in your terminal."]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,s.jsx)(n.p,{children:"If the request is successful, the response includes many details about the flow run, including the session ID, inputs, outputs, components, durations, and more."}),"\n",(0,s.jsxs)(n.p,{children:["In production, you won't pass the raw response to the user in its entirety.\nInstead, you extract and reformat relevant fields for different use cases, as demonstrated in the ",(0,s.jsx)(n.a,{href:"https://docs.langflow.org/get-started-quickstart#extract-data-from-the-response",children:"Langflow quickstart"}),".\nFor example, you could pass the chat output text to a front-end user-facing application, and store specific fields in logs and backend data stores for monitoring, chat history, or analytics.\nYou could also pass the output from one flow as input to another flow."]})]})}function d(e={}){const{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(c,{...e})}):c(e)}},9179:(e,n,t)=>{t.d(n,{A:()=>i});t(6540);var s=t(7856),r=t(4848);function i({name:e,...n}){const t=s[e];return t?(0,r.jsx)(t,{...n}):null}},9365:(e,n,t)=>{t.d(n,{A:()=>a});t(6540);var s=t(4164);const r={tabItem:"tabItem_Ymn6"};var i=t(4848);function a({children:e,hidden:n,className:t}){return(0,i.jsx)("div",{role:"tabpanel",className:(0,s.A)(r.tabItem,t),hidden:n,children:e})}}}]); \ No newline at end of file diff --git a/assets/js/ca2c3c0c.039bf965.js b/assets/js/ca2c3c0c.039bf965.js new file mode 100644 index 00000000..093103f1 --- /dev/null +++ b/assets/js/ca2c3c0c.039bf965.js @@ -0,0 +1 @@ +"use strict";(globalThis.webpackChunkopenrag_docs=globalThis.webpackChunkopenrag_docs||[]).push([[6919],{1381:(e,n,s)=>{s.d(n,{Ay:()=>l,RM:()=>r});var t=s(4848),o=s(8453);const r=[];function i(e){const n={code:"code",pre:"pre",...(0,o.R)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",metastring:'title="Docker"',children:"docker compose up -d\n"})}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",metastring:'title="Podman"',children:"podman compose up -d\n"})})]})}function l(e={}){const{wrapper:n}={...(0,o.R)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(i,{...e})}):i(e)}},1470:(e,n,s)=>{s.d(n,{A:()=>A});var t=s(6540),o=s(4164),r=s(7559),i=s(3104),l=s(6347),a=s(205),c=s(7485),d=s(1682),h=s(679);function u(e){return t.Children.toArray(e).filter(e=>"\n"!==e).map(e=>{if(!e||(0,t.isValidElement)(e)&&function(e){const{props:n}=e;return!!n&&"object"==typeof n&&"value"in n}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)})?.filter(Boolean)??[]}function p(e){const{values:n,children:s}=e;return(0,t.useMemo)(()=>{const e=n??function(e){return u(e).map(({props:{value:e,label:n,attributes:s,default:t}})=>({value:e,label:n,attributes:s,default:t}))}(s);return function(e){const n=(0,d.XI)(e,(e,n)=>e.value===n.value);if(n.length>0)throw new Error(`Docusaurus error: Duplicate values "${n.map(e=>e.value).join(", ")}" found in . Every value needs to be unique.`)}(e),e},[n,s])}function g({value:e,tabValues:n}){return n.some(n=>n.value===e)}function x({queryString:e=!1,groupId:n}){const s=(0,l.W6)(),o=function({queryString:e=!1,groupId:n}){if("string"==typeof e)return e;if(!1===e)return null;if(!0===e&&!n)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return n??null}({queryString:e,groupId:n});return[(0,c.aZ)(o),(0,t.useCallback)(e=>{if(!o)return;const n=new URLSearchParams(s.location.search);n.set(o,e),s.replace({...s.location,search:n.toString()})},[o,s])]}function f(e){const{defaultValue:n,queryString:s=!1,groupId:o}=e,r=p(e),[i,l]=(0,t.useState)(()=>function({defaultValue:e,tabValues:n}){if(0===n.length)throw new Error("Docusaurus error: the component requires at least one children component");if(e){if(!g({value:e,tabValues:n}))throw new Error(`Docusaurus error: The has a defaultValue "${e}" but none of its children has the corresponding value. Available values are: ${n.map(e=>e.value).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return e}const s=n.find(e=>e.default)??n[0];if(!s)throw new Error("Unexpected error: 0 tabValues");return s.value}({defaultValue:n,tabValues:r})),[c,d]=x({queryString:s,groupId:o}),[u,f]=function({groupId:e}){const n=function(e){return e?`docusaurus.tab.${e}`:null}(e),[s,o]=(0,h.Dv)(n);return[s,(0,t.useCallback)(e=>{n&&o.set(e)},[n,o])]}({groupId:o}),m=(()=>{const e=c??u;return g({value:e,tabValues:r})?e:null})();(0,a.A)(()=>{m&&l(m)},[m]);return{selectedValue:i,selectValue:(0,t.useCallback)(e=>{if(!g({value:e,tabValues:r}))throw new Error(`Can't select invalid tab value=${e}`);l(e),d(e),f(e)},[d,f,r]),tabValues:r}}var m=s(2303);const j={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var w=s(4848);function b({className:e,block:n,selectedValue:s,selectValue:t,tabValues:r}){const l=[],{blockElementScrollPositionUntilNextRender:a}=(0,i.a_)(),c=e=>{const n=e.currentTarget,o=l.indexOf(n),i=r[o].value;i!==s&&(a(n),t(i))},d=e=>{let n=null;switch(e.key){case"Enter":c(e);break;case"ArrowRight":{const s=l.indexOf(e.currentTarget)+1;n=l[s]??l[0];break}case"ArrowLeft":{const s=l.indexOf(e.currentTarget)-1;n=l[s]??l[l.length-1];break}}n?.focus()};return(0,w.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,o.A)("tabs",{"tabs--block":n},e),children:r.map(({value:e,label:n,attributes:t})=>(0,w.jsx)("li",{role:"tab",tabIndex:s===e?0:-1,"aria-selected":s===e,ref:e=>{l.push(e)},onKeyDown:d,onClick:c,...t,className:(0,o.A)("tabs__item",j.tabItem,t?.className,{"tabs__item--active":s===e}),children:n??e},e))})}function y({lazy:e,children:n,selectedValue:s}){const r=(Array.isArray(n)?n:[n]).filter(Boolean);if(e){const e=r.find(e=>e.props.value===s);return e?(0,t.cloneElement)(e,{className:(0,o.A)("margin-top--md",e.props.className)}):null}return(0,w.jsx)("div",{className:"margin-top--md",children:r.map((e,n)=>(0,t.cloneElement)(e,{key:n,hidden:e.props.value!==s}))})}function v(e){const n=f(e);return(0,w.jsxs)("div",{className:(0,o.A)(r.G.tabs.container,"tabs-container",j.tabList),children:[(0,w.jsx)(b,{...n,...e}),(0,w.jsx)(y,{...n,...e})]})}function A(e){const n=(0,m.A)();return(0,w.jsx)(v,{...e,children:u(e.children)},String(n))}},4577:(e,n,s)=>{s.d(n,{Ay:()=>l,RM:()=>r});var t=s(4848),o=s(8453);const r=[];function i(e){const n={code:"code",pre:"pre",...(0,o.R)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",metastring:'title="Docker"',children:"docker stop $(docker ps -q)\n"})}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",metastring:'title="Podman"',children:"podman stop --all\n"})})]})}function l(e={}){const{wrapper:n}={...(0,o.R)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(i,{...e})}):i(e)}},5421:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>m,contentTitle:()=>f,default:()=>b,frontMatter:()=>x,metadata:()=>t,toc:()=>j});const t=JSON.parse('{"id":"core-components/ingestion","title":"Ingest knowledge","description":"Upload documents to your OpenRAG OpenSearch instance to populate your knowledge base with unique content, such as your own company documents, research papers, or websites.","source":"@site/docs/core-components/ingestion.mdx","sourceDirName":"core-components","slug":"/ingestion","permalink":"/ingestion","draft":false,"unlisted":false,"editUrl":"https://github.com/openrag/openrag/tree/main/docs/docs/core-components/ingestion.mdx","tags":[],"version":"current","frontMatter":{"title":"Ingest knowledge","slug":"/ingestion"},"sidebar":"tutorialSidebar","previous":{"title":"Configure knowledge","permalink":"/knowledge"},"next":{"title":"Filter knowledge","permalink":"/knowledge-filters"}}');var o=s(4848),r=s(8453),i=s(9179),l=s(1470),a=s(9365),c=s(8401);const d=[];function h(e){const n={a:"a",code:"code",li:"li",p:"p",strong:"strong",ul:"ul",...(0,r.R)(),...e.components},{Details:s}=n;return s||function(e,n){throw new Error("Expected "+(n?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}("Details",!0),(0,o.jsxs)(s,{children:[(0,o.jsx)("summary",{children:"About the OpenSearch Ingestion flow"}),(0,o.jsxs)(n.p,{children:["When you upload documents locally or with OAuth connectors, the ",(0,o.jsx)(n.strong,{children:"OpenSearch Ingestion"})," flow runs in the background.\nBy default, this flow uses Docling Serve to import and process documents."]}),(0,o.jsxs)(n.p,{children:["Like all ",(0,o.jsx)(n.a,{href:"/agents",children:"OpenRAG flows"}),", you can ",(0,o.jsx)(n.a,{href:"/agents#inspect-and-modify-flows",children:"inspect the flow in Langflow"}),", and you can customize it if you want to change the knowledge ingestion settings."]}),(0,o.jsxs)(n.p,{children:["The ",(0,o.jsx)(n.strong,{children:"OpenSearch Ingestion"})," flow is comprised of several components that work together to process and store documents in your knowledge base:"]}),(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:[(0,o.jsxs)(n.a,{href:"https://docs.langflow.org/bundles-docling#docling-serve",children:[(0,o.jsx)(n.strong,{children:"Docling Serve"})," component"]}),": Ingests files and processes them by connecting to OpenRAG's local Docling Serve service. The output is ",(0,o.jsx)(n.code,{children:"DoclingDocument"})," data that contains the extracted text and metadata from the documents."]}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:[(0,o.jsxs)(n.a,{href:"https://docs.langflow.org/bundles-docling#export-doclingdocument",children:[(0,o.jsx)(n.strong,{children:"Export DoclingDocument"})," component"]}),": Exports processed ",(0,o.jsx)(n.code,{children:"DoclingDocument"})," data to Markdown format with image placeholders. This conversion standardizes the document data in preparation for further processing."]}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:[(0,o.jsxs)(n.a,{href:"https://docs.langflow.org/dataframe-operations",children:[(0,o.jsx)(n.strong,{children:"DataFrame Operations"})," component"]}),": Three of these components run sequentially to add metadata to the document data: ",(0,o.jsx)(n.code,{children:"filename"}),", ",(0,o.jsx)(n.code,{children:"file_size"}),", and ",(0,o.jsx)(n.code,{children:"mimetype"}),"."]}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:[(0,o.jsxs)(n.a,{href:"https://docs.langflow.org/split-text",children:[(0,o.jsx)(n.strong,{children:"Split Text"})," component"]}),": Splits the processed text into chunks, based on the configured ",(0,o.jsx)(n.a,{href:"/knowledge#knowledge-ingestion-settings",children:"chunk size and overlap settings"}),"."]}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:[(0,o.jsx)(n.strong,{children:"Secret Input"})," component: If needed, four of these components securely fetch the ",(0,o.jsx)(n.a,{href:"/knowledge#auth",children:"OAuth authentication"})," configuration variables: ",(0,o.jsx)(n.code,{children:"CONNECTOR_TYPE"}),", ",(0,o.jsx)(n.code,{children:"OWNER"}),", ",(0,o.jsx)(n.code,{children:"OWNER_EMAIL"}),", and ",(0,o.jsx)(n.code,{children:"OWNER_NAME"}),"."]}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:[(0,o.jsx)(n.strong,{children:"Create Data"})," component: Combines the authentication credentials from the ",(0,o.jsx)(n.strong,{children:"Secret Input"})," components into a structured data object that is associated with the document embeddings."]}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:[(0,o.jsxs)(n.a,{href:"https://docs.langflow.org/components-embedding-models",children:[(0,o.jsx)(n.strong,{children:"Embedding Model"})," component"]}),": Generates vector embeddings using your selected ",(0,o.jsx)(n.a,{href:"/knowledge#set-the-embedding-model-and-dimensions",children:"embedding model"}),"."]}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:[(0,o.jsxs)(n.a,{href:"https://docs.langflow.org/bundles-elastic#opensearch",children:[(0,o.jsx)(n.strong,{children:"OpenSearch"})," component"]}),": Stores the processed documents and their embeddings in a ",(0,o.jsx)(n.code,{children:"documents"})," index of your OpenRAG ",(0,o.jsx)(n.a,{href:"/knowledge",children:"OpenSearch knowledge base"}),"."]}),"\n",(0,o.jsxs)(n.p,{children:["The default address for the OpenSearch instance is ",(0,o.jsx)(n.code,{children:"https://opensearch:9200"}),". To change this address, edit the ",(0,o.jsx)(n.code,{children:"OPENSEARCH_PORT"})," ",(0,o.jsx)(n.a,{href:"/reference/configuration#opensearch-settings",children:"environment variable"}),"."]}),"\n",(0,o.jsxs)(n.p,{children:["The default authentication method is JSON Web Token (JWT) authentication. If you ",(0,o.jsx)(n.a,{href:"/agents#inspect-and-modify-flows",children:"edit the flow"}),", you can select ",(0,o.jsx)(n.code,{children:"basic"})," auth mode, which uses the ",(0,o.jsx)(n.code,{children:"OPENSEARCH_USERNAME"})," and ",(0,o.jsx)(n.code,{children:"OPENSEARCH_PASSWORD"})," ",(0,o.jsx)(n.a,{href:"/reference/configuration#opensearch-settings",children:"environment variables"})," for authentication instead of JWT."]}),"\n"]}),"\n"]})]})}function u(e={}){const{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,o.jsx)(n,{...e,children:(0,o.jsx)(h,{...e})}):h(e)}var p=s(1381),g=s(4577);const x={title:"Ingest knowledge",slug:"/ingestion"},f=void 0,m={},j=[{value:"Ingest local files and folders",id:"ingest-local-files-and-folders",level:2},...d,{value:"Ingest local files temporarily",id:"ingest-local-files-temporarily",level:2},...c.RM,{value:"Ingest files with OAuth connectors",id:"oauth-ingestion",level:2},{value:"Enable OAuth connectors",id:"enable-oauth-connectors",level:3},...g.RM,...p.RM,{value:"Authenticate and ingest files from cloud storage",id:"authenticate-and-ingest-files-from-cloud-storage",level:3},...d,{value:"Ingest knowledge from URLs",id:"url-flow",level:2},{value:"Monitor ingestion",id:"monitor-ingestion",level:2},{value:"Ingestion performance expectations",id:"ingestion-performance-expectations",level:3},{value:"Troubleshoot ingestion",id:"troubleshoot-ingestion",level:2},{value:"See also",id:"see-also",level:2}];function w(e){const n={a:"a",code:"code",h2:"h2",h3:"h3",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,r.R)(),...e.components},{Details:s}=n;return s||function(e,n){throw new Error("Expected "+(n?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}("Details",!0),(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(n.p,{children:["Upload documents to your ",(0,o.jsx)(n.a,{href:"/knowledge",children:"OpenRAG OpenSearch instance"})," to populate your knowledge base with unique content, such as your own company documents, research papers, or websites.\nDocuments are processed through OpenRAG's knowledge ingestion flows with Docling."]}),"\n",(0,o.jsx)(n.p,{children:"OpenRAG can ingest knowledge from direct file uploads, URLs, and OAuth authenticated connectors."}),"\n",(0,o.jsxs)(n.p,{children:["Knowledge ingestion is powered by OpenRAG's built-in knowledge ingestion flows that use Docling to process documents before storing the documents in your OpenSearch database.\nDuring ingestion, documents are broken into smaller chunks of content that are then embedded using your selected ",(0,o.jsx)(n.a,{href:"/knowledge#set-the-embedding-model-and-dimensions",children:"embedding model"}),".\nThen, the chunks, embeddings, and associated metadata (which connects chunks of the same document) are stored in your OpenSearch database."]}),"\n",(0,o.jsxs)(n.p,{children:["To modify chunking behavior and other ingestion settings, see ",(0,o.jsx)(n.a,{href:"/knowledge#knowledge-ingestion-settings",children:"Knowledge ingestion settings"})," and ",(0,o.jsx)(n.a,{href:"/agents#inspect-and-modify-flows",children:"Inspect and modify flows"}),"."]}),"\n",(0,o.jsx)(n.h2,{id:"ingest-local-files-and-folders",children:"Ingest local files and folders"}),"\n",(0,o.jsx)(n.p,{children:"You can upload files and folders from your local machine to your knowledge base:"}),"\n",(0,o.jsxs)(n.ol,{children:["\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:["Click ",(0,o.jsx)(i.A,{name:"Library","aria-hidden":"true"})," ",(0,o.jsx)(n.strong,{children:"Knowledge"})," to view your OpenSearch knowledge base."]}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:["Click ",(0,o.jsx)(n.strong,{children:"Add Knowledge"})," to add your own documents to your OpenRAG knowledge base."]}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:["To upload one file, click ",(0,o.jsx)(i.A,{name:"File","aria-hidden":"true"})," ",(0,o.jsx)(n.strong,{children:"File"}),". To upload all documents in a folder, click ",(0,o.jsx)(i.A,{name:"Folder","aria-hidden":"true"})," ",(0,o.jsx)(n.strong,{children:"Folder"}),"."]}),"\n",(0,o.jsxs)(n.p,{children:["The default path is ",(0,o.jsx)(n.code,{children:"~/.openrag/documents"}),".\nTo change this path, see ",(0,o.jsx)(n.a,{href:"/knowledge#set-the-local-documents-path",children:"Set the local documents path"}),"."]}),"\n"]}),"\n"]}),"\n",(0,o.jsxs)(n.p,{children:["The selected files are processed in the background through the ",(0,o.jsx)(n.strong,{children:"OpenSearch Ingestion"})," flow."]}),"\n",(0,o.jsx)(u,{}),"\n",(0,o.jsxs)(n.p,{children:["You can ",(0,o.jsx)(n.a,{href:"#monitor-ingestion",children:"monitor ingestion"})," to see the progress of the uploads and check for failed uploads."]}),"\n",(0,o.jsx)(n.h2,{id:"ingest-local-files-temporarily",children:"Ingest local files temporarily"}),"\n",(0,o.jsx)(c.Ay,{}),"\n",(0,o.jsx)(n.h2,{id:"oauth-ingestion",children:"Ingest files with OAuth connectors"}),"\n",(0,o.jsx)(n.p,{children:"OpenRAG can use OAuth authenticated connectors to ingest documents from the following external services:"}),"\n",(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsx)(n.li,{children:"AWS S3"}),"\n",(0,o.jsx)(n.li,{children:"Google Drive"}),"\n",(0,o.jsx)(n.li,{children:"Microsoft OneDrive"}),"\n",(0,o.jsx)(n.li,{children:"Microsoft Sharepoint"}),"\n"]}),"\n",(0,o.jsx)(n.p,{children:"These connectors enable seamless ingestion of files from cloud storage to your OpenRAG knowledge base."}),"\n",(0,o.jsx)(n.p,{children:"Individual users can connect their personal cloud storage accounts to OpenRAG. Each user must separately authorize OpenRAG to access their own cloud storage. When a user connects a cloud storage service, they are redirected to authenticate with that service provider and grant OpenRAG permission to sync documents from their personal cloud storage."}),"\n",(0,o.jsx)(n.h3,{id:"enable-oauth-connectors",children:"Enable OAuth connectors"}),"\n",(0,o.jsx)(n.p,{children:"Before users can connect their own cloud storage accounts, you must configure the provider's OAuth credentials in OpenRAG. Typically, this requires that you register OpenRAG as an OAuth application in your cloud provider, and then obtain the app's OAuth credentials, such as a client ID and secret key.\nTo enable multiple connectors, you must register an app and generate credentials for each provider."}),"\n",(0,o.jsxs)(l.A,{children:[(0,o.jsxs)(a.A,{value:"TUI",label:"TUI-managed services",default:!0,children:[(0,o.jsxs)(n.p,{children:["If you use the ",(0,o.jsx)(n.a,{href:"/tui",children:"Terminal User Interface (TUI)"})," to manage your OpenRAG services, enter OAuth credentials in the ",(0,o.jsx)(n.strong,{children:"Advanced Setup"})," menu.\nYou can do this during ",(0,o.jsx)(n.a,{href:"/install#setup",children:"installation"}),", or you can add the credentials afterwards:"]}),(0,o.jsxs)(n.ol,{children:["\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:["If OpenRAG is running, open the TUI's ",(0,o.jsx)(n.strong,{children:"Status"})," menu (",(0,o.jsx)("kbd",{children:"3"}),"), and then click ",(0,o.jsx)(n.strong,{children:"Stop Services"}),"."]}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:["Open the ",(0,o.jsx)(n.strong,{children:"Advanced Setup"})," menu (",(0,o.jsx)("kbd",{children:"2"}),"), and then add the OAuth credentials for the cloud storage providers that you want to use:"]}),"\n",(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsxs)(n.li,{children:[(0,o.jsx)(n.strong,{children:"Amazon"}),": Provide your AWS Access Key ID and AWS Secret Access Key with access to your S3 instance. For more information, see the AWS documentation on ",(0,o.jsx)(n.a,{href:"https://docs.aws.amazon.com/singlesignon/latest/userguide/manage-your-applications.html",children:"Configuring access to AWS applications"}),"."]}),"\n",(0,o.jsxs)(n.li,{children:[(0,o.jsx)(n.strong,{children:"Google"}),": Provide your Google OAuth Client ID and Google OAuth Client Secret. You can generate these in the ",(0,o.jsx)(n.a,{href:"https://console.cloud.google.com/apis/credentials",children:"Google Cloud Console"}),". For more information, see the ",(0,o.jsx)(n.a,{href:"https://developers.google.com/identity/protocols/oauth2",children:"Google OAuth client documentation"}),"."]}),"\n",(0,o.jsxs)(n.li,{children:[(0,o.jsx)(n.strong,{children:"Microsoft"}),": For the Microsoft OAuth Client ID and Microsoft OAuth Client Secret, provide ",(0,o.jsx)(n.a,{href:"https://learn.microsoft.com/en-us/onedrive/developer/rest-api/getting-started/app-registration?view=odsp-graph-online",children:"Azure application registration credentials for SharePoint and OneDrive"}),". For more information, see the ",(0,o.jsx)(n.a,{href:"https://learn.microsoft.com/en-us/onedrive/developer/rest-api/getting-started/graph-oauth",children:"Microsoft Graph OAuth client documentation"}),"."]}),"\n"]}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsx)(n.p,{children:"The TUI presents redirect URIs for your OAuth app that you must register with your OAuth provider.\nThese are the URLs your OAuth provider will redirect back to after users authenticate and grant access to their cloud storage."}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:["Click ",(0,o.jsx)(n.strong,{children:"Save Configuration"})," to add the OAuth credentials to your ",(0,o.jsxs)(n.a,{href:"/reference/configuration",children:["OpenRAG ",(0,o.jsx)(n.code,{children:".env"})," file"]}),"."]}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:["Click ",(0,o.jsx)(n.strong,{children:"Start All Services"})," to restart the OpenRAG containers with OAuth enabled."]}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsx)(n.p,{children:"Launch the OpenRAG app.\nYou should be prompted to sign in to your OAuth provider before being redirected to your OpenRAG instance."}),"\n"]}),"\n"]})]}),(0,o.jsxs)(a.A,{value:"env",label:"Self-managed services",children:[(0,o.jsxs)(n.p,{children:["If you ",(0,o.jsx)(n.a,{href:"/docker",children:"installed OpenRAG with self-managed services"}),", set OAuth credentials in your ",(0,o.jsxs)(n.a,{href:"/reference/configuration",children:["OpenRAG ",(0,o.jsx)(n.code,{children:".env"})," file"]}),"."]}),(0,o.jsxs)(n.p,{children:["You can do this during ",(0,o.jsx)(n.a,{href:"/docker#setup",children:"initial set up"}),", or you can add the credentials afterwards:"]}),(0,o.jsxs)(n.ol,{children:["\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsx)(n.p,{children:"Stop all OpenRAG containers:"}),"\n",(0,o.jsx)(g.Ay,{}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:["Edit your OpenRAG ",(0,o.jsx)(n.code,{children:".env"})," file to add the OAuth credentials for the cloud storage providers that you want to use:"]}),"\n",(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:[(0,o.jsx)(n.strong,{children:"Amazon"}),": Provide your AWS Access Key ID and AWS Secret Access Key with access to your S3 instance. For more information, see the AWS documentation on ",(0,o.jsx)(n.a,{href:"https://docs.aws.amazon.com/singlesignon/latest/userguide/manage-your-applications.html",children:"Configuring access to AWS applications"}),"."]}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-env",children:"AWS_ACCESS_KEY_ID=\nAWS_SECRET_ACCESS_KEY=\n"})}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:[(0,o.jsx)(n.strong,{children:"Google"}),": Provide your Google OAuth Client ID and Google OAuth Client Secret. You can generate these in the ",(0,o.jsx)(n.a,{href:"https://console.cloud.google.com/apis/credentials",children:"Google Cloud Console"}),". For more information, see the ",(0,o.jsx)(n.a,{href:"https://developers.google.com/identity/protocols/oauth2",children:"Google OAuth client documentation"}),"."]}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-env",children:"GOOGLE_OAUTH_CLIENT_ID=\nGOOGLE_OAUTH_CLIENT_SECRET=\n"})}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:[(0,o.jsx)(n.strong,{children:"Microsoft"}),": For the Microsoft OAuth Client ID and Microsoft OAuth Client Secret, provide ",(0,o.jsx)(n.a,{href:"https://learn.microsoft.com/en-us/onedrive/developer/rest-api/getting-started/app-registration?view=odsp-graph-online",children:"Azure application registration credentials for SharePoint and OneDrive"}),". For more information, see the ",(0,o.jsx)(n.a,{href:"https://learn.microsoft.com/en-us/onedrive/developer/rest-api/getting-started/graph-oauth",children:"Microsoft Graph OAuth client documentation"}),"."]}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-env",children:"MICROSOFT_GRAPH_OAUTH_CLIENT_ID=\nMICROSOFT_GRAPH_OAUTH_CLIENT_SECRET=\n"})}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:["Save the ",(0,o.jsx)(n.code,{children:".env"})," file."]}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsx)(n.p,{children:"Restart your OpenRAG containers:"}),"\n",(0,o.jsx)(p.Ay,{}),"\n"]}),"\n"]})]})]}),"\n",(0,o.jsx)(n.h3,{id:"authenticate-and-ingest-files-from-cloud-storage",children:"Authenticate and ingest files from cloud storage"}),"\n",(0,o.jsxs)(n.p,{children:["After you start OpenRAG with OAuth connectors enabled, each user is prompted to authenticate with the OAuth provider upon accessing your OpenRAG instance.\nIndividual authentication is required to access a user's cloud storage from your OpenRAG instance.\nFor example, if a user navigates to the default OpenRAG URL at ",(0,o.jsx)(n.code,{children:"http://localhost:3000"}),", they are redirected to the OAuth provider's sign-in page.\nAfter authenticating and granting the required permissions for OpenRAG, the user is redirected back to OpenRAG."]}),"\n",(0,o.jsx)(n.p,{children:"To ingest knowledge with an OAuth connector, do the following:"}),"\n",(0,o.jsxs)(n.ol,{children:["\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:["Click ",(0,o.jsx)(i.A,{name:"Library","aria-hidden":"true"})," ",(0,o.jsx)(n.strong,{children:"Knowledge"})," to view your OpenSearch knowledge base."]}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:["Click ",(0,o.jsx)(n.strong,{children:"Add Knowledge"}),", and then select a storage provider."]}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:["On the ",(0,o.jsx)(n.strong,{children:"Add Cloud Knowledge"})," page, click ",(0,o.jsx)(n.strong,{children:"Add Files"}),", and then select the files and folders to ingest from the connected storage."]}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:["Click ",(0,o.jsx)(n.strong,{children:"Ingest Files"}),"."]}),"\n"]}),"\n"]}),"\n",(0,o.jsxs)(n.p,{children:["The selected files are processed in the background through the ",(0,o.jsx)(n.strong,{children:"OpenSearch Ingestion"})," flow."]}),"\n",(0,o.jsx)(u,{}),"\n",(0,o.jsxs)(n.p,{children:["You can ",(0,o.jsx)(n.a,{href:"#monitor-ingestion",children:"monitor ingestion"})," to see the progress of the uploads and check for failed uploads."]}),"\n",(0,o.jsx)(n.h2,{id:"url-flow",children:"Ingest knowledge from URLs"}),"\n",(0,o.jsxs)(n.p,{children:["The ",(0,o.jsx)(n.strong,{children:"OpenSearch URL Ingestion"})," flow is used to ingest web content from URLs.\nThis flow isn't directly accessible from the OpenRAG user interface.\nInstead, this flow is called by the ",(0,o.jsxs)(n.a,{href:"/chat#flow",children:[(0,o.jsx)(n.strong,{children:"OpenRAG OpenSearch Agent"})," flow"]})," as a Model Context Protocol (MCP) tool.\nThe agent can call this component to fetch web content from a given URL, and then ingest that content into your OpenSearch knowledge base."]}),"\n",(0,o.jsxs)(n.p,{children:["Like all OpenRAG flows, you can ",(0,o.jsx)(n.a,{href:"/agents#inspect-and-modify-flows",children:"inspect the flow in Langflow"}),", and you can customize it."]}),"\n",(0,o.jsxs)(n.p,{children:["For more information about MCP in Langflow, see the Langflow documentation on ",(0,o.jsx)(n.a,{href:"https://docs.langflow.org/mcp-client",children:"MCP clients"})," and ",(0,o.jsx)(n.a,{href:"https://docs.langflow.org/mcp-tutorial",children:"MCP servers"}),"."]}),"\n",(0,o.jsx)(n.h2,{id:"monitor-ingestion",children:"Monitor ingestion"}),"\n",(0,o.jsx)(n.p,{children:"Document ingestion tasks run in the background."}),"\n",(0,o.jsxs)(n.p,{children:["In the OpenRAG user interface, a badge is shown on ",(0,o.jsx)(i.A,{name:"Bell","aria-hidden":"true"})," ",(0,o.jsx)(n.strong,{children:"Tasks"})," when OpenRAG tasks are active.\nClick ",(0,o.jsx)(i.A,{name:"Bell","aria-hidden":"true"})," ",(0,o.jsx)(n.strong,{children:"Tasks"})," to inspect and cancel tasks:"]}),"\n",(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:[(0,o.jsx)(n.strong,{children:"Active Tasks"}),": All tasks that are ",(0,o.jsx)(n.strong,{children:"Pending"}),", ",(0,o.jsx)(n.strong,{children:"Running"}),", or ",(0,o.jsx)(n.strong,{children:"Processing"}),".\nFor each active task, depending on its state, you can find the task ID, start time, duration, number of files processed, and the total files enqueued for processing."]}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:[(0,o.jsx)(n.strong,{children:"Pending"}),": The task is queued and waiting to start."]}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:[(0,o.jsx)(n.strong,{children:"Running"}),": The task is actively processing files."]}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:[(0,o.jsx)(n.strong,{children:"Processing"}),": The task is performing ingestion operations."]}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:[(0,o.jsx)(n.strong,{children:"Failed"}),": Something went wrong during ingestion, or the task was manually canceled.\nFor troubleshooting advice, see ",(0,o.jsx)(n.a,{href:"#troubleshoot-ingestion",children:"Troubleshoot ingestion"}),"."]}),"\n"]}),"\n"]}),"\n",(0,o.jsxs)(n.p,{children:["To stop an active task, click ",(0,o.jsx)(i.A,{name:"X","aria-hidden":"true"})," ",(0,o.jsx)(n.strong,{children:"Cancel"}),". Canceling a task stops processing immediately and marks the task as ",(0,o.jsx)(n.strong,{children:"Failed"}),"."]}),"\n",(0,o.jsx)(n.h3,{id:"ingestion-performance-expectations",children:"Ingestion performance expectations"}),"\n",(0,o.jsx)(n.p,{children:"The following performance test was conducted with Docling Serve."}),"\n",(0,o.jsx)(n.p,{children:"On a local VM with 7 vCPUs and 8 GiB RAM, OpenRAG ingested approximately 5.03 GB across 1,083 files in about 42 minutes.\nThis equates to approximately 2.4 documents per second."}),"\n",(0,o.jsx)(n.p,{children:"You can generally expect equal or better performance on developer laptops, and significantly faster performance on servers.\nThroughput scales with CPU cores, memory, storage speed, and configuration choices, such as the embedding model, chunk size, overlap, and concurrency."}),"\n",(0,o.jsx)(n.p,{children:"This test returned 12 error, approximately 1.1 percent of the total files ingested.\nAll errors were file-specific, and they didn't stop the pipeline."}),"\n",(0,o.jsxs)(s,{children:[(0,o.jsx)("summary",{children:"Ingestion performance test details"}),(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsx)(n.p,{children:"Ingestion dataset:"}),"\n",(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsx)(n.li,{children:"Total files: 1,083 items mounted"}),"\n",(0,o.jsx)(n.li,{children:"Total size on disk: 5,026,474,862 bytes (approximately 5.03 GB)"}),"\n"]}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsx)(n.p,{children:"Hardware specifications:"}),"\n",(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsx)(n.p,{children:"Machine: Apple M4 Pro"}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsx)(n.p,{children:"Podman VM:"}),"\n",(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsx)(n.li,{children:"Name: podman-machine-default"}),"\n",(0,o.jsx)(n.li,{children:"Type: applehv"}),"\n",(0,o.jsx)(n.li,{children:"vCPUs: 7"}),"\n",(0,o.jsx)(n.li,{children:"Memory: 8 GiB"}),"\n",(0,o.jsx)(n.li,{children:"Disk size: 100 GiB"}),"\n"]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsx)(n.p,{children:"Test results:"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-text",children:"2025-09-24T22:40:45.542190Z /app/src/main.py:231 Ingesting default documents when ready disable_langflow_ingest=False\n2025-09-24T22:40:45.546385Z /app/src/main.py:270 Using Langflow ingestion pipeline for default documents file_count=1082\n...\n2025-09-24T23:19:44.866365Z /app/src/main.py:351 Langflow ingestion completed success_count=1070 error_count=12 total_files=1082\n"})}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsx)(n.p,{children:"Elapsed time: Approximately 42 minutes 15 seconds (2,535 seconds)"}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsx)(n.p,{children:"Throughput: Approximately 2.4 documents per second"}),"\n"]}),"\n"]})]}),"\n",(0,o.jsx)(n.h2,{id:"troubleshoot-ingestion",children:"Troubleshoot ingestion"}),"\n",(0,o.jsx)(n.p,{children:"If an ingestion task fails, do the following:"}),"\n",(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsx)(n.li,{children:"Make sure you are uploading supported file types."}),"\n",(0,o.jsx)(n.li,{children:"Split excessively large files into smaller files before uploading."}),"\n",(0,o.jsx)(n.li,{children:"Remove unusual embedded content, such as videos or animations, before uploading. Although Docling can replace some non-text content with placeholders during ingestion, some embedded content might cause errors."}),"\n"]}),"\n",(0,o.jsxs)(n.p,{children:["If the OpenRAG ",(0,o.jsx)(n.strong,{children:"Chat"})," doesn't seem to use your documents correctly, ",(0,o.jsx)(n.a,{href:"/knowledge#browse-knowledge",children:"browse your knowledge base"})," to confirm that the documents are uploaded in full, and the chunks are correct."]}),"\n",(0,o.jsxs)(n.p,{children:["If the documents are present and well-formed, check your ",(0,o.jsx)(n.a,{href:"/knowledge-filters",children:"knowledge filters"}),".\nIf a global filter is applied, make sure the expected documents are included in the global filter.\nIf the global filter excludes any documents, the agent cannot access those documents unless you apply a chat-level filter or change the global filter."]}),"\n",(0,o.jsx)(n.p,{children:"If text is missing or incorrectly processed, you need to reupload the documents after modifying the ingestion parameters or the documents themselves.\nFor example:"}),"\n",(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsx)(n.li,{children:"Break combined documents into separate files for better metadata context."}),"\n",(0,o.jsxs)(n.li,{children:["Make sure scanned documents are legible enough for extraction, and enable the ",(0,o.jsx)(n.strong,{children:"OCR"})," option. Poorly scanned documents might require additional preparation or rescanning before ingestion."]}),"\n",(0,o.jsxs)(n.li,{children:["Adjust the ",(0,o.jsx)(n.strong,{children:"Chunk Size"})," and ",(0,o.jsx)(n.strong,{children:"Chunk Overlap"})," settings to better suit your documents. Larger chunks provide more context but can include irrelevant information, while smaller chunks yield more precise semantic search but can lack context."]}),"\n"]}),"\n",(0,o.jsxs)(n.p,{children:["For more information about modifying ingestion parameters and flows, see ",(0,o.jsx)(n.a,{href:"/knowledge#knowledge-ingestion-settings",children:"Knowledge ingestion settings"}),"."]}),"\n",(0,o.jsx)(n.h2,{id:"see-also",children:"See also"}),"\n",(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsx)(n.li,{children:(0,o.jsx)(n.a,{href:"/knowledge",children:"Configure knowledge"})}),"\n",(0,o.jsx)(n.li,{children:(0,o.jsx)(n.a,{href:"/knowledge-filters",children:"Filter knowledge"})}),"\n",(0,o.jsx)(n.li,{children:(0,o.jsx)(n.a,{href:"/chat",children:"Chat with knowledge"})}),"\n",(0,o.jsx)(n.li,{children:(0,o.jsx)(n.a,{href:"/agents#inspect-and-modify-flows",children:"Inspect and modify flows"})}),"\n"]})]})}function b(e={}){const{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,o.jsx)(n,{...e,children:(0,o.jsx)(w,{...e})}):w(e)}},8401:(e,n,s)=>{s.d(n,{Ay:()=>a,RM:()=>i});var t=s(4848),o=s(8453),r=s(9179);const i=[];function l(e){const n={p:"p",strong:"strong",...(0,o.R)(),...e.components};return(0,t.jsxs)(n.p,{children:["When using the OpenRAG ",(0,t.jsx)(n.strong,{children:"Chat"}),", click ",(0,t.jsx)(r.A,{name:"Plus","aria-hidden":"true"})," in the chat input field to upload a file to the current chat session.\nFiles added this way are processed and made available to the agent for the current conversation only.\nThese files aren't stored in the knowledge base permanently."]})}function a(e={}){const{wrapper:n}={...(0,o.R)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(l,{...e})}):l(e)}},9179:(e,n,s)=>{s.d(n,{A:()=>r});s(6540);var t=s(7856),o=s(4848);function r({name:e,...n}){const s=t[e];return s?(0,o.jsx)(s,{...n}):null}},9365:(e,n,s)=>{s.d(n,{A:()=>i});s(6540);var t=s(4164);const o={tabItem:"tabItem_Ymn6"};var r=s(4848);function i({children:e,hidden:n,className:s}){return(0,r.jsx)("div",{role:"tabpanel",className:(0,t.A)(o.tabItem,s),hidden:n,children:e})}}}]); \ No newline at end of file diff --git a/assets/js/ca2c3c0c.ca722922.js b/assets/js/ca2c3c0c.ca722922.js deleted file mode 100644 index 32fd9fdc..00000000 --- a/assets/js/ca2c3c0c.ca722922.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(globalThis.webpackChunkopenrag_docs=globalThis.webpackChunkopenrag_docs||[]).push([[6919],{1381:(e,n,s)=>{s.d(n,{Ay:()=>l,RM:()=>r});var t=s(4848),o=s(8453);const r=[];function i(e){const n={code:"code",pre:"pre",...(0,o.R)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",metastring:'title="Docker"',children:"docker compose up -d\n"})}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",metastring:'title="Podman"',children:"podman compose up -d\n"})})]})}function l(e={}){const{wrapper:n}={...(0,o.R)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(i,{...e})}):i(e)}},1470:(e,n,s)=>{s.d(n,{A:()=>A});var t=s(6540),o=s(4164),r=s(7559),i=s(3104),l=s(6347),a=s(205),c=s(7485),d=s(1682),h=s(679);function u(e){return t.Children.toArray(e).filter(e=>"\n"!==e).map(e=>{if(!e||(0,t.isValidElement)(e)&&function(e){const{props:n}=e;return!!n&&"object"==typeof n&&"value"in n}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)})?.filter(Boolean)??[]}function p(e){const{values:n,children:s}=e;return(0,t.useMemo)(()=>{const e=n??function(e){return u(e).map(({props:{value:e,label:n,attributes:s,default:t}})=>({value:e,label:n,attributes:s,default:t}))}(s);return function(e){const n=(0,d.XI)(e,(e,n)=>e.value===n.value);if(n.length>0)throw new Error(`Docusaurus error: Duplicate values "${n.map(e=>e.value).join(", ")}" found in . Every value needs to be unique.`)}(e),e},[n,s])}function g({value:e,tabValues:n}){return n.some(n=>n.value===e)}function x({queryString:e=!1,groupId:n}){const s=(0,l.W6)(),o=function({queryString:e=!1,groupId:n}){if("string"==typeof e)return e;if(!1===e)return null;if(!0===e&&!n)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return n??null}({queryString:e,groupId:n});return[(0,c.aZ)(o),(0,t.useCallback)(e=>{if(!o)return;const n=new URLSearchParams(s.location.search);n.set(o,e),s.replace({...s.location,search:n.toString()})},[o,s])]}function f(e){const{defaultValue:n,queryString:s=!1,groupId:o}=e,r=p(e),[i,l]=(0,t.useState)(()=>function({defaultValue:e,tabValues:n}){if(0===n.length)throw new Error("Docusaurus error: the component requires at least one children component");if(e){if(!g({value:e,tabValues:n}))throw new Error(`Docusaurus error: The has a defaultValue "${e}" but none of its children has the corresponding value. Available values are: ${n.map(e=>e.value).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return e}const s=n.find(e=>e.default)??n[0];if(!s)throw new Error("Unexpected error: 0 tabValues");return s.value}({defaultValue:n,tabValues:r})),[c,d]=x({queryString:s,groupId:o}),[u,f]=function({groupId:e}){const n=function(e){return e?`docusaurus.tab.${e}`:null}(e),[s,o]=(0,h.Dv)(n);return[s,(0,t.useCallback)(e=>{n&&o.set(e)},[n,o])]}({groupId:o}),m=(()=>{const e=c??u;return g({value:e,tabValues:r})?e:null})();(0,a.A)(()=>{m&&l(m)},[m]);return{selectedValue:i,selectValue:(0,t.useCallback)(e=>{if(!g({value:e,tabValues:r}))throw new Error(`Can't select invalid tab value=${e}`);l(e),d(e),f(e)},[d,f,r]),tabValues:r}}var m=s(2303);const j={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var w=s(4848);function b({className:e,block:n,selectedValue:s,selectValue:t,tabValues:r}){const l=[],{blockElementScrollPositionUntilNextRender:a}=(0,i.a_)(),c=e=>{const n=e.currentTarget,o=l.indexOf(n),i=r[o].value;i!==s&&(a(n),t(i))},d=e=>{let n=null;switch(e.key){case"Enter":c(e);break;case"ArrowRight":{const s=l.indexOf(e.currentTarget)+1;n=l[s]??l[0];break}case"ArrowLeft":{const s=l.indexOf(e.currentTarget)-1;n=l[s]??l[l.length-1];break}}n?.focus()};return(0,w.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,o.A)("tabs",{"tabs--block":n},e),children:r.map(({value:e,label:n,attributes:t})=>(0,w.jsx)("li",{role:"tab",tabIndex:s===e?0:-1,"aria-selected":s===e,ref:e=>{l.push(e)},onKeyDown:d,onClick:c,...t,className:(0,o.A)("tabs__item",j.tabItem,t?.className,{"tabs__item--active":s===e}),children:n??e},e))})}function y({lazy:e,children:n,selectedValue:s}){const r=(Array.isArray(n)?n:[n]).filter(Boolean);if(e){const e=r.find(e=>e.props.value===s);return e?(0,t.cloneElement)(e,{className:(0,o.A)("margin-top--md",e.props.className)}):null}return(0,w.jsx)("div",{className:"margin-top--md",children:r.map((e,n)=>(0,t.cloneElement)(e,{key:n,hidden:e.props.value!==s}))})}function v(e){const n=f(e);return(0,w.jsxs)("div",{className:(0,o.A)(r.G.tabs.container,"tabs-container",j.tabList),children:[(0,w.jsx)(b,{...n,...e}),(0,w.jsx)(y,{...n,...e})]})}function A(e){const n=(0,m.A)();return(0,w.jsx)(v,{...e,children:u(e.children)},String(n))}},4577:(e,n,s)=>{s.d(n,{Ay:()=>l,RM:()=>r});var t=s(4848),o=s(8453);const r=[];function i(e){const n={code:"code",pre:"pre",...(0,o.R)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",metastring:'title="Docker"',children:"docker stop $(docker ps -q)\n"})}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",metastring:'title="Podman"',children:"podman stop --all\n"})})]})}function l(e={}){const{wrapper:n}={...(0,o.R)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(i,{...e})}):i(e)}},5421:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>m,contentTitle:()=>f,default:()=>b,frontMatter:()=>x,metadata:()=>t,toc:()=>j});const t=JSON.parse('{"id":"core-components/ingestion","title":"Ingest knowledge","description":"Upload documents to your OpenRAG OpenSearch instance to populate your knowledge base with unique content, such as your own company documents, research papers, or websites.","source":"@site/docs/core-components/ingestion.mdx","sourceDirName":"core-components","slug":"/ingestion","permalink":"/ingestion","draft":false,"unlisted":false,"editUrl":"https://github.com/openrag/openrag/tree/main/docs/docs/core-components/ingestion.mdx","tags":[],"version":"current","frontMatter":{"title":"Ingest knowledge","slug":"/ingestion"},"sidebar":"tutorialSidebar","previous":{"title":"Configure knowledge","permalink":"/knowledge"},"next":{"title":"Filter knowledge","permalink":"/knowledge-filters"}}');var o=s(4848),r=s(8453),i=s(9179),l=s(1470),a=s(9365),c=s(8401);const d=[];function h(e){const n={a:"a",code:"code",li:"li",p:"p",strong:"strong",ul:"ul",...(0,r.R)(),...e.components},{Details:s}=n;return s||function(e,n){throw new Error("Expected "+(n?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}("Details",!0),(0,o.jsxs)(s,{children:[(0,o.jsx)("summary",{children:"About the OpenSearch Ingestion flow"}),(0,o.jsxs)(n.p,{children:["When you upload documents locally or with OAuth connectors, the ",(0,o.jsx)(n.strong,{children:"OpenSearch Ingestion"})," flow runs in the background.\nBy default, this flow uses Docling Serve to import and process documents."]}),(0,o.jsxs)(n.p,{children:["Like all ",(0,o.jsx)(n.a,{href:"/agents",children:"OpenRAG flows"}),", you can ",(0,o.jsx)(n.a,{href:"/agents#inspect-and-modify-flows",children:"inspect the flow in Langflow"}),", and you can customize it if you want to change the knowledge ingestion settings."]}),(0,o.jsxs)(n.p,{children:["The ",(0,o.jsx)(n.strong,{children:"OpenSearch Ingestion"})," flow is comprised of several components that work together to process and store documents in your knowledge base:"]}),(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:[(0,o.jsxs)(n.a,{href:"https://docs.langflow.org/bundles-docling#docling-serve",children:[(0,o.jsx)(n.strong,{children:"Docling Serve"})," component"]}),": Ingests files and processes them by connecting to OpenRAG's local Docling Serve service. The output is ",(0,o.jsx)(n.code,{children:"DoclingDocument"})," data that contains the extracted text and metadata from the documents."]}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:[(0,o.jsxs)(n.a,{href:"https://docs.langflow.org/bundles-docling#export-doclingdocument",children:[(0,o.jsx)(n.strong,{children:"Export DoclingDocument"})," component"]}),": Exports processed ",(0,o.jsx)(n.code,{children:"DoclingDocument"})," data to Markdown format with image placeholders. This conversion standardizes the document data in preparation for further processing."]}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:[(0,o.jsxs)(n.a,{href:"https://docs.langflow.org/components-processing#dataframe-operations",children:[(0,o.jsx)(n.strong,{children:"DataFrame Operations"})," component"]}),": Three of these components run sequentially to add metadata to the document data: ",(0,o.jsx)(n.code,{children:"filename"}),", ",(0,o.jsx)(n.code,{children:"file_size"}),", and ",(0,o.jsx)(n.code,{children:"mimetype"}),"."]}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:[(0,o.jsxs)(n.a,{href:"https://docs.langflow.org/components-processing#split-text",children:[(0,o.jsx)(n.strong,{children:"Split Text"})," component"]}),": Splits the processed text into chunks, based on the configured ",(0,o.jsx)(n.a,{href:"/knowledge#knowledge-ingestion-settings",children:"chunk size and overlap settings"}),"."]}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:[(0,o.jsx)(n.strong,{children:"Secret Input"})," component: If needed, four of these components securely fetch the ",(0,o.jsx)(n.a,{href:"/knowledge#auth",children:"OAuth authentication"})," configuration variables: ",(0,o.jsx)(n.code,{children:"CONNECTOR_TYPE"}),", ",(0,o.jsx)(n.code,{children:"OWNER"}),", ",(0,o.jsx)(n.code,{children:"OWNER_EMAIL"}),", and ",(0,o.jsx)(n.code,{children:"OWNER_NAME"}),"."]}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:[(0,o.jsx)(n.strong,{children:"Create Data"})," component: Combines the authentication credentials from the ",(0,o.jsx)(n.strong,{children:"Secret Input"})," components into a structured data object that is associated with the document embeddings."]}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:[(0,o.jsxs)(n.a,{href:"https://docs.langflow.org/components-embedding-models",children:[(0,o.jsx)(n.strong,{children:"Embedding Model"})," component"]}),": Generates vector embeddings using your selected ",(0,o.jsx)(n.a,{href:"/knowledge#set-the-embedding-model-and-dimensions",children:"embedding model"}),"."]}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:[(0,o.jsxs)(n.a,{href:"https://docs.langflow.org/bundles-elastic#opensearch",children:[(0,o.jsx)(n.strong,{children:"OpenSearch"})," component"]}),": Stores the processed documents and their embeddings in a ",(0,o.jsx)(n.code,{children:"documents"})," index of your OpenRAG ",(0,o.jsx)(n.a,{href:"/knowledge",children:"OpenSearch knowledge base"}),"."]}),"\n",(0,o.jsxs)(n.p,{children:["The default address for the OpenSearch instance is ",(0,o.jsx)(n.code,{children:"https://opensearch:9200"}),". To change this address, edit the ",(0,o.jsx)(n.code,{children:"OPENSEARCH_PORT"})," ",(0,o.jsx)(n.a,{href:"/reference/configuration#opensearch-settings",children:"environment variable"}),"."]}),"\n",(0,o.jsxs)(n.p,{children:["The default authentication method is JSON Web Token (JWT) authentication. If you ",(0,o.jsx)(n.a,{href:"/agents#inspect-and-modify-flows",children:"edit the flow"}),", you can select ",(0,o.jsx)(n.code,{children:"basic"})," auth mode, which uses the ",(0,o.jsx)(n.code,{children:"OPENSEARCH_USERNAME"})," and ",(0,o.jsx)(n.code,{children:"OPENSEARCH_PASSWORD"})," ",(0,o.jsx)(n.a,{href:"/reference/configuration#opensearch-settings",children:"environment variables"})," for authentication instead of JWT."]}),"\n"]}),"\n"]})]})}function u(e={}){const{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,o.jsx)(n,{...e,children:(0,o.jsx)(h,{...e})}):h(e)}var p=s(1381),g=s(4577);const x={title:"Ingest knowledge",slug:"/ingestion"},f=void 0,m={},j=[{value:"Ingest local files and folders",id:"ingest-local-files-and-folders",level:2},...d,{value:"Ingest local files temporarily",id:"ingest-local-files-temporarily",level:2},...c.RM,{value:"Ingest files with OAuth connectors",id:"oauth-ingestion",level:2},{value:"Enable OAuth connectors",id:"enable-oauth-connectors",level:3},...g.RM,...p.RM,{value:"Authenticate and ingest files from cloud storage",id:"authenticate-and-ingest-files-from-cloud-storage",level:3},...d,{value:"Ingest knowledge from URLs",id:"url-flow",level:2},{value:"Monitor ingestion",id:"monitor-ingestion",level:2},{value:"Ingestion performance expectations",id:"ingestion-performance-expectations",level:3},{value:"Troubleshoot ingestion",id:"troubleshoot-ingestion",level:2},{value:"See also",id:"see-also",level:2}];function w(e){const n={a:"a",code:"code",h2:"h2",h3:"h3",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,r.R)(),...e.components},{Details:s}=n;return s||function(e,n){throw new Error("Expected "+(n?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}("Details",!0),(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(n.p,{children:["Upload documents to your ",(0,o.jsx)(n.a,{href:"/knowledge",children:"OpenRAG OpenSearch instance"})," to populate your knowledge base with unique content, such as your own company documents, research papers, or websites.\nDocuments are processed through OpenRAG's knowledge ingestion flows with Docling."]}),"\n",(0,o.jsx)(n.p,{children:"OpenRAG can ingest knowledge from direct file uploads, URLs, and OAuth authenticated connectors."}),"\n",(0,o.jsxs)(n.p,{children:["Knowledge ingestion is powered by OpenRAG's built-in knowledge ingestion flows that use Docling to process documents before storing the documents in your OpenSearch database.\nDuring ingestion, documents are broken into smaller chunks of content that are then embedded using your selected ",(0,o.jsx)(n.a,{href:"/knowledge#set-the-embedding-model-and-dimensions",children:"embedding model"}),".\nThen, the chunks, embeddings, and associated metadata (which connects chunks of the same document) are stored in your OpenSearch database."]}),"\n",(0,o.jsxs)(n.p,{children:["To modify chunking behavior and other ingestion settings, see ",(0,o.jsx)(n.a,{href:"/knowledge#knowledge-ingestion-settings",children:"Knowledge ingestion settings"})," and ",(0,o.jsx)(n.a,{href:"/agents#inspect-and-modify-flows",children:"Inspect and modify flows"}),"."]}),"\n",(0,o.jsx)(n.h2,{id:"ingest-local-files-and-folders",children:"Ingest local files and folders"}),"\n",(0,o.jsx)(n.p,{children:"You can upload files and folders from your local machine to your knowledge base:"}),"\n",(0,o.jsxs)(n.ol,{children:["\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:["Click ",(0,o.jsx)(i.A,{name:"Library","aria-hidden":"true"})," ",(0,o.jsx)(n.strong,{children:"Knowledge"})," to view your OpenSearch knowledge base."]}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:["Click ",(0,o.jsx)(n.strong,{children:"Add Knowledge"})," to add your own documents to your OpenRAG knowledge base."]}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:["To upload one file, click ",(0,o.jsx)(i.A,{name:"File","aria-hidden":"true"})," ",(0,o.jsx)(n.strong,{children:"File"}),". To upload all documents in a folder, click ",(0,o.jsx)(i.A,{name:"Folder","aria-hidden":"true"})," ",(0,o.jsx)(n.strong,{children:"Folder"}),"."]}),"\n",(0,o.jsxs)(n.p,{children:["The default path is ",(0,o.jsx)(n.code,{children:"~/.openrag/documents"}),".\nTo change this path, see ",(0,o.jsx)(n.a,{href:"/knowledge#set-the-local-documents-path",children:"Set the local documents path"}),"."]}),"\n"]}),"\n"]}),"\n",(0,o.jsxs)(n.p,{children:["The selected files are processed in the background through the ",(0,o.jsx)(n.strong,{children:"OpenSearch Ingestion"})," flow."]}),"\n",(0,o.jsx)(u,{}),"\n",(0,o.jsxs)(n.p,{children:["You can ",(0,o.jsx)(n.a,{href:"#monitor-ingestion",children:"monitor ingestion"})," to see the progress of the uploads and check for failed uploads."]}),"\n",(0,o.jsx)(n.h2,{id:"ingest-local-files-temporarily",children:"Ingest local files temporarily"}),"\n",(0,o.jsx)(c.Ay,{}),"\n",(0,o.jsx)(n.h2,{id:"oauth-ingestion",children:"Ingest files with OAuth connectors"}),"\n",(0,o.jsx)(n.p,{children:"OpenRAG can use OAuth authenticated connectors to ingest documents from the following external services:"}),"\n",(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsx)(n.li,{children:"AWS S3"}),"\n",(0,o.jsx)(n.li,{children:"Google Drive"}),"\n",(0,o.jsx)(n.li,{children:"Microsoft OneDrive"}),"\n",(0,o.jsx)(n.li,{children:"Microsoft Sharepoint"}),"\n"]}),"\n",(0,o.jsx)(n.p,{children:"These connectors enable seamless ingestion of files from cloud storage to your OpenRAG knowledge base."}),"\n",(0,o.jsx)(n.p,{children:"Individual users can connect their personal cloud storage accounts to OpenRAG. Each user must separately authorize OpenRAG to access their own cloud storage. When a user connects a cloud storage service, they are redirected to authenticate with that service provider and grant OpenRAG permission to sync documents from their personal cloud storage."}),"\n",(0,o.jsx)(n.h3,{id:"enable-oauth-connectors",children:"Enable OAuth connectors"}),"\n",(0,o.jsx)(n.p,{children:"Before users can connect their own cloud storage accounts, you must configure the provider's OAuth credentials in OpenRAG. Typically, this requires that you register OpenRAG as an OAuth application in your cloud provider, and then obtain the app's OAuth credentials, such as a client ID and secret key.\nTo enable multiple connectors, you must register an app and generate credentials for each provider."}),"\n",(0,o.jsxs)(l.A,{children:[(0,o.jsxs)(a.A,{value:"TUI",label:"TUI-managed services",default:!0,children:[(0,o.jsxs)(n.p,{children:["If you use the ",(0,o.jsx)(n.a,{href:"/tui",children:"Terminal User Interface (TUI)"})," to manage your OpenRAG services, enter OAuth credentials in the ",(0,o.jsx)(n.strong,{children:"Advanced Setup"})," menu.\nYou can do this during ",(0,o.jsx)(n.a,{href:"/install#setup",children:"installation"}),", or you can add the credentials afterwards:"]}),(0,o.jsxs)(n.ol,{children:["\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:["If OpenRAG is running, open the TUI's ",(0,o.jsx)(n.strong,{children:"Status"})," menu (",(0,o.jsx)("kbd",{children:"3"}),"), and then click ",(0,o.jsx)(n.strong,{children:"Stop Services"}),"."]}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:["Open the ",(0,o.jsx)(n.strong,{children:"Advanced Setup"})," menu (",(0,o.jsx)("kbd",{children:"2"}),"), and then add the OAuth credentials for the cloud storage providers that you want to use:"]}),"\n",(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsxs)(n.li,{children:[(0,o.jsx)(n.strong,{children:"Amazon"}),": Provide your AWS Access Key ID and AWS Secret Access Key with access to your S3 instance. For more information, see the AWS documentation on ",(0,o.jsx)(n.a,{href:"https://docs.aws.amazon.com/singlesignon/latest/userguide/manage-your-applications.html",children:"Configuring access to AWS applications"}),"."]}),"\n",(0,o.jsxs)(n.li,{children:[(0,o.jsx)(n.strong,{children:"Google"}),": Provide your Google OAuth Client ID and Google OAuth Client Secret. You can generate these in the ",(0,o.jsx)(n.a,{href:"https://console.cloud.google.com/apis/credentials",children:"Google Cloud Console"}),". For more information, see the ",(0,o.jsx)(n.a,{href:"https://developers.google.com/identity/protocols/oauth2",children:"Google OAuth client documentation"}),"."]}),"\n",(0,o.jsxs)(n.li,{children:[(0,o.jsx)(n.strong,{children:"Microsoft"}),": For the Microsoft OAuth Client ID and Microsoft OAuth Client Secret, provide ",(0,o.jsx)(n.a,{href:"https://learn.microsoft.com/en-us/onedrive/developer/rest-api/getting-started/app-registration?view=odsp-graph-online",children:"Azure application registration credentials for SharePoint and OneDrive"}),". For more information, see the ",(0,o.jsx)(n.a,{href:"https://learn.microsoft.com/en-us/onedrive/developer/rest-api/getting-started/graph-oauth",children:"Microsoft Graph OAuth client documentation"}),"."]}),"\n"]}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsx)(n.p,{children:"The TUI presents redirect URIs for your OAuth app that you must register with your OAuth provider.\nThese are the URLs your OAuth provider will redirect back to after users authenticate and grant access to their cloud storage."}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:["Click ",(0,o.jsx)(n.strong,{children:"Save Configuration"})," to add the OAuth credentials to your ",(0,o.jsxs)(n.a,{href:"/reference/configuration",children:["OpenRAG ",(0,o.jsx)(n.code,{children:".env"})," file"]}),"."]}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:["Click ",(0,o.jsx)(n.strong,{children:"Start All Services"})," to restart the OpenRAG containers with OAuth enabled."]}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsx)(n.p,{children:"Launch the OpenRAG app.\nYou should be prompted to sign in to your OAuth provider before being redirected to your OpenRAG instance."}),"\n"]}),"\n"]})]}),(0,o.jsxs)(a.A,{value:"env",label:"Self-managed services",children:[(0,o.jsxs)(n.p,{children:["If you ",(0,o.jsx)(n.a,{href:"/docker",children:"installed OpenRAG with self-managed services"}),", set OAuth credentials in your ",(0,o.jsxs)(n.a,{href:"/reference/configuration",children:["OpenRAG ",(0,o.jsx)(n.code,{children:".env"})," file"]}),"."]}),(0,o.jsxs)(n.p,{children:["You can do this during ",(0,o.jsx)(n.a,{href:"/docker#setup",children:"initial set up"}),", or you can add the credentials afterwards:"]}),(0,o.jsxs)(n.ol,{children:["\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsx)(n.p,{children:"Stop all OpenRAG containers:"}),"\n",(0,o.jsx)(g.Ay,{}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:["Edit your OpenRAG ",(0,o.jsx)(n.code,{children:".env"})," file to add the OAuth credentials for the cloud storage providers that you want to use:"]}),"\n",(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:[(0,o.jsx)(n.strong,{children:"Amazon"}),": Provide your AWS Access Key ID and AWS Secret Access Key with access to your S3 instance. For more information, see the AWS documentation on ",(0,o.jsx)(n.a,{href:"https://docs.aws.amazon.com/singlesignon/latest/userguide/manage-your-applications.html",children:"Configuring access to AWS applications"}),"."]}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-env",children:"AWS_ACCESS_KEY_ID=\nAWS_SECRET_ACCESS_KEY=\n"})}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:[(0,o.jsx)(n.strong,{children:"Google"}),": Provide your Google OAuth Client ID and Google OAuth Client Secret. You can generate these in the ",(0,o.jsx)(n.a,{href:"https://console.cloud.google.com/apis/credentials",children:"Google Cloud Console"}),". For more information, see the ",(0,o.jsx)(n.a,{href:"https://developers.google.com/identity/protocols/oauth2",children:"Google OAuth client documentation"}),"."]}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-env",children:"GOOGLE_OAUTH_CLIENT_ID=\nGOOGLE_OAUTH_CLIENT_SECRET=\n"})}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:[(0,o.jsx)(n.strong,{children:"Microsoft"}),": For the Microsoft OAuth Client ID and Microsoft OAuth Client Secret, provide ",(0,o.jsx)(n.a,{href:"https://learn.microsoft.com/en-us/onedrive/developer/rest-api/getting-started/app-registration?view=odsp-graph-online",children:"Azure application registration credentials for SharePoint and OneDrive"}),". For more information, see the ",(0,o.jsx)(n.a,{href:"https://learn.microsoft.com/en-us/onedrive/developer/rest-api/getting-started/graph-oauth",children:"Microsoft Graph OAuth client documentation"}),"."]}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-env",children:"MICROSOFT_GRAPH_OAUTH_CLIENT_ID=\nMICROSOFT_GRAPH_OAUTH_CLIENT_SECRET=\n"})}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:["Save the ",(0,o.jsx)(n.code,{children:".env"})," file."]}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsx)(n.p,{children:"Restart your OpenRAG containers:"}),"\n",(0,o.jsx)(p.Ay,{}),"\n"]}),"\n"]})]})]}),"\n",(0,o.jsx)(n.h3,{id:"authenticate-and-ingest-files-from-cloud-storage",children:"Authenticate and ingest files from cloud storage"}),"\n",(0,o.jsxs)(n.p,{children:["After you start OpenRAG with OAuth connectors enabled, each user is prompted to authenticate with the OAuth provider upon accessing your OpenRAG instance.\nIndividual authentication is required to access a user's cloud storage from your OpenRAG instance.\nFor example, if a user navigates to the default OpenRAG URL at ",(0,o.jsx)(n.code,{children:"http://localhost:3000"}),", they are redirected to the OAuth provider's sign-in page.\nAfter authenticating and granting the required permissions for OpenRAG, the user is redirected back to OpenRAG."]}),"\n",(0,o.jsx)(n.p,{children:"To ingest knowledge with an OAuth connector, do the following:"}),"\n",(0,o.jsxs)(n.ol,{children:["\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:["Click ",(0,o.jsx)(i.A,{name:"Library","aria-hidden":"true"})," ",(0,o.jsx)(n.strong,{children:"Knowledge"})," to view your OpenSearch knowledge base."]}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:["Click ",(0,o.jsx)(n.strong,{children:"Add Knowledge"}),", and then select a storage provider."]}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:["On the ",(0,o.jsx)(n.strong,{children:"Add Cloud Knowledge"})," page, click ",(0,o.jsx)(n.strong,{children:"Add Files"}),", and then select the files and folders to ingest from the connected storage."]}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:["Click ",(0,o.jsx)(n.strong,{children:"Ingest Files"}),"."]}),"\n"]}),"\n"]}),"\n",(0,o.jsxs)(n.p,{children:["The selected files are processed in the background through the ",(0,o.jsx)(n.strong,{children:"OpenSearch Ingestion"})," flow."]}),"\n",(0,o.jsx)(u,{}),"\n",(0,o.jsxs)(n.p,{children:["You can ",(0,o.jsx)(n.a,{href:"#monitor-ingestion",children:"monitor ingestion"})," to see the progress of the uploads and check for failed uploads."]}),"\n",(0,o.jsx)(n.h2,{id:"url-flow",children:"Ingest knowledge from URLs"}),"\n",(0,o.jsxs)(n.p,{children:["The ",(0,o.jsx)(n.strong,{children:"OpenSearch URL Ingestion"})," flow is used to ingest web content from URLs.\nThis flow isn't directly accessible from the OpenRAG user interface.\nInstead, this flow is called by the ",(0,o.jsxs)(n.a,{href:"/chat#flow",children:[(0,o.jsx)(n.strong,{children:"OpenRAG OpenSearch Agent"})," flow"]})," as a Model Context Protocol (MCP) tool.\nThe agent can call this component to fetch web content from a given URL, and then ingest that content into your OpenSearch knowledge base."]}),"\n",(0,o.jsxs)(n.p,{children:["Like all OpenRAG flows, you can ",(0,o.jsx)(n.a,{href:"/agents#inspect-and-modify-flows",children:"inspect the flow in Langflow"}),", and you can customize it."]}),"\n",(0,o.jsxs)(n.p,{children:["For more information about MCP in Langflow, see the Langflow documentation on ",(0,o.jsx)(n.a,{href:"https://docs.langflow.org/mcp-client",children:"MCP clients"})," and ",(0,o.jsx)(n.a,{href:"https://docs.langflow.org/mcp-tutorial",children:"MCP servers"}),"."]}),"\n",(0,o.jsx)(n.h2,{id:"monitor-ingestion",children:"Monitor ingestion"}),"\n",(0,o.jsx)(n.p,{children:"Document ingestion tasks run in the background."}),"\n",(0,o.jsxs)(n.p,{children:["In the OpenRAG user interface, a badge is shown on ",(0,o.jsx)(i.A,{name:"Bell","aria-hidden":"true"})," ",(0,o.jsx)(n.strong,{children:"Tasks"})," when OpenRAG tasks are active.\nClick ",(0,o.jsx)(i.A,{name:"Bell","aria-hidden":"true"})," ",(0,o.jsx)(n.strong,{children:"Tasks"})," to inspect and cancel tasks:"]}),"\n",(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:[(0,o.jsx)(n.strong,{children:"Active Tasks"}),": All tasks that are ",(0,o.jsx)(n.strong,{children:"Pending"}),", ",(0,o.jsx)(n.strong,{children:"Running"}),", or ",(0,o.jsx)(n.strong,{children:"Processing"}),".\nFor each active task, depending on its state, you can find the task ID, start time, duration, number of files processed, and the total files enqueued for processing."]}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:[(0,o.jsx)(n.strong,{children:"Pending"}),": The task is queued and waiting to start."]}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:[(0,o.jsx)(n.strong,{children:"Running"}),": The task is actively processing files."]}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:[(0,o.jsx)(n.strong,{children:"Processing"}),": The task is performing ingestion operations."]}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:[(0,o.jsx)(n.strong,{children:"Failed"}),": Something went wrong during ingestion, or the task was manually canceled.\nFor troubleshooting advice, see ",(0,o.jsx)(n.a,{href:"#troubleshoot-ingestion",children:"Troubleshoot ingestion"}),"."]}),"\n"]}),"\n"]}),"\n",(0,o.jsxs)(n.p,{children:["To stop an active task, click ",(0,o.jsx)(i.A,{name:"X","aria-hidden":"true"})," ",(0,o.jsx)(n.strong,{children:"Cancel"}),". Canceling a task stops processing immediately and marks the task as ",(0,o.jsx)(n.strong,{children:"Failed"}),"."]}),"\n",(0,o.jsx)(n.h3,{id:"ingestion-performance-expectations",children:"Ingestion performance expectations"}),"\n",(0,o.jsx)(n.p,{children:"The following performance test was conducted with Docling Serve."}),"\n",(0,o.jsx)(n.p,{children:"On a local VM with 7 vCPUs and 8 GiB RAM, OpenRAG ingested approximately 5.03 GB across 1,083 files in about 42 minutes.\nThis equates to approximately 2.4 documents per second."}),"\n",(0,o.jsx)(n.p,{children:"You can generally expect equal or better performance on developer laptops, and significantly faster performance on servers.\nThroughput scales with CPU cores, memory, storage speed, and configuration choices, such as the embedding model, chunk size, overlap, and concurrency."}),"\n",(0,o.jsx)(n.p,{children:"This test returned 12 error, approximately 1.1 percent of the total files ingested.\nAll errors were file-specific, and they didn't stop the pipeline."}),"\n",(0,o.jsxs)(s,{children:[(0,o.jsx)("summary",{children:"Ingestion performance test details"}),(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsx)(n.p,{children:"Ingestion dataset:"}),"\n",(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsx)(n.li,{children:"Total files: 1,083 items mounted"}),"\n",(0,o.jsx)(n.li,{children:"Total size on disk: 5,026,474,862 bytes (approximately 5.03 GB)"}),"\n"]}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsx)(n.p,{children:"Hardware specifications:"}),"\n",(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsx)(n.p,{children:"Machine: Apple M4 Pro"}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsx)(n.p,{children:"Podman VM:"}),"\n",(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsx)(n.li,{children:"Name: podman-machine-default"}),"\n",(0,o.jsx)(n.li,{children:"Type: applehv"}),"\n",(0,o.jsx)(n.li,{children:"vCPUs: 7"}),"\n",(0,o.jsx)(n.li,{children:"Memory: 8 GiB"}),"\n",(0,o.jsx)(n.li,{children:"Disk size: 100 GiB"}),"\n"]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsx)(n.p,{children:"Test results:"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-text",children:"2025-09-24T22:40:45.542190Z /app/src/main.py:231 Ingesting default documents when ready disable_langflow_ingest=False\n2025-09-24T22:40:45.546385Z /app/src/main.py:270 Using Langflow ingestion pipeline for default documents file_count=1082\n...\n2025-09-24T23:19:44.866365Z /app/src/main.py:351 Langflow ingestion completed success_count=1070 error_count=12 total_files=1082\n"})}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsx)(n.p,{children:"Elapsed time: Approximately 42 minutes 15 seconds (2,535 seconds)"}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsx)(n.p,{children:"Throughput: Approximately 2.4 documents per second"}),"\n"]}),"\n"]})]}),"\n",(0,o.jsx)(n.h2,{id:"troubleshoot-ingestion",children:"Troubleshoot ingestion"}),"\n",(0,o.jsx)(n.p,{children:"If an ingestion task fails, do the following:"}),"\n",(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsx)(n.li,{children:"Make sure you are uploading supported file types."}),"\n",(0,o.jsx)(n.li,{children:"Split excessively large files into smaller files before uploading."}),"\n",(0,o.jsx)(n.li,{children:"Remove unusual embedded content, such as videos or animations, before uploading. Although Docling can replace some non-text content with placeholders during ingestion, some embedded content might cause errors."}),"\n"]}),"\n",(0,o.jsxs)(n.p,{children:["If the OpenRAG ",(0,o.jsx)(n.strong,{children:"Chat"})," doesn't seem to use your documents correctly, ",(0,o.jsx)(n.a,{href:"/knowledge#browse-knowledge",children:"browse your knowledge base"})," to confirm that the documents are uploaded in full, and the chunks are correct."]}),"\n",(0,o.jsxs)(n.p,{children:["If the documents are present and well-formed, check your ",(0,o.jsx)(n.a,{href:"/knowledge-filters",children:"knowledge filters"}),".\nIf a global filter is applied, make sure the expected documents are included in the global filter.\nIf the global filter excludes any documents, the agent cannot access those documents unless you apply a chat-level filter or change the global filter."]}),"\n",(0,o.jsx)(n.p,{children:"If text is missing or incorrectly processed, you need to reupload the documents after modifying the ingestion parameters or the documents themselves.\nFor example:"}),"\n",(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsx)(n.li,{children:"Break combined documents into separate files for better metadata context."}),"\n",(0,o.jsxs)(n.li,{children:["Make sure scanned documents are legible enough for extraction, and enable the ",(0,o.jsx)(n.strong,{children:"OCR"})," option. Poorly scanned documents might require additional preparation or rescanning before ingestion."]}),"\n",(0,o.jsxs)(n.li,{children:["Adjust the ",(0,o.jsx)(n.strong,{children:"Chunk Size"})," and ",(0,o.jsx)(n.strong,{children:"Chunk Overlap"})," settings to better suit your documents. Larger chunks provide more context but can include irrelevant information, while smaller chunks yield more precise semantic search but can lack context."]}),"\n"]}),"\n",(0,o.jsxs)(n.p,{children:["For more information about modifying ingestion parameters and flows, see ",(0,o.jsx)(n.a,{href:"/knowledge#knowledge-ingestion-settings",children:"Knowledge ingestion settings"}),"."]}),"\n",(0,o.jsx)(n.h2,{id:"see-also",children:"See also"}),"\n",(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsx)(n.li,{children:(0,o.jsx)(n.a,{href:"/knowledge",children:"Configure knowledge"})}),"\n",(0,o.jsx)(n.li,{children:(0,o.jsx)(n.a,{href:"/knowledge-filters",children:"Filter knowledge"})}),"\n",(0,o.jsx)(n.li,{children:(0,o.jsx)(n.a,{href:"/chat",children:"Chat with knowledge"})}),"\n",(0,o.jsx)(n.li,{children:(0,o.jsx)(n.a,{href:"/agents#inspect-and-modify-flows",children:"Inspect and modify flows"})}),"\n"]})]})}function b(e={}){const{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,o.jsx)(n,{...e,children:(0,o.jsx)(w,{...e})}):w(e)}},8401:(e,n,s)=>{s.d(n,{Ay:()=>a,RM:()=>i});var t=s(4848),o=s(8453),r=s(9179);const i=[];function l(e){const n={p:"p",strong:"strong",...(0,o.R)(),...e.components};return(0,t.jsxs)(n.p,{children:["When using the OpenRAG ",(0,t.jsx)(n.strong,{children:"Chat"}),", click ",(0,t.jsx)(r.A,{name:"Plus","aria-hidden":"true"})," in the chat input field to upload a file to the current chat session.\nFiles added this way are processed and made available to the agent for the current conversation only.\nThese files aren't stored in the knowledge base permanently."]})}function a(e={}){const{wrapper:n}={...(0,o.R)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(l,{...e})}):l(e)}},9179:(e,n,s)=>{s.d(n,{A:()=>r});s(6540);var t=s(7856),o=s(4848);function r({name:e,...n}){const s=t[e];return s?(0,o.jsx)(s,{...n}):null}},9365:(e,n,s)=>{s.d(n,{A:()=>i});s(6540);var t=s(4164);const o={tabItem:"tabItem_Ymn6"};var r=s(4848);function i({children:e,hidden:n,className:s}){return(0,r.jsx)("div",{role:"tabpanel",className:(0,t.A)(o.tabItem,s),hidden:n,children:e})}}}]); \ No newline at end of file diff --git a/assets/js/runtime~main.28b5001d.js b/assets/js/runtime~main.0ec053c5.js similarity index 96% rename from assets/js/runtime~main.28b5001d.js rename to assets/js/runtime~main.0ec053c5.js index f31d74ed..28db7696 100644 --- a/assets/js/runtime~main.28b5001d.js +++ b/assets/js/runtime~main.0ec053c5.js @@ -1 +1 @@ -(()=>{"use strict";var e,a,r,t,f,c={},o={};function d(e){var a=o[e];if(void 0!==a)return a.exports;var r=o[e]={exports:{}};return c[e].call(r.exports,r,r.exports,d),r.exports}d.m=c,e=[],d.O=(a,r,t,f)=>{if(!r){var c=1/0;for(i=0;i=f)&&Object.keys(d.O).every(e=>d.O[e](r[b]))?r.splice(b--,1):(o=!1,f0&&e[i-1][2]>f;i--)e[i]=e[i-1];e[i]=[r,t,f]},d.n=e=>{var a=e&&e.__esModule?()=>e.default:()=>e;return d.d(a,{a:a}),a},r=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,d.t=function(e,t){if(1&t&&(e=this(e)),8&t)return e;if("object"==typeof e&&e){if(4&t&&e.__esModule)return e;if(16&t&&"function"==typeof e.then)return e}var f=Object.create(null);d.r(f);var c={};a=a||[null,r({}),r([]),r(r)];for(var o=2&t&&e;("object"==typeof o||"function"==typeof o)&&!~a.indexOf(o);o=r(o))Object.getOwnPropertyNames(o).forEach(a=>c[a]=()=>e[a]);return c.default=()=>e,d.d(f,c),f},d.d=(e,a)=>{for(var r in a)d.o(a,r)&&!d.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:a[r]})},d.f={},d.e=e=>Promise.all(Object.keys(d.f).reduce((a,r)=>(d.f[r](e,a),a),[])),d.u=e=>"assets/js/"+({98:"af920ffe",571:"0ba6a408",961:"21afe7ac",1567:"22dd74f7",2272:"749371cc",2668:"eb5b356a",3207:"27b4a875",5490:"71478a5d",5668:"c5b64a02",5742:"aba21aa0",5750:"d0314b07",6152:"52896773",6190:"7b5e550f",6235:"915a24fd",6919:"ca2c3c0c",6976:"4ba45368",7098:"a7bd4aaa",8186:"03ef5215",8401:"17896441",8615:"ae242f53",8617:"441f609b",9026:"c8078f0a",9048:"a94703ab",9172:"e633a5ea",9532:"33362219",9647:"5e95c892"}[e]||e)+"."+{98:"492f9e55",165:"7b1d067d",291:"1b64972f",571:"efa6fc46",617:"e8fa27b8",961:"b1bb0884",1e3:"f9af7a41",1203:"b618bb61",1567:"7a0edff6",1741:"b927934f",1746:"1ce4b99b",2130:"09232a19",2237:"70c48bab",2272:"774b6a0c",2279:"44341cb1",2291:"2753844f",2325:"7c4239a7",2334:"6d98e48e",2492:"e6c78669",2668:"d35eda0a",2821:"7e574346",3207:"a11e6996",3490:"026802f4",3624:"a9a49a51",3815:"f87fc96a",4218:"0662e556",4250:"77e8e6c6",4616:"0d0b0873",4802:"a8b2857c",4981:"61cf4b0a",5480:"23265b76",5490:"6bdf311d",5668:"52bf4eef",5742:"2f625fe1",5750:"ebf2fdd5",5901:"f6ccb00b",5955:"14464ff3",5996:"b2d1663e",6152:"a3757d4b",6190:"a397b62a",6235:"fd7e64ec",6241:"a1fa513c",6319:"9020eb44",6366:"0c77f825",6567:"08800141",6919:"ca722922",6976:"1fce6090",6992:"eb4cc2ed",7098:"9fea9356",7465:"7e0b8008",7592:"d6165eff",7873:"083fcc2e",7928:"5f633e47",8142:"5edfc34d",8186:"7da8ea5b",8249:"4f81048e",8401:"afd63cb1",8565:"6a562290",8615:"33b6f886",8617:"ae58055a",8731:"4bc22343",8756:"74d5516d",9026:"4baa8196",9032:"f4369ef2",9048:"fa9eaf65",9172:"88a60d4e",9412:"ca1dda85",9510:"81e2df6a",9532:"9fafa665",9647:"d28d5273"}[e]+".js",d.miniCssF=e=>{},d.o=(e,a)=>Object.prototype.hasOwnProperty.call(e,a),t={},f="openrag-docs:",d.l=(e,a,r,c)=>{if(t[e])t[e].push(a);else{var o,b;if(void 0!==r)for(var n=document.getElementsByTagName("script"),i=0;i{o.onerror=o.onload=null,clearTimeout(s);var f=t[e];if(delete t[e],o.parentNode&&o.parentNode.removeChild(o),f&&f.forEach(e=>e(r)),a)return a(r)},s=setTimeout(u.bind(null,void 0,{type:"timeout",target:o}),12e4);o.onerror=u.bind(null,o.onerror),o.onload=u.bind(null,o.onload),b&&document.head.appendChild(o)}},d.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},d.p="/",d.gca=function(e){return e={17896441:"8401",33362219:"9532",52896773:"6152",af920ffe:"98","0ba6a408":"571","21afe7ac":"961","22dd74f7":"1567","749371cc":"2272",eb5b356a:"2668","27b4a875":"3207","71478a5d":"5490",c5b64a02:"5668",aba21aa0:"5742",d0314b07:"5750","7b5e550f":"6190","915a24fd":"6235",ca2c3c0c:"6919","4ba45368":"6976",a7bd4aaa:"7098","03ef5215":"8186",ae242f53:"8615","441f609b":"8617",c8078f0a:"9026",a94703ab:"9048",e633a5ea:"9172","5e95c892":"9647"}[e]||e,d.p+d.u(e)},(()=>{var e={5354:0,1869:0};d.f.j=(a,r)=>{var t=d.o(e,a)?e[a]:void 0;if(0!==t)if(t)r.push(t[2]);else if(/^(1869|5354)$/.test(a))e[a]=0;else{var f=new Promise((r,f)=>t=e[a]=[r,f]);r.push(t[2]=f);var c=d.p+d.u(a),o=new Error;d.l(c,r=>{if(d.o(e,a)&&(0!==(t=e[a])&&(e[a]=void 0),t)){var f=r&&("load"===r.type?"missing":r.type),c=r&&r.target&&r.target.src;o.message="Loading chunk "+a+" failed.\n("+f+": "+c+")",o.name="ChunkLoadError",o.type=f,o.request=c,t[1](o)}},"chunk-"+a,a)}},d.O.j=a=>0===e[a];var a=(a,r)=>{var t,f,[c,o,b]=r,n=0;if(c.some(a=>0!==e[a])){for(t in o)d.o(o,t)&&(d.m[t]=o[t]);if(b)var i=b(d)}for(a&&a(r);n{"use strict";var e,a,r,t,f,c={},o={};function d(e){var a=o[e];if(void 0!==a)return a.exports;var r=o[e]={exports:{}};return c[e].call(r.exports,r,r.exports,d),r.exports}d.m=c,e=[],d.O=(a,r,t,f)=>{if(!r){var c=1/0;for(i=0;i=f)&&Object.keys(d.O).every(e=>d.O[e](r[b]))?r.splice(b--,1):(o=!1,f0&&e[i-1][2]>f;i--)e[i]=e[i-1];e[i]=[r,t,f]},d.n=e=>{var a=e&&e.__esModule?()=>e.default:()=>e;return d.d(a,{a:a}),a},r=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,d.t=function(e,t){if(1&t&&(e=this(e)),8&t)return e;if("object"==typeof e&&e){if(4&t&&e.__esModule)return e;if(16&t&&"function"==typeof e.then)return e}var f=Object.create(null);d.r(f);var c={};a=a||[null,r({}),r([]),r(r)];for(var o=2&t&&e;("object"==typeof o||"function"==typeof o)&&!~a.indexOf(o);o=r(o))Object.getOwnPropertyNames(o).forEach(a=>c[a]=()=>e[a]);return c.default=()=>e,d.d(f,c),f},d.d=(e,a)=>{for(var r in a)d.o(a,r)&&!d.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:a[r]})},d.f={},d.e=e=>Promise.all(Object.keys(d.f).reduce((a,r)=>(d.f[r](e,a),a),[])),d.u=e=>"assets/js/"+({98:"af920ffe",571:"0ba6a408",961:"21afe7ac",1567:"22dd74f7",2272:"749371cc",2668:"eb5b356a",3207:"27b4a875",5490:"71478a5d",5668:"c5b64a02",5742:"aba21aa0",5750:"d0314b07",6152:"52896773",6190:"7b5e550f",6235:"915a24fd",6919:"ca2c3c0c",6976:"4ba45368",7098:"a7bd4aaa",8186:"03ef5215",8401:"17896441",8615:"ae242f53",8617:"441f609b",9026:"c8078f0a",9048:"a94703ab",9172:"e633a5ea",9532:"33362219",9647:"5e95c892"}[e]||e)+"."+{98:"5a239774",165:"7b1d067d",291:"1b64972f",571:"efa6fc46",617:"e8fa27b8",961:"b1bb0884",1e3:"f9af7a41",1203:"b618bb61",1567:"7a0edff6",1741:"b927934f",1746:"1ce4b99b",2130:"09232a19",2237:"70c48bab",2272:"774b6a0c",2279:"44341cb1",2291:"2753844f",2325:"7c4239a7",2334:"6d98e48e",2492:"e6c78669",2668:"d35eda0a",2821:"7e574346",3207:"5585873a",3490:"026802f4",3624:"a9a49a51",3815:"f87fc96a",4218:"0662e556",4250:"77e8e6c6",4616:"0d0b0873",4802:"a8b2857c",4981:"61cf4b0a",5480:"23265b76",5490:"6bdf311d",5668:"52bf4eef",5742:"2f625fe1",5750:"ebf2fdd5",5901:"f6ccb00b",5955:"14464ff3",5996:"b2d1663e",6152:"a3757d4b",6190:"a397b62a",6235:"fd7e64ec",6241:"a1fa513c",6319:"9020eb44",6366:"0c77f825",6567:"08800141",6919:"039bf965",6976:"1fce6090",6992:"eb4cc2ed",7098:"9fea9356",7465:"7e0b8008",7592:"d6165eff",7873:"083fcc2e",7928:"5f633e47",8142:"5edfc34d",8186:"7da8ea5b",8249:"4f81048e",8401:"afd63cb1",8565:"6a562290",8615:"33b6f886",8617:"ae58055a",8731:"4bc22343",8756:"74d5516d",9026:"4baa8196",9032:"f4369ef2",9048:"fa9eaf65",9172:"88a60d4e",9412:"ca1dda85",9510:"81e2df6a",9532:"9fafa665",9647:"d28d5273"}[e]+".js",d.miniCssF=e=>{},d.o=(e,a)=>Object.prototype.hasOwnProperty.call(e,a),t={},f="openrag-docs:",d.l=(e,a,r,c)=>{if(t[e])t[e].push(a);else{var o,b;if(void 0!==r)for(var n=document.getElementsByTagName("script"),i=0;i{o.onerror=o.onload=null,clearTimeout(s);var f=t[e];if(delete t[e],o.parentNode&&o.parentNode.removeChild(o),f&&f.forEach(e=>e(r)),a)return a(r)},s=setTimeout(u.bind(null,void 0,{type:"timeout",target:o}),12e4);o.onerror=u.bind(null,o.onerror),o.onload=u.bind(null,o.onload),b&&document.head.appendChild(o)}},d.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},d.p="/",d.gca=function(e){return e={17896441:"8401",33362219:"9532",52896773:"6152",af920ffe:"98","0ba6a408":"571","21afe7ac":"961","22dd74f7":"1567","749371cc":"2272",eb5b356a:"2668","27b4a875":"3207","71478a5d":"5490",c5b64a02:"5668",aba21aa0:"5742",d0314b07:"5750","7b5e550f":"6190","915a24fd":"6235",ca2c3c0c:"6919","4ba45368":"6976",a7bd4aaa:"7098","03ef5215":"8186",ae242f53:"8615","441f609b":"8617",c8078f0a:"9026",a94703ab:"9048",e633a5ea:"9172","5e95c892":"9647"}[e]||e,d.p+d.u(e)},(()=>{var e={5354:0,1869:0};d.f.j=(a,r)=>{var t=d.o(e,a)?e[a]:void 0;if(0!==t)if(t)r.push(t[2]);else if(/^(1869|5354)$/.test(a))e[a]=0;else{var f=new Promise((r,f)=>t=e[a]=[r,f]);r.push(t[2]=f);var c=d.p+d.u(a),o=new Error;d.l(c,r=>{if(d.o(e,a)&&(0!==(t=e[a])&&(e[a]=void 0),t)){var f=r&&("load"===r.type?"missing":r.type),c=r&&r.target&&r.target.src;o.message="Loading chunk "+a+" failed.\n("+f+": "+c+")",o.name="ChunkLoadError",o.type=f,o.request=c,t[1](o)}},"chunk-"+a,a)}},d.O.j=a=>0===e[a];var a=(a,r)=>{var t,f,[c,o,b]=r,n=0;if(c.some(a=>0!==e[a])){for(t in o)d.o(o,t)&&(d.m[t]=o[t]);if(b)var i=b(d)}for(a&&a(r);n Chat in OpenRAG | OpenRAG - + @@ -25,11 +25,11 @@ When you inspect this flow, you can edit the components to customize the agent&#

OpenRAG Open Search Agent Flow

  • -

    Chat Input component: This component starts the flow when it receives a chat message. It is connected to the Agent component's Input port. +

    Chat Input component: This component starts the flow when it receives a chat message. It is connected to the Agent component's Input port. When you use the OpenRAG Chat, your chat messages are passed to the Chat Input component, which then sends them to the Agent component for processing.

  • -

    Agent component: This component orchestrates the entire flow by processing chat messages, searching the knowledge base, and organizing the retrieved information into a cohesive response. +

    Agent component: This component orchestrates the entire flow by processing chat messages, searching the knowledge base, and organizing the retrieved information into a cohesive response. The agent's general behavior is defined by the prompt in the Agent Instructions field and the model connected to the Language Model port. One or more specialized tools can be attached to the Tools port to extend the agent's capabilities. In this case, there are two tools: MCP Tools and OpenSearch.

    The Agent component is the star of this flow because it powers decision making, tool calling, and an LLM-driven conversational experience.

    @@ -51,11 +51,11 @@ This flow fetches content from URLs, and then stores the content in your OpenRAG

    It is critical that the embedding model used here matches the embedding model used when you upload documents to your knowledge base. Mismatched models and dimensions can degrade the quality of similarity search results causing the agent to retrieve irrelevant documents from your knowledge base.

  • -

    Text Input component: Connected to the OpenSearch component's Search Filters port, this component is populated with a Langflow global variable named OPENRAG-QUERY-FILTER. If a global or chat-level knowledge filter is set, then the variable contains the filter expression, which limits the documents that the agent can access in the knowledge base. +

    Text Input component: Connected to the OpenSearch component's Search Filters port, this component is populated with a Langflow global variable named OPENRAG-QUERY-FILTER. If a global or chat-level knowledge filter is set, then the variable contains the filter expression, which limits the documents that the agent can access in the knowledge base. If no knowledge filter is set, then the OPENRAG-QUERY-FILTER variable is empty, and the agent can access all documents in the knowledge base.

  • -

    Chat Output component: Connected to the Agent component's Output port, this component returns the agent's generated response as a chat message.

    +

    Chat Output component: Connected to the Agent component's Output port, this component returns the agent's generated response as a chat message.

Nudges

@@ -107,7 +107,7 @@ This key doesn't grant access to OpenRAG; it is only for authenticating wit

If the request is successful, the response includes many details about the flow run, including the session ID, inputs, outputs, components, durations, and more.

In production, you won't pass the raw response to the user in its entirety. -Instead, you extract and reformat relevant fields for different use cases, as demonstrated in the Langflow quickstart. +Instead, you extract and reformat relevant fields for different use cases, as demonstrated in the Langflow quickstart. For example, you could pass the chat output text to a front-end user-facing application, and store specific fields in logs and backend data stores for monitoring, chat history, or analytics. You could also pass the output from one flow as input to another flow.