Cortex
An ontology-backed knowledge graph memory store with branch-based ingestion, provenance, inference, and full-text search — exposed to AI agents over MCP.
What is Cortex?
Adding one Spring Boot starter auto-configures a complete, ontology-grounded knowledge-graph memory for your application — backed by Apache Jena, gated by human review, and designed to be read and written by AI agents over the Model Context Protocol.
Ontology-grounded
You supply the vocabulary (ontology.ttl), the SHACL shapes
(ontology.shapes), and the inference rules (ontology.rules).
Every assertion is linted and validated against them before it can enter the graph.
Human-in-the-loop
Incoming assertions are staged on a branch as an RDF patch. Nothing reaches the approved graph until a human reviews and approves it — agents propose, people decide.
Agent-native (MCP)
A Spring AI MCP server exposes Lint, Ingest, Query, Ask, Describe, and Search tools plus the ontology as a resource, so agents ground their reads and writes in your schema.
Provenance built in
Every ingestion is a PROV-O prov:Activity; every approved statement is
reified and linked with prov:wasGeneratedBy. You always know where a fact
came from and when.
Inference & search
Jena rule-based inference extends the graph incrementally on each approval; a Lucene full-text index over labels and comments tolerates typos and ranks by relevance.
Durable by design
Approved assertions live in a TDB2 store — in memory, or on disk. Optional scheduled backups to S3 and restore-on-startup let an ephemeral replica come up fully seeded.
Install
Requires JDK 21 and Spring Boot 4.0. Add the starter — it brings everything the graph, the web UI, and the MCP server need.
implementation("ai.chatur:cortex-spring-boot-starter:0.1.2")
<dependency>
<groupId>ai.chatur</groupId>
<artifactId>cortex-spring-boot-starter</artifactId>
<version>0.1.2</version>
</dependency>
Full getting-started guide → Tutorial: a vocabulary with SKOS →
Modules
Cortex is split across five Gradle modules; the first four publish
independently to Maven Central under the ai.chatur group.
| Module | Purpose |
|---|---|
cortex-api | The public contract: the Cortex interface, its nine role interfaces, and the data records. Pure Java — no dependencies. |
cortex-core | The Jena-backed implementation (JenaCortex) and CortexBuilder, which assembles a Cortex without Spring. |
cortex-spring-boot-autoconfigure | Spring Boot auto-configuration for the Cortex bean, the web UI controllers, and the MCP tools and resources. |
cortex-spring-boot-starter | The single dependency consumers add; brings the autoconfigure module plus the Spring MVC and Thymeleaf dependencies the web UI needs. |
cortex-spring-boot-starter-example | A runnable example app with a sample ontology, shapes, and rules. Not published. |
Project details
- Source & issues on GitHub —
chaturai/cortex - API reference (Javadoc) for the three modules that carry source
- Artifacts on Maven Central
- Schema authoring via the cortex-schema Claude Code plugin