# librarian-agent-instantiation > How to spawn and task the Librarian Agent for media ingestion - Author: NOVA - Repository: NOVA-Openclaw/clawd-workspace - Version: 20260207131035 - Stars: 0 - Forks: 0 - Last Updated: 2026-02-07 - Source: https://github.com/NOVA-Openclaw/clawd-workspace - Web: https://mule.run/skillshub/@@NOVA-Openclaw/clawd-workspace~librarian-agent-instantiation:20260207131035 --- --- name: librarian-agent-instantiation description: How to spawn and task the Librarian Agent for media ingestion --- # Librarian Agent Instantiation ## Tools - `sessions_spawn` - `psql` - `read` - `web_fetch` - `exec` ## Procedure 1. GATHER INPUT: Get URL, file path, or queue item ID to process 2. FETCH AGENT CONFIG: SELECT * FROM agents WHERE name = 'librarian-agent' 3. CHECK QUEUE (optional): SELECT * FROM v_media_queue_pending LIMIT 5 4. CHECK DUPLICATES: SELECT id, title FROM media_consumed WHERE url = '{input_url}' 5. IF DUPLICATE: Return existing record, skip spawning 6. BUILD CONTEXT: Read SOUL.md and WORKFLOW.md from seed_context.files 7. SPAWN AGENT: sessions_spawn(task="{context_template}\n\nPending Queue:\n{queue_items}\n\nTask: Ingest this media: {input}", model="claude-sonnet-4-20250514", label="librarian:{media_slug}", cleanup="delete") 8. MONITOR: Use sessions_list to check progress 9. VERIFY: Confirm media_consumed record was created 10. REPORT: Return media_consumed.id and summary to caller ## Notes Use for individual media items or batch queue processing. Agent handles deduplication internally.