Aller au contenu

Developer Documentation — Cortex

Ce contenu n’est pas encore disponible dans votre langue.

Audience: software engineer who wants to integrate Cortex, contribute to the codebase, or understand the internal architecture.


Cortex is the knowledge-graph engine behind the Arka platform. It stores, versions, and serves atoms — typed, versioned artefacts that describe agent profiles, skills, governance rules, templates, and project memory. Cortex exposes two consumer surfaces: a REST API (Fastify/Express, port 9096) and a Model Context Protocol (MCP) server (port 3001). A React UI provides visual access to the catalogue and workspace.

The engine follows a strict hexagonal architecture. Domain services depend on ports (interfaces); adapters implement those ports. This separation lets the same business logic serve HTTP clients, LLM agents, and batch scripts without coupling.


Pick the path that matches what you need:

  1. Read reference/rest-api for the HTTP surface.
  2. Read reference/mcp-tools if your consumer is an LLM agent.
  3. Read reference/environment-variables to configure your instance.
  1. Read deploy/docker-compose for the full self-hosted stack.
  2. Read reference/environment-variables for secrets and tuning.
  1. Start with architecture/ to understand hexagonal layering.
  2. Read architecture/data-model to understand the ATOM model.
  3. Read architecture/ingestion-pipeline to understand the write path.
  4. Read contributing for coding standards and PR workflow.

architecture/ covers the hexagonal layers, inbound and outbound adapters, domain core, event bus, and composition root.

architecture/data-model documents the ATOM model (six layers), HYOS profiles, blocs, taxonomy, and graph edges.

architecture/ingestion-pipeline traces the write path from Zod validation to SurrealDB persistence and embedding enrichment.

reference/ groups the REST API route list, MCP tool catalogue, and environment variables.

deploy/ covers the Docker Compose stack, reverse proxy, backups, and health monitoring.

contributing summarises coding standards, hexagonal rules, and the PR workflow.


This documentation is generated from the arka-cortex source code. Route counts, tool counts, and environment variable lists are verified against the codebase at each update. If you find a discrepancy, it is a bug to report.