Overview
Folders in Morphik provide a way to organize documents into logical groups. This is particularly useful for multi-project environments where you want to maintain separation between different contexts. Documents within a folder are isolated from those in other folders, allowing for clean organization and data separation.ℹ️ All folder APIs accept folder UUIDs, names, or canonical paths (e.g.,"/projects/alpha/specs"). Folder objects exposefull_path,parent_id,depth, andchild_count; documents exposefolder_pathto mirror server responses.
Creating and Accessing Folders
- Sync
- Async
Operations Within a Folder
Once you have a folder object, all operations performed on it are scoped to that folder. Documents created, retrieved, or manipulated will be contained within this folder’s scope.- Sync
- Async
Nested Folders and Scope Depth
Folders can be nested arbitrarily. Use canonical paths (leading slash optional) to address them, and include descendant folders in retrieval/listing by settingfolder_depth:
folder.retrieve_chunks(..., folder_depth=-1) will include its children.
Expanding Scope with Additional Folders
Folder-scoped retrieval/list/query helpers acceptadditional_folders to include extra folders in the same request:
Folder Methods
All the core document operations available on the main Morphik client are also available on folder objects, but they are automatically scoped to the specific folder:ingest_text- Ingest text content into this folderingest_file- Ingest a file into this folderingest_files- Ingest multiple files into this folderingest_directory- Ingest all files from a directory into this folderretrieve_chunks- Retrieve chunks matching a query from this folder (supports reverse image search)retrieve_docs- Retrieve documents matching a query from this folderquery- Generate a completion using context from this folder (supportsllm_configparameter for custom LLM configuration)list_documents- List all documents in this folderbatch_get_documents- Get multiple documents by their IDs from this folderbatch_get_chunks- Get specific chunks by source from this folderget_info- Fetch the latest folder metadata from the APIget_summary- Fetch the latest folder summaryupsert_summary- Create or update the folder summarydelete_document_by_filename- Delete a document by filename from this folder
Managing Existing Documents and Folders
You can move previously ingested documents into a folder, remove them, or delete the entire folder. The SDK methods accept a folder UUID, name, or canonical path.- Sync
- Async
Using Custom LLM Configuration with Folders
You can pass a custom LLM configuration when querying within a folder:- Sync
- Async
Example: Project Document Management
A common use case for folders is separating different projects. Here’s an example of how to organize project documentation:- Sync
- Async
Accessing a Folder’s User Scope
You can further scope operations within a folder to a specific user by using thesignin method on the folder object:
- Sync
- Async

