Claude Code plugin · v0.1.0

Cortex

Persistent semantic memory for Claude. Built on W3C standards. Runs on your machine.

Apache Jena TDB2 triplestore with SPARQL 1.1, SHACL validation, RDF-star provenance, and forward inference. Exposed via MCP. Compiled to a GraalVM native binary.

KotlinJDK 21Apache Jena 5GraalVM NativeSpring Boot 3.5SPARQL 1.1SHACLRDF-starMCP

Architecture

Three interfaces, one knowledge graph

TDB2 Persistence
Apache Jena TDB2 dataset. Configurable location. Transaction-safe reads/writes. Automatic compaction and backup.
MCP Surface
5 tools + 1 resource. SSE + WebSocket transport. Spring AI MCP server. Integrated with Claude Code.
Web UI
Thymeleaf server pages. React dashboard. D3 triples-over-time chart. Full graph admin and search.

MCP Surface

5 tools + 1 resource

The complete MCP surface for building and querying semantic memory.

createNamedGraphtool
Creates a new named graph in the dataset.

graphIri: String

loadTurtletool
Parses and loads Turtle RDF data. Every triple gets per-triple RDF-star provenance tracking.

graphIri: String, turtleData: String

querytool
Executes SPARQL 1.1 queries (SELECT, CONSTRUCT, ASK, UPDATE).

sparqlQuery: String, graphIri?: String

validateTurtletool
Validates Turtle syntax and well-formedness without writing.

turtleData: String

validateInstancestool
Runs SHACL shape validation against instances in a graph.

graphIri: String, shapesGraphIri?: String

cortex://graphsresource
Read-only JSON catalog of all named graphs, metadata, and triple counts.

Technical depth

Built for production reasoning

RDF-star per-triple provenance
Every triple written to the dataset gets &lt;&lt; s p o &gt;&gt; prov:wasGeneratedBy <activity>. Know the source, timestamp, and derivation of every fact.
SPARQL 1.1 & RDF inference
Execute complex SELECT, CONSTRUCT, and UPDATE queries. Forward-chaining rules with Jena GenericRuleReasoner for derived graphs.
SHACL shape validation
Define cardinality constraints, datatypes, regex patterns, value lists. A repair agent diagnoses and suggests fixes before corrupting the graph.
GraalVM native binary
Instant startup, 10x lower memory footprint, zero runtime dependencies. One cortex binary serves any TDB2 dataset directory.
Transaction-safe with metrics
Every read/write wrapped in Txn.calculateRead/executeWrite. Prometheus `/actuator/prometheus` and triples-over-time dashboard.
Local-first TDB2 persistence
Apache Jena TDB2 dataset stored at ~/cortex or any configured path. Automatic compaction and backup jobs via Quartz.

Claude skills

Four slash commands

Build and query your knowledge graph through natural conversation.

/define-concept
Define Concept
Author OWL ontologies in plain conversation. Declare classes, properties, cardinality, and validation rules.
/refine-concept
Refine Concept
Evolve your schema. Add or update SHACL shapes and constraints as your model matures.
/add-instances
Add Instances
Populate the graph. Load data from prose, CSV, JSON, or natural language descriptions.
/query-cortex
Query Cortex
Build and execute SPARQL queries. Discover ontologies, surface templates, reason over your memory.

Philosophy

A memory you can reason about

The problem

Every Claude session starts from zero. You re-explain your domain, your teammates, your codebase. Insights surface, then vanish the moment the window closes — no recall, no continuity, no compounding.

The approach

You author OWL ontologies declaring what kinds of things deserve memory. Cortex watches your conversations, extracts matching facts, stores them in an RDF graph, and silently injects relevant context on every new prompt.

The principles

Only explicit facts — never inferences. User-authored schemas — you control the vocabulary. Idempotent storage — re-ingesting is a no-op. Local-first — your data lives in ~/.cortex.

Get started

Two commands. That's it.

Requires Claude Code and Docker. The cortex-server will start on port 8080.

# add the chatur.ai plugin marketplace
claude plugin marketplace add chaturai/cortex

# install cortex
claude plugin install cortex@chaturai

Coming soon

On the roadmap

Cortex is early. Here's what we're building next.

Coming soon
Interactive Memory UI
React web console for browsing graphs, running visual SPARQL queries, inspecting ontologies, and managing concepts in the browser.
Coming soon
Learn while you sleep
Background memory defragmentation reconciles duplicate entities, merges aliases, tightens the graph between sessions.
Coming soon
Tiered memory & planned obsolescence
Hot, warm, and cold tiers with retention policies. Facts age gracefully when they become irrelevant.
Coming soon
Fully open source
cortex-server and all infrastructure will be open source once stabilized. Plugin is already MIT-licensed.