How kuyi11/video-content-knowledge-base works
VideoContentKnowledgeBase turns Bilibili videos and optional Obsidian sources into structured, searchable knowledge, then serves evidence-grounded answers and content-generation workflows. Its main ingestion path extracts subtitles or falls back to ASR, builds profile-specific notes, and updates a hybrid index. The query path retrieves and checks evidence before the agent applies safety and answer-admission rules. The README documents capabilities beyond the sampled excerpts; those branches are included where the documentation supports them, without inferring unsampled calls.
Main entry points: pipeline.py Ingestion pipeline · agent.py Answering agent · query_engine.py Query engine · api.py FastAPI service
Components 28
Video ingestion
- Ingestion pipeline
pipeline.py - Subtitle discovery
modules/subtitle.py - Audio download
modules/audio.py - ASR transcription
modules/transcribe.py - ASR backends
modules/asr - Transcript parsing
modules/transcript_parser.py
Knowledge preparation
- Fact-map extraction
modules/content_map.py - Profile synthesis
modules/structure.py - Prompt profiles
modules/prompt_profiles.py - Markdown writer
modules/obsidian_writer.py - Knowledge vault
Search and retrieval
- Vault loader
modules/vault_loader.py - Chunking
modules/chunk_splitter.py - Hybrid index
modules/indexer.py - Query planning
modules/query_planner.py - Query rewriting
modules/query_rewriter.py - Result reranking
modules/reranker.py - Query engine
modules/query_engine.py
Evidence-grounded answers
- Answering agent
modules/agent.py - Claim grounding
modules/claim_grounding.py - Semantic judge
modules/claim_judge.py - Medical safety
modules/medical_safety.py - Evidence audit
modules/evidence_audit.py
API and persistence
- FastAPI service
api.py - Runtime configuration
config.py
Other components
- Video submitter
- Bilibili
- Ollama LLM
Connections 31
- Video submitter → Ingestion pipeline: submits URL
README.md - Ingestion pipeline → Subtitle discovery: checks subtitles
pipeline.py - Bilibili → Subtitle discovery: provides captions
README.md - Ingestion pipeline → Audio download: downloads audio
README.md - Ingestion pipeline → ASR transcription: invokes fallback
pipeline.py - ASR transcription → ASR backends: selects backend
modules/transcribe.py - Ingestion pipeline → Transcript parsing: uses transcript
pipeline.py - Ingestion pipeline → Fact-map extraction: extracts facts
pipeline.py - Ingestion pipeline → Profile synthesis: synthesizes profiles
pipeline.py - Profile synthesis → Fact-map extraction: uses fact map
modules/structure.py - Profile synthesis → Prompt profiles: applies profiles
modules/structure.py - Ingestion pipeline → Markdown writer: writes notes
README.md - Markdown writer → Knowledge vault: writes Markdown
README.md - Knowledge vault → Vault loader: loads documents
README.md - Vault loader → Chunking: prepares chunks
modules/chunk_splitter.py - Ingestion pipeline → Hybrid index: updates index
pipeline.py - Hybrid index → Vault loader: loads vault documents
modules/indexer.py - FastAPI service → Query engine: serves queries
api.py - Query engine → Query planning: plans queries
modules/query_engine.py - Query engine → Query rewriting: rewrites queries
modules/query_engine.py - Query engine → Hybrid index: retrieves chunks
modules/query_engine.py - Query engine → Result reranking: reranks results
modules/query_engine.py - FastAPI service → Answering agent: invokes answering
api.py - Answering agent → Query engine: retrieves evidence
modules/agent.py - Answering agent → Claim grounding: grounds claims
modules/agent.py - Answering agent → Semantic judge: checks support
modules/agent.py - Answering agent → Medical safety: applies safety gate
modules/agent.py - Answering agent → Evidence audit: records evidence
modules/agent.py - Answering agent → Ollama LLM: generates and judges
modules/agent.py - Ingestion pipeline → Runtime configuration: reads settings
pipeline.py - FastAPI service → Runtime configuration: reads settings
api.py