Extras model

AutoRAG’s install extras gate which methods you can call. The base install only carries typer + pydantic + langchain-{core,ollama}.

Methods → extras

Method

Extras needed

Purpose

AutoRAG.transcribe

[audio,diarize] (+ [youtube] for URLs)

Whisper + diarization → WordSpan list. file= is a local path or a YouTube URL.

AutoRAG.generate_topics

[audio,diarize]

LLM topic extraction on a pre-computed transcript → TopicTree.

AutoRAG.build_agent

[audio,diarize]

The combined Whisper + topics Runnable[Path | str, TranscriptionResult].

AutoRAG.transcribe_blocks

[rag] on cache hit; [audio,diarize] (+ [youtube]) on miss

N-second time-bucketed transcript view. Cache reads need only [rag].

AutoRAG.persist_transcription

[rag]

Write clip row + word spans to SQLite.

AutoRAG.persist_topics

[rag]

Persist topic tree + embed topic titles into Chroma.

AutoRAG.ingest

base

Document RAG: load → chunk → embed → store.

AutoRAG.query

base

Retrieve + generate over the ingested corpus.

Extras → modules

Extra

Modules that import it

Adds

audio

autorag.whisper_runner, autorag.agent (whisper)

whisperx, torch, imageio-ffmpeg

diarize

autorag.diarize

pyannote.audio, huggingface-hub

youtube

autorag.audio_source (lazy in _download_youtube_audio)

yt-dlp

rag

autorag.chroma_store, autorag.db, autorag.viz, autorag.topic_cluster

chromadb, umap-learn, scikit-learn, numpy, pydantic_sqlite

server

autorag.api

fastapi, uvicorn[standard]

broker

autorag.services.broker (lazy pika)

pika

all

union of the above

The contract

A new method on AutoRAG must decide up-front which extra(s) it needs and follow the existing pattern: do the heavy import inside the method body, catch ModuleNotFoundError, and re-raise via autorag.errors._missing_extra() with the extras string. Heavy imports at module top in any of core.py, embed.py, __init__.py, store.py, or audio_source.py will fail the CI test-base job.

MissingExtraError is a subclass of ImportError, so callers that want a single except for “AutoRAG isn’t fully installed” can catch ImportError.