$npx -y skills add langchain-ai/deepagents --skill gpu-document-processingUse when processing large PDFs, document collections, or bulk text extraction tasks that benefit from GPU-accelerated processing. Triggers when the user provides large documents or needs bulk document analysis.
| 1 | # GPU Document Processing Skill |
| 2 | |
| 3 | Process large documents and document collections using GPU-accelerated tools. This skill uses the sandbox-as-tool pattern: the agent runs on CPU for reasoning, and sends document processing work to a GPU-equipped environment. |
| 4 | |
| 5 | ## When to Use This Skill |
| 6 | |
| 7 | Use this skill when: |
| 8 | - Processing large PDF files (50+ pages) |
| 9 | - Analyzing collections of documents (10+ files) |
| 10 | - Extracting structured data from unstructured documents |
| 11 | - Performing bulk text extraction and chunking |
| 12 | - Generating embeddings for large document sets |
| 13 | - The user uploads or references large documents for analysis |
| 14 | |
| 15 | ## Architecture: Sandbox as Tool |
| 16 | |
| 17 | This skill follows the **sandbox-as-tool pattern** for GPU execution: |
| 18 | |
| 19 | 1. **Agent reasons on CPU** - planning, synthesis, report writing |
| 20 | 2. **Processing sent to GPU sandbox** - document parsing, embedding, extraction |
| 21 | 3. **Results returned to agent** - structured output for further analysis |
| 22 | |
| 23 | This separation ensures: |
| 24 | - API keys stay outside the sandbox (security) |
| 25 | - Agent state persists independently of processing jobs |
| 26 | - Processing can be parallelized across documents |
| 27 | - Cost-efficient: GPU used only during processing, not during reasoning |
| 28 | |
| 29 | ## Capabilities |
| 30 | |
| 31 | ### PDF Text Extraction |
| 32 | Extract text content from PDF documents with layout preservation: |
| 33 | - Headers, paragraphs, lists, and tables detected separately |
| 34 | - Page numbers and section boundaries preserved |
| 35 | - Multi-column layout handling |
| 36 | |
| 37 | ### Tabular Data Extraction |
| 38 | Extract tables from documents into structured formats: |
| 39 | - PDF tables to CSV/DataFrames using GPU-accelerated parsing |
| 40 | - Automatic column type detection |
| 41 | - Handles merged cells and multi-row headers |
| 42 | |
| 43 | ### Document Chunking |
| 44 | Split large documents into meaningful chunks for analysis: |
| 45 | - Semantic chunking (by topic/section boundaries) |
| 46 | - Fixed-size chunking with overlap for embedding |
| 47 | - Configurable chunk sizes (default: 512 tokens) |
| 48 | |
| 49 | ### Embedding Generation |
| 50 | Generate vector embeddings for document chunks: |
| 51 | - Uses NVIDIA NeMo Retriever NIM for GPU-accelerated embedding |
| 52 | - Supports batch processing for large document sets |
| 53 | - Compatible with standard vector stores (Milvus, ChromaDB) |
| 54 | |
| 55 | ## Workflow |
| 56 | |
| 57 | 1. **Receive document reference** from the orchestrator |
| 58 | 2. **Determine processing type** (extraction, analysis, embedding) |
| 59 | 3. **Send to GPU sandbox** for processing |
| 60 | 4. **Collect structured results** (text, tables, embeddings) |
| 61 | 5. **Write findings** to /shared/ for the orchestrator to synthesize |
| 62 | |
| 63 | ## Processing Large Document Collections |
| 64 | |
| 65 | For multiple documents: |
| 66 | 1. Process documents in parallel batches (3-5 concurrent) |
| 67 | 2. Extract key metadata first (title, date, author, page count) |
| 68 | 3. Generate per-document summaries |
| 69 | 4. Cross-reference findings across documents |
| 70 | 5. Write consolidated findings with per-document citations |
| 71 | |
| 72 | ## Output Format |
| 73 | |
| 74 | When reporting document processing results: |
| 75 | - Include document metadata (filename, pages, size) |
| 76 | - Structure extracted content by section/chapter |
| 77 | - Format tables as markdown tables |
| 78 | - Include page references for all extracted content |
| 79 | - Note any extraction quality issues (scanned images, corrupted pages) |
| 80 | |
| 81 | ## Integration with NVIDIA NIM |
| 82 | |
| 83 | For production deployments, GPU document processing can leverage: |
| 84 | - **NVIDIA NeMo Retriever**: GPU-accelerated embedding and retrieval |
| 85 | - **NVIDIA RAPIDS cuDF**: Tabular data processing from extracted tables |
| 86 | - **NVIDIA Triton**: Scalable inference for document classification models |
| 87 | |
| 88 | See NVIDIA's NIM documentation for self-hosted deployment options. |