openrag/assets/js/71478a5d.d81ec55b.js
2026-01-17 00:29:31 +00:00

1 line
No EOL
9.5 KiB
JavaScript

"use strict";(globalThis.webpackChunkopenrag_docs=globalThis.webpackChunkopenrag_docs||[]).push([[5490],{6195:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>c,contentTitle:()=>d,default:()=>f,frontMatter:()=>a,metadata:()=>s,toc:()=>h});const s=JSON.parse('{"id":"core-components/knowledge-filters","title":"Filter knowledge","description":"OpenRAG\'s knowledge filters help you organize and manage your knowledge base by creating pre-defined views of your documents.","source":"@site/docs/core-components/knowledge-filters.mdx","sourceDirName":"core-components","slug":"/knowledge-filters","permalink":"/knowledge-filters","draft":false,"unlisted":false,"editUrl":"https://github.com/openrag/openrag/tree/main/docs/docs/core-components/knowledge-filters.mdx","tags":[],"version":"current","frontMatter":{"title":"Filter knowledge","slug":"/knowledge-filters"},"sidebar":"tutorialSidebar","previous":{"title":"Ingest knowledge","permalink":"/ingestion"},"next":{"title":"Chat","permalink":"/chat"}}');var r=t(4848),i=t(8453),l=t(9179),o=t(6567);const a={title:"Filter knowledge",slug:"/knowledge-filters"},d=void 0,c={},h=[{value:"Built-in filters",id:"built-in-filters",level:2},{value:"Create a filter",id:"create-a-filter",level:2},...o.RM,{value:"Edit a filter",id:"edit-a-filter",level:2},{value:"Apply a filter",id:"apply-a-filter",level:2},{value:"Delete a filter",id:"delete-a-filter",level:2}];function u(e){const n={a:"a",code:"code",h2:"h2",li:"li",ol:"ol",p:"p",strong:"strong",ul:"ul",...(0,i.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(n.p,{children:["OpenRAG's knowledge filters help you organize and manage your ",(0,r.jsx)(n.a,{href:"/knowledge",children:"knowledge base"})," by creating pre-defined views of your documents."]}),"\n",(0,r.jsx)(n.p,{children:"Each knowledge filter captures a specific subset of documents based on given a search query and filters."}),"\n",(0,r.jsx)(n.p,{children:"Knowledge filters can be used with different OpenRAG functionality.\nFor example, knowledge filters can help agents access large knowledge bases efficiently by narrowing the scope of documents that you want the agent to use."}),"\n",(0,r.jsx)(n.h2,{id:"built-in-filters",children:"Built-in filters"}),"\n",(0,r.jsxs)(n.p,{children:["When you install OpenRAG, it automatically creates an ",(0,r.jsx)(n.strong,{children:"OpenRAG docs"})," filter that includes OpenRAG's default documents.\nThese documents provide information about OpenRAG itself and help you learn how to use OpenRAG."]}),"\n",(0,r.jsxs)(n.p,{children:["When you use the OpenRAG ",(0,r.jsx)(l.A,{name:"MessageSquare","aria-hidden":"true"})," ",(0,r.jsx)(n.strong,{children:"Chat"}),", ",(0,r.jsxs)(n.a,{href:"#apply-a-filter",children:["apply the ",(0,r.jsx)(n.strong,{children:"OpenRAG docs"})," filter"]})," if you want to ask questions about OpenRAG's features and functionality.\nThis limits the agent's context to the default OpenRAG documentation rather than all documents in your knowledge base."]}),"\n",(0,r.jsx)(n.p,{children:"After uploading your own documents, it is recommended that you create your own filters to organize your documents effectively and separate them from the default OpenRAG documents."}),"\n",(0,r.jsx)(n.h2,{id:"create-a-filter",children:"Create a filter"}),"\n",(0,r.jsx)(n.p,{children:"To create a knowledge filter, do the following:"}),"\n",(0,r.jsxs)(n.ol,{children:["\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Click ",(0,r.jsx)(l.A,{name:"Library","aria-hidden":"true"})," ",(0,r.jsx)(n.strong,{children:"Knowledge"}),", and then click ",(0,r.jsx)(l.A,{name:"Plus","aria-hidden":"true"})," ",(0,r.jsx)(n.strong,{children:"Knowledge Filters"}),"."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Enter a ",(0,r.jsx)(n.strong,{children:"Name"}),"."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsx)(n.p,{children:"Optional: Click the filter icon next to the filter name to select a different icon and color for the filter.\nThis is purely cosmetic, but it can help you visually distinguish different sets of filters, such as different projects or sources."}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Optional: Enter a ",(0,r.jsx)(n.strong,{children:"Description"}),"."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsx)(n.p,{children:"Customize the filter settings."}),"\n",(0,r.jsx)(n.p,{children:"By default, filters match all documents in your knowledge base.\nUse the filter settings to narrow the scope of documents that the filter captures:"}),"\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:"Search Query"}),": Enter a natural language text string for semantic search."]}),"\n",(0,r.jsxs)(n.p,{children:["When you apply a filter that has a ",(0,r.jsx)(n.strong,{children:"Search Query"}),", only documents matching the search query are included.\nIt is recommended that you also use the ",(0,r.jsx)(n.strong,{children:"Score Threshold"})," setting to avoid returning irrelevant documents."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.strong,{children:"Data Sources"}),": Select specific files and folders to include in the filter."]}),"\n",(0,r.jsx)(n.p,{children:"This is useful if you want to create a filter for a specific project or topic and you know the specific documents you want to include.\nSimilarly, if you upload a folder of documents or enable an OAuth connector, you might want to create a filter that only includes the documents from that source."}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.strong,{children:"Document Types"}),": Filter by file type."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.strong,{children:"Owners"}),": Filter by the user that uploaded the documents."]}),"\n",(0,r.jsx)(o.Ay,{}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.strong,{children:"Connectors"}),": Filter by ",(0,r.jsx)(n.a,{href:"/ingestion",children:"upload source"}),", such as the local file system or an OAuth connector."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.strong,{children:"Response Limit"}),": Set the maximum number of results to return from the knowledge base. The default is ",(0,r.jsx)(n.code,{children:"10"}),", which means the filter returns only the top 10 most relevant documents."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.strong,{children:"Score Threshold"}),": Set the minimum relevance score for similarity search. The default score is ",(0,r.jsx)(n.code,{children:"0"}),". A threshold is recommended to avoid returned irrelevant documents."]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Click ",(0,r.jsx)(n.strong,{children:"Create Filter"}),"."]}),"\n"]}),"\n"]}),"\n",(0,r.jsx)(n.h2,{id:"edit-a-filter",children:"Edit a filter"}),"\n",(0,r.jsxs)(n.p,{children:["To modify a filter, click ",(0,r.jsx)(l.A,{name:"Library","aria-hidden":"true"})," ",(0,r.jsx)(n.strong,{children:"Knowledge"}),", and then click the filter you want to edit in the ",(0,r.jsx)(n.strong,{children:"Knowledge Filters"})," list.\nOn the filter settings pane, edit the filter as desired, and then click ",(0,r.jsx)(n.strong,{children:"Update Filter"}),"."]}),"\n",(0,r.jsx)(n.h2,{id:"apply-a-filter",children:"Apply a filter"}),"\n",(0,r.jsxs)(n.p,{children:["In the OpenRAG ",(0,r.jsx)(l.A,{name:"MessageSquare","aria-hidden":"true"})," ",(0,r.jsx)(n.strong,{children:"Chat"}),", click ",(0,r.jsx)(l.A,{name:"Funnel","aria-hidden":"true"})," ",(0,r.jsx)(n.strong,{children:"Filter"}),", and then select the filter to apply.\nChat filters apply to one chat session only."]}),"\n",(0,r.jsxs)(n.p,{children:["You can also use filters when ",(0,r.jsx)(n.a,{href:"/knowledge#browse-knowledge",children:"browsing your knowledge base"}),".\nThis is a helpful way to test filters and manage knowledge bases that have many documents."]}),"\n",(0,r.jsx)(n.h2,{id:"delete-a-filter",children:"Delete a filter"}),"\n",(0,r.jsxs)(n.ol,{children:["\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Click ",(0,r.jsx)(l.A,{name:"Library","aria-hidden":"true"})," ",(0,r.jsx)(n.strong,{children:"Knowledge"}),"."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["In the ",(0,r.jsx)(n.strong,{children:"Knowledge Filters"})," list, click the filter that you want to delete."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["In the filter settings pane, click ",(0,r.jsx)(n.strong,{children:"Delete Filter"}),"."]}),"\n"]}),"\n"]})]})}function f(e={}){const{wrapper:n}={...(0,i.R)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(u,{...e})}):u(e)}},6567:(e,n,t)=>{t.d(n,{Ay:()=>o,RM:()=>i});var s=t(4848),r=t(8453);const i=[];function l(e){const n={a:"a",p:"p",strong:"strong",...(0,r.R)(),...e.components};return(0,s.jsxs)(n.p,{children:["In no-auth mode, all documents are attributed to ",(0,s.jsx)(n.strong,{children:"Anonymous User"})," because there is no distinct document ownership or unique JWTs. For more control over document ownership and visibility, use OAuth mode. For more information, see ",(0,s.jsx)(n.a,{href:"/knowledge#auth",children:"OpenSearch authentication and document access"}),"."]})}function o(e={}){const{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(l,{...e})}):l(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}}}]);