ASIM ANSARI // INTERNAL VAULT
INTERNAL KNOWLEDGE ENGINE // MCP PROTOCOL & HYBRID RAG

SAGE // KNOWLEDGE VAULT

My sealed, private command-line knowledge library and offline retrieval engine built around Google Antigravity and the Model Context Protocol (MCP). Fuses 4,013 ChromaDB dense chunks, SQLite FTS5 Okapi BM25 sparse search, and Graphify AST nodes under Torikago isolation.

Hybrid RAG v2 ChromaDB (4,013 Chunks) SQLite FTS5 BM25 Torikago Sandbox MCP Server (9 Tools)
SIGNAL // PRIVATE LOCAL VAULT
Offline Study Retrieval Engine: sage.asimansari.com functions as a private, air-gapped knowledge vault on my local machine. Exposed via a 9-tool Model Context Protocol (MCP) server, it serves dense/sparse hybrid search without public cloud exposure.
[01] CONTEXT & EVOLUTION

WHY I BUILT SAGE: THE STORY

THE FRICTION // THE RETRIEVAL PROBLEM

Fragmented Study Knowledge & Cloud Hazards

Over years of CS core studies and systems engineering, my knowledge base fragmented across local markdown notes, external drives, PDF textbooks, and code repositories.

Standard keyword grep is blind to conceptual meaning, while commercial cloud search tools upload private engineering notes to third-party servers and introduce latency. Pure vector search also hallucinates when querying exact symbol names like VirtualThreads or APIRouter.

THE ARCHITECTURE // BUILT FOR ANTIGRAVITY

Dual-Engine Hybrid RAG & MCP Integration

I engineered Sage as a sealed, offline knowledge vault. It combines ChromaDB dense vectors (4,013 verified chunks) with SQLite FTS5 Okapi BM25 sparse search for exact lexical precision.

Built as a native Model Context Protocol (MCP) server with 9 tools, Sage plugs directly into my Google Antigravity autonomous workflows (Liz), protected by the Torikago jailkeeper for zero-escape tool security.

[02] CORE RESPONSIBILITIES

WHAT SAGE POWERS IN MY WORKSPACE

01 // SUB-SECOND TERMINAL RECALL

Global CLI command sage ask "..." provides instant, grounded answers directly in my shell without opening browser tabs or burning cloud tokens.

02 // ANTIGRAVITY MCP INTEGRATION

Acts as an authenticated MCP knowledge provider for Antigravity agents, allowing them to verify facts against local curated engineering references.

03 // TORIKAGO SECURITY SANDBOX

Enforces strict read-only execution boundaries and process isolation so automated agent tools cannot execute destructive host system commands.

[03] SYSTEM PIPELINE

DUAL-ENGINE RETRIEVAL ARCHITECTURE

STAGE 01 INPUT

Query Interface

Global CLI command (sage ask "...") or MCP Client dispatches question with model parameters.

INTERFACE CLI / MCP Client (9 Tools)
STAGE 02 SECURITY

Torikago Jailkeeper

Hard security layer intercepts and inspects all tool invocations, blocking file system escapes and unsandboxed shell execution.

GUARANTEE Zero Bash / Zero Escape
STAGE 03 HYBRID RAG

Dual Search Index

Simultaneously queries ChromaDB dense embeddings (4,013 chunks) and SQLite FTS5 BM25 with Porter stemming.

TECH Dense Cosine + Sparse BM25
STAGE 04 GRAPHIFY

Graph Walk

Traverses 2,961+ AST semantic nodes to resolve inter-module dependencies, class hierarchies, and conceptual links.

NODES 2,961+ AST Graph Entities
STAGE 05 CACHE

Canonical Answer Lock

Persists exact and semantic cosine-matched answers in SQLite (canonical_answers.db) for zero-latency repeats.

OUTPUT Deterministic Terminal Output
[04] TERMINAL INTERFACE

GLOBAL CLI COMMANDS

bash // sage_cli.sh BASH
# 1. Launch interactive Sage session from anywhere in terminal
sage

# 2. Ask a direct question with one-shot terminal output
sage ask "What is APIRouter in FastAPI?"

# 3. Resume the previous conversation
sage continue
sage c

# 4. Pass model and effort flags
sage "How to configure Virtual Threads in Spring Boot 3?" --effort high