openrag/assets/js/ca2c3c0c.7eb785b4.js
2025-10-12 18:09:42 +00:00

1 line
No EOL
12 KiB
JavaScript

"use strict";(self.webpackChunkopenrag_docs=self.webpackChunkopenrag_docs||[]).push([[919],{3782:(e,n,s)=>{s.d(n,{Ay:()=>l,RM:()=>r});var o=s(4848),t=s(8453),i=s(9179);const r=[];function c(e){const n={a:"a",p:"p",strong:"strong",...(0,t.R)(),...e.components};return(0,o.jsxs)(n.p,{children:["All flows included with OpenRAG are designed to be modular, performant, and provider-agnostic.\nTo modify a flow, click ",(0,o.jsx)(i.A,{name:"Settings2","aria-hidden":"true"})," ",(0,o.jsx)(n.strong,{children:"Settings"}),", and click ",(0,o.jsx)(n.strong,{children:"Edit in Langflow"}),".\nOpenRAG's visual editor is based on the ",(0,o.jsx)(n.a,{href:"https://docs.langflow.org/concepts-overview",children:"Langflow visual editor"}),", so you can edit your flows to match your specific use case."]})}function l(e={}){const{wrapper:n}={...(0,t.R)(),...e.components};return n?(0,o.jsx)(n,{...e,children:(0,o.jsx)(c,{...e})}):c(e)}},7125:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>a,contentTitle:()=>l,default:()=>g,frontMatter:()=>c,metadata:()=>o,toc:()=>d});const o=JSON.parse('{"id":"core-components/ingestion","title":"Docling Ingestion","description":"OpenRAG uses Docling for its document ingestion pipeline.","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":"Docling Ingestion","slug":"/ingestion"},"sidebar":"tutorialSidebar","previous":{"title":"OpenSearch Knowledge","permalink":"/knowledge"},"next":{"title":"Environment variables","permalink":"/reference/configuration"}}');var t=s(4848),i=s(8453),r=(s(9179),s(1470),s(9365),s(3782));const c={title:"Docling Ingestion",slug:"/ingestion"},l=void 0,a={},d=[{value:"Docling ingestion settings",id:"docling-ingestion-settings",level:2},{value:"Use OpenRAG default ingestion instead of Docling serve",id:"use-openrag-default-ingestion-instead-of-docling-serve",level:2},{value:"Knowledge ingestion flows",id:"knowledge-ingestion-flows",level:2},...r.RM,{value:"OpenSearch URL Ingestion flow",id:"url-flow",level:3}];function h(e){const n={a:"a",br:"br",code:"code",h2:"h2",h3:"h3",li:"li",p:"p",strong:"strong",ul:"ul",...(0,i.R)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(n.p,{children:["OpenRAG uses ",(0,t.jsx)(n.a,{href:"https://docling-project.github.io/docling/",children:"Docling"})," for its document ingestion pipeline.\nMore specifically, OpenRAG uses ",(0,t.jsx)(n.a,{href:"https://github.com/docling-project/docling-serve",children:"Docling Serve"}),", which starts a ",(0,t.jsx)(n.code,{children:"docling serve"})," process on your local machine and runs Docling ingestion through an API service."]}),"\n",(0,t.jsxs)(n.p,{children:["Docling ingests documents from your local machine or OAuth connectors, splits them into chunks, and stores them as separate, structured documents in the OpenSearch ",(0,t.jsx)(n.code,{children:"documents"})," index."]}),"\n",(0,t.jsx)(n.p,{children:"OpenRAG chose Docling for its support for a wide variety of file formats, high performance, and advanced understanding of tables and images."}),"\n",(0,t.jsx)(n.h2,{id:"docling-ingestion-settings",children:"Docling ingestion settings"}),"\n",(0,t.jsx)(n.p,{children:"These settings configure the Docling ingestion parameters."}),"\n",(0,t.jsxs)(n.p,{children:["OpenRAG will warn you if ",(0,t.jsx)(n.code,{children:"docling serve"})," is not running.\nTo start or stop ",(0,t.jsx)(n.code,{children:"docling serve"})," or any other native services, in the TUI main menu, click ",(0,t.jsx)(n.strong,{children:"Start Native Services"})," or ",(0,t.jsx)(n.strong,{children:"Stop Native Services"}),"."]}),"\n",(0,t.jsxs)(n.p,{children:[(0,t.jsx)(n.strong,{children:"Embedding model"})," determines which AI model is used to create vector embeddings. The default is ",(0,t.jsx)(n.code,{children:"text-embedding-3-small"}),"."]}),"\n",(0,t.jsxs)(n.p,{children:[(0,t.jsx)(n.strong,{children:"Chunk size"})," determines how large each text chunk is in number of characters.\nLarger chunks yield more context per chunk, but may include irrelevant information. Smaller chunks yield more precise semantic search, but may lack context.\nThe default value of ",(0,t.jsx)(n.code,{children:"1000"})," characters provides a good starting point that balances these considerations."]}),"\n",(0,t.jsxs)(n.p,{children:[(0,t.jsx)(n.strong,{children:"Chunk overlap"})," controls the number of characters that overlap over chunk boundaries.\nUse larger overlap values for documents where context is most important, and use smaller overlap values for simpler documents, or when optimization is most important.\nThe default value of 200 characters of overlap with a chunk size of 1000 (20% overlap) is suitable for general use cases. Decrease the overlap to 10% for a more efficient pipeline, or increase to 40% for more complex documents."]}),"\n",(0,t.jsxs)(n.p,{children:[(0,t.jsx)(n.strong,{children:"OCR"})," enables or disabled OCR processing when extracting text from images and scanned documents.\nOCR is disabled by default. This setting is best suited for processing text-based documents as quickly as possible with Docling's ",(0,t.jsx)(n.a,{href:"https://docling-project.github.io/docling/reference/document_converter/",children:(0,t.jsx)(n.code,{children:"DocumentConverter"})}),". Images are ignored and not processed."]}),"\n",(0,t.jsx)(n.p,{children:"Enable OCR when you are processing documents containing images with text that requires extraction, or for scanned documents. Enabling OCR can slow ingestion performance."}),"\n",(0,t.jsxs)(n.p,{children:["If OpenRAG detects that the local machine is running on macOS, OpenRAG uses the ",(0,t.jsx)(n.a,{href:"https://www.piwheels.org/project/ocrmac/",children:"ocrmac"})," OCR engine. Other platforms use ",(0,t.jsx)(n.a,{href:"https://www.jaided.ai/easyocr/",children:"easyocr"}),"."]}),"\n",(0,t.jsxs)(n.p,{children:[(0,t.jsx)(n.strong,{children:"Picture descriptions"})," adds image descriptions generated by the ",(0,t.jsx)(n.a,{href:"https://huggingface.co/HuggingFaceTB/SmolVLM-Instruct",children:"SmolVLM-256M-Instruct"})," model to OCR processing. Enabling picture descriptions can slow ingestion performance."]}),"\n",(0,t.jsx)(n.h2,{id:"use-openrag-default-ingestion-instead-of-docling-serve",children:"Use OpenRAG default ingestion instead of Docling serve"}),"\n",(0,t.jsxs)(n.p,{children:["If you want to use OpenRAG's built-in pipeline instead of Docling serve, set ",(0,t.jsx)(n.code,{children:"DISABLE_INGEST_WITH_LANGFLOW=true"})," in ",(0,t.jsx)(n.a,{href:"/reference/configuration#document-processing",children:"Environment variables"}),"."]}),"\n",(0,t.jsx)(n.p,{children:"The built-in pipeline still uses the Docling processor, but uses it directly without the Docling Serve API."}),"\n",(0,t.jsxs)(n.p,{children:["For more information, see ",(0,t.jsxs)(n.a,{href:"https://github.com/langflow-ai/openrag/blob/main/src/models/processors.py#L58",children:[(0,t.jsx)(n.code,{children:"processors.py"})," in the OpenRAG repository"]}),"."]}),"\n",(0,t.jsx)(n.h2,{id:"knowledge-ingestion-flows",children:"Knowledge ingestion flows"}),"\n",(0,t.jsxs)(n.p,{children:[(0,t.jsx)(n.a,{href:"https://docs.langflow.org/concepts-overview",children:"Flows"})," in Langflow are functional representations of application workflows, with multiple ",(0,t.jsx)(n.a,{href:"https://docs.langflow.org/concepts-components",children:"component"})," nodes connected as single steps in a workflow."]}),"\n",(0,t.jsxs)(n.p,{children:["The ",(0,t.jsx)(n.strong,{children:"OpenSearch Ingestion"})," flow is the default knowledge ingestion flow in OpenRAG: when you ",(0,t.jsx)(n.strong,{children:"Add Knowledge"})," in OpenRAG, you run the OpenSearch Ingestion flow in the background. The flow ingests documents using ",(0,t.jsx)(n.strong,{children:"Docling Serve"})," to import and process documents."]}),"\n",(0,t.jsx)(n.p,{children:"This flow contains ten components connected together to process and store documents in your knowledge base."}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:["The ",(0,t.jsxs)(n.a,{href:"https://docs.langflow.org/bundles-docling",children:[(0,t.jsx)(n.strong,{children:"Docling Serve"})," component"]})," processes input documents by connecting to your instance of Docling Serve."]}),"\n",(0,t.jsxs)(n.li,{children:["The ",(0,t.jsxs)(n.a,{href:"https://docs.langflow.org/components-docling",children:[(0,t.jsx)(n.strong,{children:"Export DoclingDocument"})," component"]})," exports the processed DoclingDocument to markdown format with image export mode set to placeholder. This conversion makes the structured document data into a standardized format for further processing."]}),"\n",(0,t.jsxs)(n.li,{children:["Three ",(0,t.jsxs)(n.a,{href:"https://docs.langflow.org/components-processing#dataframe-operations",children:[(0,t.jsx)(n.strong,{children:"DataFrame Operations"})," components"]})," sequentially add metadata columns to the document data of ",(0,t.jsx)(n.code,{children:"filename"}),", ",(0,t.jsx)(n.code,{children:"file_size"}),", and ",(0,t.jsx)(n.code,{children:"mimetype"}),"."]}),"\n",(0,t.jsxs)(n.li,{children:["The ",(0,t.jsxs)(n.a,{href:"https://docs.langflow.org/components-processing#split-text",children:[(0,t.jsx)(n.strong,{children:"Split Text"})," component"]})," splits the processed text into chunks with a chunk size of 1000 characters and an overlap of 200 characters."]}),"\n",(0,t.jsxs)(n.li,{children:["Four ",(0,t.jsx)(n.strong,{children:"Secret Input"})," components provide secure access to configuration variables: ",(0,t.jsx)(n.code,{children:"CONNECTOR_TYPE"}),", ",(0,t.jsx)(n.code,{children:"OWNER"}),", ",(0,t.jsx)(n.code,{children:"OWNER_EMAIL"}),", and ",(0,t.jsx)(n.code,{children:"OWNER_NAME"}),". These are runtime variables populated from OAuth login."]}),"\n",(0,t.jsxs)(n.li,{children:["The ",(0,t.jsx)(n.strong,{children:"Create Data"})," component combines the secret inputs into a structured data object that will be associated with the document embeddings."]}),"\n",(0,t.jsxs)(n.li,{children:["The ",(0,t.jsxs)(n.a,{href:"https://docs.langflow.org/components-embedding-models",children:[(0,t.jsx)(n.strong,{children:"Embedding Model"})," component"]})," generates vector embeddings using OpenAI's ",(0,t.jsx)(n.code,{children:"text-embedding-3-small"})," model. The embedding model is selected at [Application onboarding] and cannot be changed."]}),"\n",(0,t.jsxs)(n.li,{children:["The ",(0,t.jsxs)(n.a,{href:"https://docs.langflow.org/bundles-elastic#opensearch",children:[(0,t.jsx)(n.strong,{children:"OpenSearch"})," component"]})," stores the processed documents and their embeddings in the ",(0,t.jsx)(n.code,{children:"documents"})," index at ",(0,t.jsx)(n.code,{children:"https://opensearch:9200"}),". By default, the component is authenticated with a JWT token, but you can also select ",(0,t.jsx)(n.code,{children:"basic"})," auth mode, and enter your OpenSearch admin username and password."]}),"\n"]}),"\n",(0,t.jsx)(r.Ay,{}),"\n",(0,t.jsx)(n.h3,{id:"url-flow",children:"OpenSearch URL Ingestion flow"}),"\n",(0,t.jsxs)(n.p,{children:["An additional knowledge ingestion flow is included in OpenRAG, where it is used as an MCP tool by the ",(0,t.jsx)(n.a,{href:"/agents#flow",children:(0,t.jsx)(n.strong,{children:"Open Search Agent flow"})}),".\nThe agent calls this component to fetch web content, and the results are ingested into OpenSearch."]}),"\n",(0,t.jsxs)(n.p,{children:["For more on using MCP clients in Langflow, see ",(0,t.jsx)(n.a,{href:"https://docs.langflow.org/mcp-client",children:"MCP clients"}),".",(0,t.jsx)(n.br,{}),"\n","To connect additional MCP servers to the MCP client, see ",(0,t.jsx)(n.a,{href:"https://docs.langflow.org/mcp-tutorial",children:"Connect to MCP servers from your application"}),"."]})]})}function g(e={}){const{wrapper:n}={...(0,i.R)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(h,{...e})}):h(e)}},9179:(e,n,s)=>{s.d(n,{A:()=>i});s(6540);var o=s(4827),t=s(4848);function i({name:e,...n}){const s=o[e];return s?(0,t.jsx)(s,{...n}):null}}}]);