ingest_documents
Ingest documents into a searchable knowledge base by parsing, chunking, and storing content in memory. Supports PDF, DOCX, TXT, MD, HTML, and directories for AI agent retrieval.
Instructions
Ingest documents into memory as a knowledge base using LlamaIndex.
Supports: PDF, DOCX, TXT, MD, HTML, and more. Automatically chunks and stores content.
REQUIRED: 'path' - file path or directory path to ingest OPTIONAL: 'user_id' OR 'agent_id' (if neither provided, auto-detects current user) OPTIONAL: 'run_id' - session/run identifier for partitioning OPTIONAL: 'recursive' - recursively process subdirectories (default: False) OPTIONAL: 'chunk_size' - max characters per chunk (default: 1024, min: 100, max: 8192) OPTIONAL: 'chunk_overlap' - overlap between chunks (default: 200, min: 0, max: chunk_size-1) OPTIONAL: 'file_metadata' - additional metadata to attach to all chunks OPTIONAL: 'infer' - use LLM for fact extraction (default: False for speed)
Examples:
Ingest single file: {"path": "/path/to/document.pdf"}
Ingest directory: {"path": "/path/to/docs", "recursive": true}
With metadata: {"path": "manual.pdf", "file_metadata": {"type": "documentation", "version": "2.0"}}
Custom chunking: {"path": "large.pdf", "chunk_size": 2048, "chunk_overlap": 400}
Returns: Summary of ingested documents with chunk counts and memory IDs.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | ||
| infer | No | ||
| run_id | No | ||
| user_id | No | ||
| verbose | No | ||
| agent_id | No | ||
| recursive | No | ||
| chunk_size | No | ||
| chunk_overlap | No | ||
| file_metadata | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |