💡 Overview & Motivation
As I prepare for an upcoming physical location move, I needed to ensure that my AI coding assistants (Cursor, Claude Code, Windsurf, Gemini CLI) retain complete, uninterrupted access to their long-term working memory without relying on local homelab hardware (kruschserv / kruschgame).
Today, krusch-context-mcp is officially running 100% cloud-native!
By pairing Polygres.com (Evokoa's AI-native PostgreSQL platform) with OpenRouter.ai's cloud embeddings engine (baai/bge-large-en-v1.5), the agent context server now delivers zero-latency, zero-local-VRAM persistent memory accessible from anywhere in the world.
🏗️ The 100% Cloud Stack Architecture
1. Storage & Graph-Vector Engine: Polygres.com
What it is: "Postgres for the Agent Era" by Evokoa — a managed PostgreSQL platform fusing relational tables, pgGraph multi-hop relationship walks, and pgContext page-native HNSW vector indexes into a unified database.
- Single-Pass Metadata Filtering: Prevents vector recall collapse under selective category or project filters.
- Multi-Hop Graph Walks (
graph_hops): Dynamically traverses relationships (e.g.Memory -> Git Blob -> Unit Test). - Token Budget Packing (
limit_tokens): Server-side token truncation prevents context window overflow.
2. Cloud Embeddings: OpenRouter.ai
Model: baai/bge-large-en-v1.5 (1024-dimensional dense vectors).
Priced at ~$0.01 per 1 million tokens, OpenRouter delivers sub-100ms vector generation with zero local Ollama process overhead and zero VRAM allocation on the laptop.
3. Unified Agent Surface: krusch-context-mcp (42 MCP Tools)
Exposes 42 Model Context Protocol (MCP) tools across Episodic Memory (v1), Company Brain v2 Substrate, Holographic Steering Nuggets, Codebase Search, and AI Watch Research Engines (AgentDebugX, DataFlow-Harness, Rubric4Setwise, AREX).
📊 Migration & Live Verification Results
- Data Migration: Successfully exported and migrated 12,398 episodic memories, 149 holographic steering nuggets, 756 interaction memory states, and AI Watch failure bundles.
- Unit Tests: 22/22 unit tests passed (100% success rate).
- Cloud Integration Tests: 3/3 cloud integration tests passed verifying live OpenRouter vector generation and Polygres Runtime API client readiness.
⚙️ Quick Configuration (.env)
# --- Polygres.com Cloud Database & Runtime API ---
POLYGRES_PROJECT_ID="p4b2ef196c33edbd8be43174"
POLYGRES_RUNTIME_URL="https://p4b2ef196c33edbd8be43174.api.db.polygres.com/v1"
POLYGRES_API_KEY="poly_live_YOUR_POLYGRES_API_KEY"
# Direct Native PostgreSQL Connection
DATABASE_URL="postgresql://username:[email protected]:5432/kruschdb?sslmode=require"
# --- OpenRouter Cloud Embeddings ---
EMBEDDING_URL="https://openrouter.ai/api/v1/embeddings"
EMBEDDING_API_KEY="sk-or-v1-YOUR_OPENROUTER_API_KEY"
EMBED_MODEL="baai/bge-large-en-v1.5"