Overview
Cortex is an abstraction layer for vector databases. It is native to Effect. It provides schemas, typed collections, and composable infrastructure for vector operations. ORMs brought structure to relational databases. Cortex applies the same kind of structure to AI storage.
Problem
Most vector database tooling operates at a low level. You piece together SDKs, handwritten schemas, validation layers, metadata parsers, retry logic, and storage-specific query APIs. The codebase becomes infrastructure glue. As RAG systems grow, metadata becomes inconsistent. Filters become fragile. Retrieval logic spreads across the application. Runtime parsing breaks assumptions. Types collapse into Record<string, unknown>. The compiler stops helping. Relational databases had the same problem before ORMs existed.
Approach
Cortex brings structure and safety to vector database operations. It does this through three design decisions.
Built natively for Effect. Cortex is not an adapter or an optional integration. It uses Effect's primitives directly. Vector operations become Effect programs. Adapters become layers. Collections become services. Resource management becomes predictable. Effect provides typed failures, dependency injection, and structured concurrency as the foundation.
Schema-driven infrastructure. Collections are structured. Vectors are validated. Operations are composable. Cortex treats vector databases as structured application infrastructure, not loosely typed storage. This addresses metadata chaos. The compiler enforces assumptions before runtime can fail. This removes a category of bugs common in RAG pipelines.
Adapters instead of lock-in. The vector database ecosystem changes constantly. Cortex uses adapters. Application logic stays independent from storage implementations. Your application describes what it needs from vector infrastructure, not how a vendor implements it.
How It Works
Tech Stack
- Effect
- TypeScript
- npm
