Aegis
Allows searching and retrieving knowledge packages, evidence citations, and source metadata compiled from YouTube playlists and videos.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Aegis Show me citations from the video on building a hybrid search system"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Aegis — Agent-Ready Knowledge Compiler
Aegis is a durable, evidence-grounded knowledge compiler that transforms instructional video content (starting with YouTube playlists in v1) into versioned, structured, and validated knowledge packages exposed to AI agents via the Model Context Protocol (MCP 2026-07-28).
Key Capabilities
Deterministic 10-Stage Pipeline: Discover $\rightarrow$ Acquire $\rightarrow$ Evidence Extraction $\rightarrow$ Segmentation $\rightarrow$ Structured Extraction $\rightarrow$ Evidence Binding $\rightarrow$ Enhancement $\rightarrow$ Validation $\rightarrow$ Vector Indexing $\rightarrow$ Atomic Publication.
PostgreSQL 18 + pgvector Single Source of Truth: All stage executions, worker leases, idempotent operation identities, evidence citations, and knowledge items reside in PostgreSQL.
Content-Addressed Immutable Artifacts: All intermediate outputs and raw transcripts are hashed (SHA256) and stored in S3/MinIO.
Hybrid Semantic & Lexical Retrieval: Combines dense
text-embedding-3-smallvector similarity with PostgreSQL full-text search and evidence-support boosting.Read-Only MCP 2026-07-28 Server: 5 read-only tools exposed over
stdioand Streamable HTTP for seamless integration with Claude Desktop, Cursor, and custom agent SDKs.Operator Console: Next.js 16 + React 19 web dashboard for ingestion, run tracking, evidence timeline exploration, and human-in-the-loop review queue resolution.
Related MCP server: youtube-ai
Monorepo Layout
aegis/
├── apps/
│ ├── api/ # FastAPI 0.139 Control REST API (:8000)
│ ├── worker/ # Background processing daemon & reconciler
│ ├── mcp/ # Read-only MCP 2026-07-28 Server (:8001)
│ └── web/ # Next.js 16 + React 19 Operator Console (:3000)
├── packages/
│ ├── domain/ # Pure domain models (zero framework dependencies)
│ ├── schemas/ # Pydantic v2 validation models & extraction schemas
│ ├── database/ # SQLAlchemy 2.0 async models (16 tables) & repositories
│ ├── pipeline/ # Idempotency engine, lease manager, 10-stage graph
│ ├── providers/ # External AI (OpenAI GPT-5.6) & YouTube (yt-dlp) adapters
│ ├── retrieval/ # Hybrid vector + lexical search engine
│ └── storage/ # Content-addressed S3/MinIO storage backend
├── migrations/ # Alembic database migrations
├── infra/
│ ├── compose/ # Docker Compose definition & overrides
│ ├── docker/ # Production multi-stage Dockerfiles
│ └── scripts/ # Backup, restore, migration, and healthcheck utilities
├── tests/ # Unit, integration, contract, evaluation, and crash recovery tests
└── docs/ # Architecture, REST API, operations runbook, and MCP guideTechnology Stack
Layer | Technology |
Backend Runtime | Python 3.13 |
Dependency Manager |
|
Control API | FastAPI 0.139, Pydantic v2 |
Orchestration & State | LangGraph 1.2, SQLAlchemy 2.0 Async, Alembic |
Database & Search | PostgreSQL 18 + pgvector 0.8.6 |
Object Storage | AWS S3 / MinIO (Content-Addressed) |
LLM & Embeddings | OpenAI Responses API (GPT-5.6) / |
Media Extraction | yt-dlp 2026.7.4 |
Protocol Integration | Model Context Protocol (MCP 2026-07-28 Python SDK v2) |
Operator Console | Next.js 16, React 19, TypeScript, Tailwind CSS |
Quality & Linters | pytest, pytest-asyncio, Ruff |
Quickstart
Option A: One-Liner Production Installation (curl)
Bootstrap dependencies, virtual environment, and configuration with a single command:
# Automated installer (fetches uv, clones/syncs repo, initializes .env with secure keys, checks Docker)
curl -fsSL https://raw.githubusercontent.com/Demi8-patch/aegis/main/install.sh | bash
Or execute locally from the repository root:
./install.shOption B: Quickstart with uv
# 1. Clone and Bootstrap Environment
cp .env.example .env
uv sync
pnpm install
# 2. Verify System Health & Diagnostics
uv run aegis doctor
# 3. Start PostgreSQL 18 (with pgvector) and MinIO
docker compose -f infra/compose/docker-compose.yml up -d
# 4. Apply Database Migrations
uv run aegis migrateUnified Aegis CLI Reference
Aegis provides a comprehensive command-line tool aegis accessible via uv run aegis <command> (or directly as aegis when installed):
Command | Description | Example |
| Probes environment, database, pgvector, S3 storage, and OpenAI API keys. |
|
| Safely creates |
|
| Compiles a YouTube playlist or video end-to-end through the 10-stage pipeline. |
|
| Starts the read-only Model Context Protocol (MCP 2026-07-28) server. |
|
| Launches the FastAPI Control REST API server with Swagger docs. |
|
| Runs the durable background worker daemon and periodic lease reconciler. |
|
| Runs continuous retrieval evaluation benchmarks or records regression cases. |
|
| Applies latest Alembic database migrations. |
|
| Creates a compressed PostgreSQL database dump and syncs S3 artifacts. |
|
| Restores database schema and object storage artifacts from a backup archive. |
|
Launching Development Services
# Terminal 1: FastAPI Control API (:8000)
uv run aegis api --port 8000 --reload
# Terminal 2: Aegis Background Worker & Reconciler
uv run aegis worker
# Terminal 3: Read-Only MCP Server (:8001 / stdio)
uv run aegis mcp
# Terminal 4: Operator Web Console (:3000)
pnpm --filter aegis-web devThe Operator Console will be live at http://localhost:3000, the Control API at http://localhost:8000, and the MCP endpoint at http://localhost:8001/mcp.
MCP Tools Reference
The Aegis MCP server exposes 5 read-only tools conforming to the MCP 2026-07-28 specification:
MCP Tool | Description |
| Hybrid vector + lexical search across published knowledge items with evidence citations. |
| Fetches a structured knowledge item by UUID with bound citations and semantic relationships. |
| Retrieves the raw transcript segment, start/end video seconds, and confidence score. |
| Searches imported playlists and videos by title, URL, channel, or video ID. |
| Fetches source metadata, video durations, and published package versions. |
For client integration setup (Claude Desktop, Cursor, Windsurf, custom agents), see the MCP Client Integration Guide.
Testing & Quality Assurance
Aegis includes a comprehensive test suite with 82+ tests covering unit logic, integration flows, crash recovery, prompt injection defense, and retrieval quality.
# Run full pytest suite (82 passed)
uv run pytest tests/
# Run Ruff linter and style checks
uv run ruff check .
uv run ruff format --check .
# Build Wheel & Source Distribution
uv build
# Build Next.js Operator Web Console
pnpm --filter aegis-web buildProduction Operations & Disaster Recovery
Database & Artifact Backup:
./infra/scripts/backup.shDatabase & Artifact Restore:
./infra/scripts/restore.sh backups/aegis_db_YYYYMMDD_HHMMSS.sql.gz backups/aegis_artifacts_YYYYMMDD_HHMMSS.tar.gzComprehensive Documentation:
License
Apache-2.0
Available Tools
5 toolsget_evidenceA
Retrieve raw source evidence snippet, timestamps, video association, and confidence.
Args: evidence_id: UUID string of the evidence record.
Inputs: evidence_id (required). Returns: object
get_knowledgeA
Fetch a specific knowledge item by its UUID, including bound evidence citations and relationships.
Args: knowledge_id: UUID string of the knowledge item.
Inputs: knowledge_id (required). Returns: object
get_sourceA
Get source/video/playlist details, ingestion status, and published package versions.
Args: source_id: UUID string of the source, playlist, or video.
Inputs: source_id (required). Returns: object
search_knowledgeA
Search published knowledge items and packages using hybrid semantic + lexical retrieval.
Args: query: Natural language query to search knowledge items for. item_types: Optional filter for specific item types (e.g. CONCEPT, PROCEDURE, RULE). min_confidence: Minimum confidence score filter (0.0 to 1.0). limit: Maximum number of ranked results to return (default 10).
Inputs: query (required), limit, item_types, min_confidence. Returns: object
search_sourcesA
Search ingested sources, playlists, and videos by title, URL, or metadata.
Args: query: Search term for source title, channel, or URL. limit: Maximum number of results to return.
Inputs: query (required), limit. Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 5 tools
Each tool targets a distinct resource and action: fetching by ID vs searching by query, and separating knowledge, evidence, and sources. There is no overlap or ambiguity between the five tools.
All tool names follow the same verb_noun pattern using either 'get_' or 'search_' prefixes. The naming is perfectly consistent and predictable.
With 5 tools, the server is well-scoped for a knowledge and evidence retrieval system. Each tool contributes a distinct function and none are redundant or excessive.
The set covers retrieval and search for knowledge, evidence, and sources comprehensively. However, it lacks any mutation or ingestion operations, which may be a minor gap if the server is intended to manage the full lifecycle.
Maintenance
Related MCP Connectors
Search your video library with natural language and retrieve relevant moments through MCP.
Public read-only MCP access to digital learning concepts, semantic relationships, and citations.
Search and manage your team's knowledge from MCP clients.
Read-only hosted MCP over CanonicAI's cited Answers corpus on canonicai.com.
Related MCP Servers
- AlicenseBqualityDmaintenanceProvides a read-only MCP interface to query and retrieve verifiable evidence from a local memory bank, supporting search, dossier, chronology, source, and evidence tools.6BSD Zero Clause
- AlicenseNot gradedqualityCmaintenanceProvides read-only MCP tools to search YouTube, retrieve video metadata, transcripts, comments, channel information, and popular videos.3MIT
- FlicenseNot gradedqualityCmaintenanceProvides read-only, citation-backed semantic search and retrieval-augmented generation over enterprise documents via standardized MCP tools, with local embeddings for privacy.-
- FlicenseNot gradedqualityAmaintenanceEnables ingesting YouTube videos into a persistent, searchable knowledge base by combining transcripts with scene-change vision analysis, then answering natural-language queries with citations. It supports MCP clients such as Claude and Copilot by exposing compiled cross-video knowledge for agentic reasoning.-