Skip to Content

File Processing

Multi-modal content extraction for knowledge management.

Overview

isA Data supports processing multiple file types for RAG and knowledge extraction:

TypeFormatsCapabilities
PDF.pdfText, tables, images, OCR
Image.png, .jpg, .webpAI analysis, descriptions, metadata
Audio.mp3, .wav, .m4aTranscription (Whisper)
Video.mp4, .movFrames, scenes, transcript
Office.docx, .xlsx, .pptxText extraction
Text.txt, .mdChunking, metadata

PDF Processing

Store PDF

curl -X POST "http://localhost:8084/api/v1/digital/store" \ -H "Content-Type: application/json" \ -d '{ "user_id": "user123", "content": "https://arxiv.org/pdf/1706.03762.pdf", "content_type": "pdf", "metadata": { "source": "arxiv", "title": "Attention Is All You Need" } }'

Processing Flow

PDF URL → Download → Extract ─┬─▶ Text → Chunk → Embed → Store ├─▶ Tables → Structure → Store └─▶ Images → OCR → Store

Extraction Capabilities

FeatureDescription
TextClean text extraction with layout preservation
TablesStructured table extraction to JSON
ImagesExtract embedded images
OCROptical character recognition for scanned PDFs
MetadataTitle, author, creation date

Example Response

{ "success": true, "content_type": "pdf", "chunks_stored": 45, "metadata": { "title": "Attention Is All You Need", "pages": 15, "tables_extracted": 3, "images_extracted": 8 } }

Image Processing

Store Image with AI Analysis

curl -X POST "http://localhost:8084/api/v1/digital/store" \ -H "Content-Type: application/json" \ -d '{ "user_id": "user123", "content": "https://images.unsplash.com/photo-1506905925346-21bda4d32df4", "content_type": "image", "metadata": { "source": "unsplash" } }'

AI Metadata Extraction

Images are automatically analyzed to extract:

FieldDescriptionExample
ai_categoriesImage classification["landscape"]
ai_tagsSemantic tags (5-15)["mountains", "sunset", "snow"]
ai_moodEmotional tone"peaceful"
ai_stylePhotography style"professional"
ai_quality_scoreQuality rating (0-1)0.88
ai_has_peopleContains peoplefalse
ai_has_textContains textfalse
ai_dominant_colorsMain colors (2-4)["blue", "orange", "white"]
ai_compositionComposition type"rule-of-thirds"

Example Response

{ "success": true, "content_type": "image", "ai_metadata": { "ai_categories": ["landscape"], "ai_tags": ["mountains", "snow", "glaciers", "clouds", "sunset", "alpine", "nature", "scenic", "majestic"], "ai_mood": "peaceful", "ai_style": "professional", "ai_quality_score": 0.88, "ai_has_people": false, "ai_has_text": false, "ai_dominant_colors": ["blue", "orange", "white"], "ai_composition": "rule-of-thirds" } }

Search images by description:

curl -X POST "http://localhost:8084/api/v1/digital/search" \ -H "Content-Type: application/json" \ -d '{ "user_id": "user123", "query": "peaceful mountain sunset landscape", "search_options": {"top_k": 5} }'

Audio Processing

Store Audio

curl -X POST "http://localhost:8084/api/v1/digital/store" \ -H "Content-Type: application/json" \ -d '{ "user_id": "user123", "content": "https://example.com/podcast.mp3", "content_type": "audio", "metadata": { "title": "Tech Talk Episode 1" } }'

Processing

  • Transcription using OpenAI Whisper
  • Speaker diarization (who said what)
  • Timestamp alignment
  • Chunking by natural pauses

Search Transcripts

curl -X POST "http://localhost:8084/api/v1/digital/search" \ -H "Content-Type: application/json" \ -d '{ "user_id": "user123", "query": "discussion about machine learning", "search_options": {"top_k": 5} }'

Video Processing

Store Video

curl -X POST "http://localhost:8084/api/v1/digital/store" \ -H "Content-Type: application/json" \ -d '{ "user_id": "user123", "content": "https://example.com/tutorial.mp4", "content_type": "video", "metadata": { "title": "Python Tutorial" } }'

Processing

FeatureDescription
Frame ExtractionKey frames at regular intervals
Scene DetectionAutomatic scene boundaries
Audio TrackTranscription of speech
Visual AnalysisAI description of key frames

Text Chunking

Chunking Strategies

StrategyDescriptionBest For
fixedFixed character/token countSimple documents
semanticMeaning-based boundariesTechnical docs
sentenceSentence-based splittingConversational
paragraphParagraph boundariesStructured text

Configuration

# In store request { "content": "Your text content...", "content_type": "text", "chunking_options": { "strategy": "semantic", "chunk_size": 512, "chunk_overlap": 50 } }

Python SDK

from isa_data import DigitalService service = DigitalService("http://localhost:8084") # Store PDF result = await service.store( user_id="user123", content="https://example.com/document.pdf", content_type="pdf" ) # Store image with AI analysis result = await service.store( user_id="user123", content="https://example.com/photo.jpg", content_type="image" ) # Access AI metadata print(result.ai_metadata.ai_tags) print(result.ai_metadata.ai_mood) # Search results = await service.search( user_id="user123", query="mountain landscape" )

Use Cases

Document Knowledge Base

# Build knowledge base from PDF documents documents = [ "https://example.com/manual1.pdf", "https://example.com/manual2.pdf", "https://example.com/guide.pdf" ] for doc in documents: await service.store( user_id="kb_admin", content=doc, content_type="pdf", metadata={"collection": "product_docs"} ) # Query the knowledge base response = await service.response( user_id="user", query="How do I configure the system?", response_options={"rag_mode": "simple"} )

Visual Asset Management

# Index image library images = get_image_urls_from_storage() for img in images: await service.store( user_id="media_team", content=img, content_type="image" ) # Search by visual content results = await service.search( user_id="designer", query="professional headshot corporate" ) # Filter by AI metadata results = await service.search( user_id="designer", query="high quality landscape", filters={"ai_quality_score": {"$gte": 0.8}} )

Meeting Transcription

# Process meeting recording await service.store( user_id="team", content="https://storage.com/meeting-2024-01-15.mp4", content_type="video", metadata={"meeting": "Q1 Planning"} ) # Find specific discussions results = await service.search( user_id="manager", query="budget allocation discussion" )

Performance

OperationTarget
PDF (10 pages)< 10s
Image analysis< 3s
Audio (10 min)< 30s
Video (5 min)< 60s

Next Steps