Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
github: MikeSquared-Agency
18 changes: 18 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
name: Bug Report
about: Report a bug in Cortex
labels: bug
---

## Description

## Steps to reproduce

## Expected behaviour

## Actual behaviour

## Environment
- Cortex version:
- OS:
- Install method (cargo/binary/docker):
11 changes: 11 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
name: Feature Request
about: Suggest a feature for Cortex
labels: enhancement
---

## Problem

## Proposed solution

## Alternatives considered
9 changes: 9 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
## What this PR does

## Related spec/issue

## Checklist
- [ ] Tests pass (`cargo test --workspace`)
- [ ] Clippy clean (`cargo clippy --workspace`)
- [ ] Docs updated (if user-facing change)
- [ ] CHANGELOG updated (if notable change)
16 changes: 16 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -213,3 +213,19 @@ jobs:
run: cd sdks/typescript && npm ci && npm run build && npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

publish-mcp-bridge:
name: Publish MCP bridge to npm
runs-on: ubuntu-latest
needs: github-release
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
registry-url: https://registry.npmjs.org
- name: Publish
working-directory: mcp-bridge
run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
12 changes: 12 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,3 +130,15 @@ and best practices for keeping the graph clean.
Start every session with: `cortex_briefing(agent_id="YOUR_AGENT_ID", compact=true)`

The rest of this CLAUDE.md is for developers working on the Cortex codebase itself.

## Using Cortex as an MCP server

The native MCP server is in `crates/cortex-server/src/mcp/mod.rs`.
It implements 7 tools via stdio JSON-RPC transport.

The MCP server runs in two modes:
- **Library mode** (default): opens the redb database directly. Fastest.
- **Proxy mode** (`--server`): connects to a running gRPC server.

The Node.js bridge in `mcp-bridge/` proxies to the HTTP API for environments
without the Rust binary.
111 changes: 111 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Cortex

[![CI](https://github.com/MikeSquared-Agency/cortex/actions/workflows/ci.yml/badge.svg)](https://github.com/MikeSquared-Agency/cortex/actions/workflows/ci.yml)
[![Release](https://img.shields.io/github/v/release/MikeSquared-Agency/cortex)](https://github.com/MikeSquared-Agency/cortex/releases/latest)
[![crates.io](https://img.shields.io/crates/v/cortex-memory.svg)](https://crates.io/crates/cortex-memory)
[![PyPI](https://img.shields.io/pypi/v/cortex-memory.svg)](https://pypi.org/project/cortex-memory/)
[![npm](https://img.shields.io/npm/v/@cortex-memory/client.svg)](https://www.npmjs.com/package/@cortex-memory/client)
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)

**Self-organizing graph memory for AI agents. One binary. Zero dependencies.**

Cortex is an embedded temporal graph memory that auto-links knowledge, decays what's irrelevant, detects contradictions, and synthesises context briefings on demand. Think SQLite, but for agent memory.
Expand Down Expand Up @@ -64,6 +71,109 @@ cortex briefing my-agent --scope shared
cortex trust <node-id>
```

## Use with AI Agents (MCP)

Cortex speaks MCP natively. One command gives your AI agent persistent,
self-organizing memory.

### Claude Code

```bash
# Start Cortex in the background
cortex serve &

# Add to Claude Code
claude mcp add cortex -- cortex mcp
```

Claude Code now has 7 memory tools: `cortex_store`, `cortex_search`,
`cortex_recall`, `cortex_briefing`, `cortex_traverse`, `cortex_relate`,
`cortex_observe`.

### Cursor

Add to `.cursor/mcp.json`:

```json
{
"mcpServers": {
"cortex": {
"command": "cortex",
"args": ["mcp"]
}
}
}
```

### Windsurf

Add to your MCP config:

```json
{
"mcpServers": {
"cortex": {
"command": "cortex",
"args": ["mcp"]
}
}
}
```

### VS Code (Copilot)

Add to `.vscode/mcp.json`:

```json
{
"servers": {
"cortex": {
"command": "cortex",
"args": ["mcp"]
}
}
}
```

### Without installing the binary

Use the Node.js bridge (no Rust needed):

```bash
npx cortex-mcp-bridge
```

Or with a remote Cortex server:

```json
{
"mcpServers": {
"cortex": {
"command": "node",
"args": ["/path/to/cortex-mcp-bridge.js"],
"env": {
"CORTEX_URL": "http://your-server:9091"
}
}
}
}
```

### What your agent gets

| Tool | Purpose |
|------|---------|
| `cortex_store` | Remember facts, decisions, goals, events, patterns |
| `cortex_search` | Semantic search by meaning |
| `cortex_recall` | Hybrid search (semantic + graph structure) |
| `cortex_briefing` | "What do I need to know?" context document |
| `cortex_traverse` | Explore how concepts connect in the graph |
| `cortex_relate` | Explicitly link related knowledge |
| `cortex_observe` | Record performance metrics for prompt selection |

The briefing tool supports scope: `agent` (default), `shared` (cross-agent),
or `unified` (multi-agent overview for orchestrators).

### Prompt Management

Cortex includes a built-in prompt versioning system with branching, inheritance, and context-aware selection.
Expand Down Expand Up @@ -124,6 +234,7 @@ let results = cx.search("authentication", 5)?;
## Documentation

- **[Quick Start](docs/getting-started/quickstart.md)**
- **[MCP Setup](docs/guides/mcp-setup.md)** -- Claude Code, Cursor, Windsurf, VS Code
- **[Configuration Reference](docs/reference/config.md)**
- **[CLI Reference](docs/reference/cli.md)**
- **[Python SDK](docs/reference/python-sdk.md)**
Expand Down
Binary file added docs/assets/social-preview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
120 changes: 120 additions & 0 deletions docs/assets/social-preview.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading