Upload a local folder into a Knowledge Base while preserving its directory structure.
What this builds. A KB that mirrors a nested local folder — subfolders become KB folders, files become KB items.
You’ll end up with. A completed ingestion task whose KB layout matches the on-disk layout, verified by list_items.
"""Example 03: Upload a local folder, preserving directory structure.`kb.add_folder(...)` walks the local directory, builds a nested foldertree, and submits a single ingestion request. The KB layout will mirrorthe local layout.Requires the v1 ingestion task endpoints + folder-tree extension toKbIndexRequest (M2 [A2])."""import tempfilefrom pathlib import Pathfrom vectorshift.knowledge_base import KnowledgeBase# Build a small nested folderwith tempfile.TemporaryDirectory() as tmp: root = Path(tmp) / "handbook" (root / "policies").mkdir(parents=True) (root / "policies" / "pto.md").write_text("# PTO\n\n- 20 days/yr\n") (root / "policies" / "remote.md").write_text("# Remote\n\nWFH OK.\n") (root / "engineering").mkdir() (root / "engineering" / "oncall.md").write_text("# Oncall\n\nWeekly rotation.\n") (root / "README.md").write_text("# Handbook\n\nWelcome.\n") kb = KnowledgeBase.new(name="SDK folder demo") print(f"1. Created KB id={kb.id}") final = kb.add_folder_and_wait(root, timeout=180) print( f"2. Folder ingest completed: status={final.status} " f"items={len(final.item_ids)}" ) # List items to confirm folder hierarchy is preserved items = kb.list_items(limit=50) print(f"3. Items in KB: {len(items)}") kb.delete() print("4. Deleted KB.")
Expected output
1. Created KB id=...2. Folder ingest completed: status=... items=43. Items in KB: 44. Deleted KB.
The walk produces a single ingestion request — not one per file — so very large trees stay fast.
See also
Add files
Ingest individual files instead of a whole tree.
Items and folders
Manage the items and folders after ingestion.
KB reference
Every public method.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"VectorShift","colors":{"primary":"#6366f1","light":"#818cf8","dark":"#4f46e5"},"logo":{"light":"https://mintcdn.com/vectorshift/ko1lD3nuBSgpmLV4/logo/vectorshift-logo.png?fit=max\u0026auto=format\u0026n=ko1lD3nuBSgpmLV4\u0026q=85\u0026s=0b909e21221badbcd2332ad0c7b06a8e","dark":"https://mintcdn.com/vectorshift/ko1lD3nuBSgpmLV4/logo/vectorshift-logo.png?fit=max\u0026auto=format\u0026n=ko1lD3nuBSgpmLV4\u0026q=85\u0026s=0b909e21221badbcd2332ad0c7b06a8e"},"favicon":"https://mintcdn.com/vectorshift/PSG1OGMwi51Mi0EL/android-chrome-512x512.png?fit=max\u0026auto=format\u0026n=PSG1OGMwi51Mi0EL\u0026q=85\u0026s=1a5016324923f89a576a8696462ef07e","appearance":{"default":"system","strict":false},"navbar":{"links":[{"href":"/support","label":"Support"},{"href":"https://app.vectorshift.ai/account/api-keys","label":"API Keys"}],"primary":{"type":"button","label":"Platform","href":"https://app.vectorshift.ai"}},"footer":{"socials":{"x":"https://x.com/vectorshiftai","linkedin":"https://linkedin.com/company/vectorshift"}},"search":{"prompt":"Search the SDK, API, and platform docs…"},"seo":{"metatags":{"og:image":"/logo/vectorshift-logo.png"},"indexing":"navigable"},"icons":{"library":"lucide"},"styling":{"codeblocks":{"languages":{}},"latex":true},"contextual":{"options":["copy","view","chatgpt","claude","aistudio","perplexity"],"display":"header"},"navigation":{"global":{"anchors":[{"anchor":"Book a Demo","icon":"calendar","href":"https://calendly.com/albert_mao/vectorshift-intro-chat"},{"anchor":"Changelog","icon":"history","href":"https://vectorshift.ai/blog?tag=changelog"},{"anchor":"Blog","icon":"newspaper","href":"https://vectorshift.ai/blog"},{"anchor":"Tutorials","icon":"youtube","href":"https://www.youtube.com/@VectorShiftAI"}]},"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"vectorshift","hasAudioNarration":false,"actualSubdomain":"vectorshift","customDomains":["docs.vectorshift.ai"],"gitSource":{"type":"github","owner":"vectorshift","repo":"docs","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"entitlements":{"AI_CHAT":{"status":"DISABLED"}},"buildId":"6ae91d0add662a242ab77468:success","clientVersion":"0.0.4270","searchFilterCounts":[{"language":"default","tag":"SDK","count":136},{"language":"default","tag":"Documentation","count":124},{"language":"default","tag":"Examples","count":84},{"language":"default","tag":"Nodes","count":65},{"language":"default","tag":"Platform","count":61},{"language":"default","tag":"Pipeline","count":38},{"language":"default","tag":"API Reference","count":30},{"language":"default","tag":"Agent","count":27},{"language":"default","tag":"Knowledge Base","count":24},{"language":"default","tag":"Interfaces","count":20}]},"assistantConfig":{},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-rbac-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"site-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"starter-pricing","enabled":true,"variant":{"name":"control","enabled":true,"payload":{"type":"string","value":"control"},"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"wildcard-email-auth","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[{"filePath":"style.css","content":"@media (min-width: 1024px){.hidden.xl\\:flex{display:flex!important}div.z-10.hidden:has(>div.xl\\:flex){display:block!important}}"}]}
{"page":{"pagePath":"sdk/knowledge-base/examples/add-folder","slug":"/sdk/knowledge-base/examples/add-folder","pageMetadata":{"title":"Add folder","description":"Upload a local folder into a Knowledge Base while preserving its directory structure.","href":"/sdk/knowledge-base/examples/add-folder"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Upload a local folder into a Knowledge Base while preserving its directory structure.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={code:`code`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,..._provideComponents(),...props.components},{Card,CodeBlock,Columns,Heading}=_components;if(!Card)_missingMdxReference(`Card`,true);if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Columns)_missingMdxReference(`Columns`,true);if(!Heading)_missingMdxReference(`Heading`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`What this builds.`}),` A KB that mirrors a nested local folder — subfolders become KB folders, files become KB items.\n`,_jsx(_components.strong,{children:`You’ll end up with.`}),` A completed ingestion task whose KB layout matches the on-disk layout, verified by `,_jsx(_components.code,{children:`list_items`}),`.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`41`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`41`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"\"\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`Example 03: Upload a local folder, preserving directory structure.`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"`kb.add_folder(...)` walks the local directory, builds a nested folder\"})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`tree, and submits a single ingestion request. The KB layout will mirror`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`the local layout.`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`Requires the v1 ingestion task endpoints + folder-tree extension to`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`KbIndexRequest (M2 [A2]).`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"\"\"`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` tempfile`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` pathlib `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` Path`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` vectorshift.knowledge_base `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` KnowledgeBase`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# Build a small nested folder`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`with`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` tempfile.TemporaryDirectory() `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`as`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` tmp:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` root `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` Path(tmp) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`/`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"handbook\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (root `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`/`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"policies\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`).mkdir(`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`parents`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`True`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (root `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`/`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"policies\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` /`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"pto.md\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`).write_text(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"# PTO`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:`\\\\n\\\\n`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`- 20 days/yr`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:`\\\\n`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (root `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`/`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"policies\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` /`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"remote.md\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`).write_text(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"# Remote`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:`\\\\n\\\\n`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`WFH OK.`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:`\\\\n`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (root `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`/`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"engineering\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`).mkdir()`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (root `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`/`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"engineering\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` /`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"oncall.md\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`).write_text(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"# Oncall`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:`\\\\n\\\\n`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`Weekly rotation.`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:`\\\\n`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (root `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`/`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"README.md\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`).write_text(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"# Handbook`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:`\\\\n\\\\n`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`Welcome.`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:`\\\\n`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` kb `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` KnowledgeBase.new(`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`name`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"SDK folder demo\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:` print`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`f`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"1. Created KB id=`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`{`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`kb.id`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` final `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` kb.add_folder_and_wait(root, `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`timeout`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`180`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:` print`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` f`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"2. Folder ingest completed: status=`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`{`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`final.status`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` f`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"items=`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`{`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`len`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(final.item_ids)`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` )`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` # List items to confirm folder hierarchy is preserved`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` items `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` kb.list_items(`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`limit`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`50`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:` print`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`f`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"3. Items in KB: `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`{`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`len`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(items)`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` kb.delete()`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:` print`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"4. Deleted KB.\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`expected-output`,children:`Expected output`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`5`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`5`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`1. Created KB id=...`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`2. Folder ingest completed: status=... items=4`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`3. Items in KB: 4`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`4. Deleted KB.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsx(_components.p,{children:`The walk produces a single ingestion request — not one per file — so very large trees stay fast.`}),`\n`,_jsx(Heading,{level:`2`,id:`see-also`,children:`See also`}),`\n`,_jsxs(Columns,{cols:3,children:[_jsx(Card,{title:`Add files`,icon:`file-plus`,href:`/sdk/knowledge-base/examples/add-files`,children:_jsx(_components.p,{children:`Ingest individual files instead of a whole tree.`})}),_jsx(Card,{title:`Items and folders`,icon:`list`,href:`/sdk/knowledge-base/examples/items-and-folders`,children:_jsx(_components.p,{children:`Manage the items and folders after ingestion.`})}),_jsx(Card,{title:`KB reference`,icon:`book-open`,href:`/sdk/knowledge-base/reference`,children:_jsx(_components.p,{children:`Every public method.`})})]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"codeStyling":{"languages":{}},"config":{},"pageMetadata":{"title":"Add folder","description":"Upload a local folder into a Knowledge Base while preserving its directory structure.","href":"/sdk/knowledge-base/examples/add-folder"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Expected output","slug":"expected-output","depth":2,"children":[]},{"title":"See also","slug":"see-also","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"subdomain":"vectorshift","siteName":"VectorShift","title":"Add folder - VectorShift","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-05-22T18:17:40.212Z","originalFileLocation":"sdk/knowledge-base/examples/add-folder.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Upload a local folder into a Knowledge Base while preserving its directory structure.\">\u003cmeta data-mint-head name=\"application-name\" content=\"VectorShift\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/vectorshift/TwRU3RaBNwnTjf5H/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/vectorshift/TwRU3RaBNwnTjf5H/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/vectorshift/TwRU3RaBNwnTjf5H/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/vectorshift/TwRU3RaBNwnTjf5H/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/vectorshift/TwRU3RaBNwnTjf5H/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/vectorshift/TwRU3RaBNwnTjf5H/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/vectorshift/TwRU3RaBNwnTjf5H/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/vectorshift/TwRU3RaBNwnTjf5H/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/vectorshift/TwRU3RaBNwnTjf5H/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Add folder - VectorShift\">\u003cmeta data-mint-head property=\"og:description\" content=\"Upload a local folder into a Knowledge Base while preserving its directory structure.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"VectorShift\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.vectorshift.ai/sdk/knowledge-base/examples/add-folder\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://vectorshift.mintlify.site/logo/vectorshift-logo.png\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Add folder - VectorShift\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Upload a local folder into a Knowledge Base while preserving its directory structure.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://vectorshift.mintlify.site/logo/vectorshift-logo.png\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/vectorshift/TwRU3RaBNwnTjf5H/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"VectorShift\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#6366f1\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.vectorshift.ai/sdk/knowledge-base/examples/add-folder\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/sdk/knowledge-base/examples/add-folder.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.vectorshift.ai/#organization\",\"name\":\"VectorShift\",\"url\":\"https://docs.vectorshift.ai\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/vectorshift/ko1lD3nuBSgpmLV4/logo/vectorshift-logo.png?fit=max\u0026auto=format\u0026n=ko1lD3nuBSgpmLV4\u0026q=85\u0026s=0b909e21221badbcd2332ad0c7b06a8e\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.vectorshift.ai#website\",\"name\":\"VectorShift\",\"url\":\"https://docs.vectorshift.ai\",\"publisher\":{\"@id\":\"https://docs.vectorshift.ai/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.vectorshift.ai/sdk/knowledge-base/examples/add-folder#webpage\",\"url\":\"https://docs.vectorshift.ai/sdk/knowledge-base/examples/add-folder\",\"name\":\"Add folder\",\"description\":\"Upload a local folder into a Knowledge Base while preserving its directory structure.\",\"dateModified\":\"2026-05-22T18:17:40.212Z\",\"isPartOf\":{\"@id\":\"https://docs.vectorshift.ai#website\"},\"breadcrumb\":{\"@id\":\"https://docs.vectorshift.ai/sdk/knowledge-base/examples/add-folder#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.vectorshift.ai/sdk/knowledge-base/examples/add-folder#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Knowledge Base\",\"item\":\"https://docs.vectorshift.ai/sdk/knowledge-base/overview\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Examples\",\"item\":\"https://docs.vectorshift.ai/sdk/knowledge-base/examples/kb-crud\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Add folder\",\"item\":\"https://docs.vectorshift.ai/sdk/knowledge-base/examples/add-folder\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.vectorshift.ai/sdk/knowledge-base/examples/add-folder#article\",\"headline\":\"Add folder\",\"name\":\"Add folder\",\"description\":\"Upload a local folder into a Knowledge Base while preserving its directory structure.\",\"url\":\"https://docs.vectorshift.ai/sdk/knowledge-base/examples/add-folder\",\"mainEntityOfPage\":{\"@id\":\"https://docs.vectorshift.ai/sdk/knowledge-base/examples/add-folder#webpage\"},\"image\":\"https://docs.vectorshift.ai/logo/vectorshift-logo.png\",\"dateModified\":\"2026-05-22T18:17:40.212Z\",\"publisher\":{\"@id\":\"https://docs.vectorshift.ai/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.vectorshift.ai#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"VectorShift\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"VectorShift\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/sdk/knowledge-base/examples/add-folder.md","siteName":"VectorShift","nav":{"global":{"anchors":[{"anchor":"Book a Demo","icon":"calendar","href":"https://calendly.com/albert_mao/vectorshift-intro-chat"},{"anchor":"Changelog","icon":"history","href":"https://vectorshift.ai/blog?tag=changelog"},{"anchor":"Blog","icon":"newspaper","href":"https://vectorshift.ai/blog"},{"anchor":"Tutorials","icon":"youtube","href":"https://www.youtube.com/@VectorShiftAI"}]},"tabs":[{"tab":"Documentation","pages":[{"title":"Documentation","href":"/introduction"}]},{"tab":"API Reference","pages":[{"title":"API Reference","href":"/api-reference/overview"}]},{"tab":"SDK","groups":[{"group":"Get started","pages":[{"title":"VectorShift Python SDK","sidebarTitle":"Overview","href":"/sdk"},{"title":"Installation","href":"/sdk/installation"},{"title":"Quickstart","href":"/sdk/quickstart"},{"title":"Authentication","href":"/sdk/authentication"},{"title":"Concepts","href":"/sdk/concepts"},{"title":"Errors","href":"/sdk/errors"},{"title":"Building with AI","href":"/sdk/building-with-ai"}]},{"group":"Guides","icon":"map","pages":[{"title":"RAG end-to-end","href":"/sdk/guides/rag-end-to-end"},{"title":"Customer support bot","href":"/sdk/guides/support-bot"},{"title":"Background batch jobs","href":"/sdk/guides/background-batch"},{"title":"Multi-step content workflow","href":"/sdk/guides/content-workflow"},{"title":"Integrations end-to-end","href":"/sdk/guides/integrations-end-to-end"}]},{"group":"Pipeline","icon":"workflow","pages":[{"title":"Pipeline overview","sidebarTitle":"Overview","href":"/sdk/pipeline/overview"},{"title":"Pipeline reference","sidebarTitle":"Reference","href":"/sdk/pipeline/reference"},{"group":"Nodes","pages":[{"title":"Start nodes","sidebarTitle":"Start","href":"/sdk/pipeline/nodes/start"},{"title":"General nodes","sidebarTitle":"General","href":"/sdk/pipeline/nodes/general"},{"title":"Large Language Models (LLMs) nodes","sidebarTitle":"Large Language Models (LLMs)","href":"/sdk/pipeline/nodes/llms"},{"title":"Knowledge nodes","sidebarTitle":"Knowledge","href":"/sdk/pipeline/nodes/knowledge"},{"title":"Data Loaders nodes","sidebarTitle":"Data Loaders","href":"/sdk/pipeline/nodes/data-loaders"},{"title":"Multi-Modal nodes","sidebarTitle":"Multi-Modal","href":"/sdk/pipeline/nodes/multi-modal"},{"title":"Logic nodes","sidebarTitle":"Logic","href":"/sdk/pipeline/nodes/logic"},{"title":"Data Transformation nodes","sidebarTitle":"Data Transformation","href":"/sdk/pipeline/nodes/data-transformation"},{"title":"Chat nodes","sidebarTitle":"Chat","href":"/sdk/pipeline/nodes/chat"},{"title":"Conversational nodes","sidebarTitle":"Conversational","href":"/sdk/pipeline/nodes/conversational"},{"title":"Integration nodes","sidebarTitle":"Integration","href":"/sdk/pipeline/nodes/integration"},{"title":"Triggers nodes","sidebarTitle":"Triggers","href":"/sdk/pipeline/nodes/triggers"}]},{"group":"Examples","pages":[{"title":"LLM pipeline","href":"/sdk/pipeline/examples/llm-pipeline"},{"title":"Text processing pipeline","href":"/sdk/pipeline/examples/text-processing-pipeline"},{"title":"RAG pipeline","href":"/sdk/pipeline/examples/rag-pipeline"},{"title":"Read-JSON pipeline","href":"/sdk/pipeline/examples/read-json-pipeline"},{"title":"Create-list pipeline","href":"/sdk/pipeline/examples/create-list-pipeline"},{"title":"Condition node","href":"/sdk/pipeline/examples/condition-node"},{"title":"AI routing node","href":"/sdk/pipeline/examples/ai-routing-node"},{"title":"Sub-pipelines","href":"/sdk/pipeline/examples/sub-pipeline"},{"title":"Sub-pipelines (list mode)","href":"/sdk/pipeline/examples/sub-pipeline-list-mode"},{"title":"Streaming","href":"/sdk/pipeline/examples/streaming"},{"title":"Streaming (async)","href":"/sdk/pipeline/examples/streaming-async"},{"title":"Streaming with chunks","href":"/sdk/pipeline/examples/streaming-with-chunks"},{"title":"Intermediate results","href":"/sdk/pipeline/examples/intermediate-results"},{"title":"Background runs","href":"/sdk/pipeline/examples/background-run"},{"title":"Background runs (async)","href":"/sdk/pipeline/examples/background-run-async"},{"title":"Run pipeline (async)","href":"/sdk/pipeline/examples/run-pipeline-async"},{"title":"Terminate a run","href":"/sdk/pipeline/examples/terminate-run"},{"title":"Batch config","href":"/sdk/pipeline/examples/batch-config"},{"title":"Button node","href":"/sdk/pipeline/examples/button-node"},{"title":"Gmail node","href":"/sdk/pipeline/examples/gmail-node"},{"title":"Session and overrides","href":"/sdk/pipeline/examples/session-and-overrides"},{"title":"Revert and manage versions","href":"/sdk/pipeline/examples/revert-and-manage"},{"title":"Share and publish","href":"/sdk/pipeline/examples/share-and-publish"},{"title":"Type warnings: parallel search","href":"/sdk/pipeline/examples/type-warnings-parallel-search"}]}]},{"group":"Agent","icon":"bot","pages":[{"title":"Agent overview","sidebarTitle":"Overview","href":"/sdk/agent/overview"},{"title":"Agent reference","sidebarTitle":"Reference","href":"/sdk/agent/reference"},{"group":"Tools","pages":[{"title":"VectorShift tools","sidebarTitle":"VectorShift","href":"/sdk/agent/tools/vectorshift"},{"title":"Web Search tools","sidebarTitle":"Web Search","href":"/sdk/agent/tools/web-search"},{"title":"LLM tools","sidebarTitle":"LLM","href":"/sdk/agent/tools/llm-ai"},{"title":"File Ops tools","sidebarTitle":"File Ops","href":"/sdk/agent/tools/file-ops"},{"title":"Data tools","sidebarTitle":"Data","href":"/sdk/agent/tools/data"},{"title":"Integrations tools","sidebarTitle":"Integrations","href":"/sdk/agent/tools/integrations"}]},{"group":"Examples","pages":[{"group":"Functional Agent","pages":[{"title":"Functional agent run","href":"/sdk/agent/examples/functional-agent-run"},{"title":"Functional agent with typed I/O","href":"/sdk/agent/examples/functional-agent-with-io"}]},{"group":"Conversational Agent","pages":[{"title":"Conversational agent run","href":"/sdk/agent/examples/conversational-agent-run"},{"title":"Agent CRUD","href":"/sdk/agent/examples/agent-crud"},{"title":"Conversational agent with tools","href":"/sdk/agent/examples/conversational-agent-tools"},{"title":"Tool approval config","href":"/sdk/agent/examples/tool-approval-config"},{"title":"Single-turn session","href":"/sdk/agent/examples/session-single-turn"},{"title":"Multi-turn session","href":"/sdk/agent/examples/session-multi-turn"},{"title":"Session send_many","href":"/sdk/agent/examples/session-send-many"},{"title":"Repeated sends","href":"/sdk/agent/examples/session-send-send-send"},{"title":"Streaming tool events","href":"/sdk/agent/examples/session-tool-events"},{"title":"Session approval respond","href":"/sdk/agent/examples/session-approval-respond"},{"title":"Resume a session","href":"/sdk/agent/examples/session-resume"},{"title":"Sending files in a session","href":"/sdk/agent/examples/send-file"},{"title":"Multimodal send_many","href":"/sdk/agent/examples/send-many-multimodal"},{"title":"Terminating a session","href":"/sdk/agent/examples/terminate-session"},{"title":"Chatbot session","href":"/sdk/agent/examples/chatbot-session"},{"title":"Template placeholders","href":"/sdk/agent/examples/template-placeholders"},{"title":"Vs context stringification","href":"/sdk/agent/examples/vs-context-stringification"}]}]}]},{"group":"Knowledge Base","icon":"database","pages":[{"title":"Knowledge Base overview","sidebarTitle":"Overview","href":"/sdk/knowledge-base/overview"},{"title":"Knowledge Base reference","sidebarTitle":"Reference","href":"/sdk/knowledge-base/reference"},{"group":"Examples","pages":[{"title":"Knowledge Base CRUD","href":"/sdk/knowledge-base/examples/kb-crud"},{"title":"Add files","description":"Ingest local files into a Knowledge Base and poll the ingestion task until completion.","href":"/sdk/knowledge-base/examples/add-files"},{"title":"Add folder","href":"/sdk/knowledge-base/examples/add-folder"},{"title":"Add URLs","description":"Ingest single pages or recursive crawls into a Knowledge Base with scheduled rescrapes.","href":"/sdk/knowledge-base/examples/add-urls"},{"title":"Add tables","href":"/sdk/knowledge-base/examples/add-tables"},{"title":"Advanced query","href":"/sdk/knowledge-base/examples/query-advanced"},{"title":"Items and folders","href":"/sdk/knowledge-base/examples/items-and-folders"},{"title":"Metadata autogen","href":"/sdk/knowledge-base/examples/metadata-autogen"},{"title":"Async API","href":"/sdk/knowledge-base/examples/async"},{"title":"Resync integration","href":"/sdk/knowledge-base/examples/resync-integration"}]}]},{"group":"Integrations","icon":"plug","pages":[{"title":"Integrations overview","sidebarTitle":"Overview","href":"/sdk/integrations/overview"},{"title":"CLI reference","sidebarTitle":"CLI","href":"/sdk/integrations/cli"},{"title":"Integrations reference","sidebarTitle":"Reference","href":"/sdk/integrations/reference"}]},{"group":"Table","icon":"table","pages":[{"title":"Table overview","sidebarTitle":"Overview","href":"/sdk/table/overview"},{"title":"Table reference","sidebarTitle":"Reference","href":"/sdk/table/reference"},{"group":"Examples","pages":[{"title":"Table CRUD","href":"/sdk/table/examples/table-crud"},{"title":"Table CRUD (async)","href":"/sdk/table/examples/table-crud-async"},{"title":"Rows and filters","href":"/sdk/table/examples/rows-and-filters"},{"title":"Schema and AI-generated columns","href":"/sdk/table/examples/columns-full"},{"title":"Aggregation and run","href":"/sdk/table/examples/aggregation-and-run"},{"title":"Export and query","href":"/sdk/table/examples/export-and-query"},{"title":"Common filter recipes","href":"/sdk/table/examples/all-filter-operators"},{"title":"Compose filters with AND and OR","href":"/sdk/table/examples/compound-filters"},{"title":"End-to-end: a vendor scorecard","href":"/sdk/table/examples/full-workflow"}]}]},{"group":"Transformation","icon":"wand-sparkles","pages":[{"title":"Transformation overview","sidebarTitle":"Overview","href":"/sdk/transformation/overview"},{"title":"Transformation reference","sidebarTitle":"Reference","href":"/sdk/transformation/reference"},{"group":"Examples","pages":[{"title":"Transformation CRUD","href":"/sdk/transformation/examples/transformation-crud"},{"title":"From a Python function","href":"/sdk/transformation/examples/from-function"},{"title":"Run \u0026 I/O types","href":"/sdk/transformation/examples/run-and-io-types"},{"title":"Async API","href":"/sdk/transformation/examples/async"},{"title":"As a pipeline node","href":"/sdk/transformation/examples/pipeline-node"}]}]},{"group":"Session","icon":"messages-square","pages":[{"title":"Session overview","sidebarTitle":"Overview","href":"/sdk/session/overview"},{"title":"Session reference","sidebarTitle":"Reference","href":"/sdk/session/reference"}]},{"group":"Analytics","icon":"chart-line","pages":[{"title":"Analytics overview","sidebarTitle":"Overview","href":"/sdk/analytics/overview"},{"title":"Analytics reference","sidebarTitle":"Reference","href":"/sdk/analytics/reference"},{"group":"Examples","pages":[{"title":"Query basics","href":"/sdk/analytics/examples/query-basics"},{"title":"Async API","href":"/sdk/analytics/examples/query-async"},{"title":"Filters \u0026 overloads","href":"/sdk/analytics/examples/filters-and-overloads"},{"title":"Aggregations \u0026 group-by","href":"/sdk/analytics/examples/aggregations-and-groupby"},{"title":"Events \u0026 traces","href":"/sdk/analytics/examples/events-and-traces"},{"title":"Data tables \u0026 export","href":"/sdk/analytics/examples/table-and-export"}]}]},{"group":"Workspace","icon":"folder-tree","pages":[{"title":"Workspace overview","sidebarTitle":"Overview","href":"/sdk/workspace/overview"},{"title":"Workspace reference","sidebarTitle":"Reference","href":"/sdk/workspace/reference"},{"title":"Portal reference","sidebarTitle":"Portal","href":"/sdk/workspace/portal"},{"title":"Verification reference","sidebarTitle":"Verification","href":"/sdk/workspace/verification"},{"title":"Verification issue reference","sidebarTitle":"Verification issue","href":"/sdk/workspace/issue"},{"group":"Examples","pages":[{"title":"Portals and workspaces","href":"/sdk/workspace/examples/portal-and-workspace-crud"},{"title":"Documents","href":"/sdk/workspace/examples/documents"},{"title":"Documents and files","href":"/sdk/workspace/examples/documents-and-files"},{"title":"Chat sessions","href":"/sdk/workspace/examples/sessions"},{"title":"Skills","href":"/sdk/workspace/examples/skills"},{"title":"Verification","href":"/sdk/workspace/examples/verification"},{"title":"Verification (advanced)","href":"/sdk/workspace/examples/verification-advanced"},{"title":"Managing a portal","href":"/sdk/workspace/examples/portal-admin"},{"title":"End-to-end walkthrough","href":"/sdk/workspace/examples/end-to-end"},{"title":"Async usage","href":"/sdk/workspace/examples/async"},{"title":"Async (full surface)","href":"/sdk/workspace/examples/async-full"}]}]}]}]},"basePath":"","title":"Add folder - VectorShift","deploymentId":"dpl_DyXGnKeCjZyA3sUdfMJ7FjkdBefg","buildId":"dpl_DyXGnKeCjZyA3sUdfMJ7FjkdBefg","dynamics":[],"chunks":[]}