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
57 changes: 57 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,63 @@ env:
RUST_BACKTRACE: 1

jobs:
sdk-typescript:
name: TypeScript SDK
runs-on: ubuntu-latest
defaults:
run:
working-directory: sdks/typescript
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: "20"
cache: npm
cache-dependency-path: sdks/typescript/package-lock.json

- run: npm ci
- run: npm test -- --runInBand
- run: npm run build
- run: npm pack --dry-run

sdk-python:
name: Python SDK
runs-on: ubuntu-latest
defaults:
run:
working-directory: sdks/python
steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: pip
cache-dependency-path: sdks/python/pyproject.toml

- run: python -m pip install --upgrade build twine
- run: python -m pip install -e '.[dev]'
- run: pytest
- run: python -m build
- run: python -m twine check dist/*

mcp-bridge:
name: MCP bridge package
runs-on: ubuntu-latest
defaults:
run:
working-directory: mcp-bridge
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: "20"

- run: npm test
- run: npm pack --dry-run

test:
name: Test
runs-on: ubuntu-latest
Expand Down
45 changes: 38 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,37 @@ name: Release
on:
push:
tags:
- 'v*'
- "v*"

jobs:
validate-release:
name: Validate release versions
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Verify package versions match the tag
run: |
EXPECTED_VERSION="${GITHUB_REF_NAME#v}"
test "$(node -p "require('./sdks/typescript/package.json').version")" = "$EXPECTED_VERSION"
test "$(node -p "require('./mcp-bridge/package.json').version")" = "$EXPECTED_VERSION"
python - <<'PY'
import os
import pathlib
import tomllib

expected = os.environ["GITHUB_REF_NAME"].removeprefix("v")
root = pathlib.Path(".")
with (root / "sdks/python/pyproject.toml").open("rb") as handle:
assert tomllib.load(handle)["project"]["version"] == expected
with (root / "Cargo.toml").open("rb") as handle:
assert tomllib.load(handle)["workspace"]["package"]["version"] == expected
PY

build:
name: Build ${{ matrix.target }}
runs-on: ${{ matrix.os }}
needs: validate-release
permissions:
contents: read

Expand Down Expand Up @@ -185,13 +210,13 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
python-version: "3.12"

- name: Install build tools
run: pip install hatch twine

- name: Build and publish
run: cd sdks/python && hatch build && twine upload dist/*
run: cd sdks/python && hatch build && twine check dist/* && twine upload dist/*
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
Expand All @@ -200,24 +225,30 @@ jobs:
name: Publish to npm
runs-on: ubuntu-latest
needs: github-release
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
registry-url: 'https://registry.npmjs.org'
node-version: "20"
registry-url: "https://registry.npmjs.org"

- name: Build and publish
run: cd sdks/typescript && npm ci && npm run build && npm publish --access public
run: cd sdks/typescript && npm ci && npm run build && npm publish --access public --provenance
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

publish-mcp-bridge:
name: Publish MCP bridge to npm
runs-on: ubuntu-latest
needs: github-release
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
Expand All @@ -226,6 +257,6 @@ jobs:
registry-url: https://registry.npmjs.org
- name: Publish
working-directory: mcp-bridge
run: npm publish --access public
run: npm publish --access public --provenance
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ Thumbs.db
.fastembed_cache/
node_modules/
**/node_modules/
sdks/typescript/dist/
sdks/python/dist/

# Python / macOS / DB files
__pycache__/
Expand Down
22 changes: 22 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,26 @@

All notable changes to Cortex are documented in this file.

## [0.3.2] - 2026-08-02

### Added

- Public `cortex-memory-client` packages for the TypeScript and Python SDKs.
- Complete npm documentation and metadata for `cortex-mcp-bridge`.
- SDK build, test, and package validation in CI.

### Fixed

- Replaced the unavailable TypeScript scope and the conflicting Python
distribution name with the shared `cortex-memory-client` name.
- Corrected the MCP bridge's default Cortex HTTP port from `19091` to `9091`.
- Updated active examples and documentation so installation commands resolve to
Cortex-owned packages.

## [0.3.1] - 2026-03-21

### Added

- **GitHub templates** -- Bug report, feature request, and PR templates for
community contributions.
- **MCP quickstart guide** -- Step-by-step guide for connecting AI agents to
Expand All @@ -13,6 +30,7 @@ All notable changes to Cortex are documented in this file.
## [0.3.0] - 2026-03-19

### Added

- **Temporal validity** -- Node fields: `valid_from`, `valid_until` for truth windows.
Query with `valid_at()` filter.
- **Lifecycle expiry** -- Node field: `expires_at`. Retention engine auto-sweeps
Expand All @@ -38,6 +56,7 @@ All notable changes to Cortex are documented in this file.
interoperability (`entity_type`, `aliases`, `parent_agent`, `task_id`, etc).

### Changed

- Briefing engine uses role-based config instead of hardcoded section kinds.
- Auto-linker supports entity co-occurrence and entity promotion.
- Retention engine respects `expires_at` field.
Expand All @@ -46,19 +65,22 @@ All notable changes to Cortex are documented in this file.
## [0.2.0] - 2026-03-14

### Added

- **Mutation Hooks** — `MutationHook` trait + `HookRegistry` for node/edge write callbacks. Register hooks to be notified on every create, update, or delete.
- **SSE Event Stream** — `GET /events/stream` with optional `?events=` filter for real-time graph change notifications. Supports `node.created`, `node.updated`, `node.deleted`, `edge.created`, `edge.updated`, `edge.deleted`.
- **Query DSL** — String filter expressions compiled to `NodeFilter`: `kind:decision AND importance>0.7`, `(kind:fact OR kind:pattern) AND tags:architecture`.
- **Schema Validation** — Per-kind metadata schemas in `[schemas.*]` config. Define required fields, types, ranges, and allowed values. Validated at write time via the write gate.

### Changed

- Write gate now runs 4 checks: substance, specificity, conflict, schema.
- HTTP write endpoints now fire mutation hooks (previously gRPC-only). This means SSE events are emitted for all write paths.
- Schema validation is enforced in both HTTP and gRPC write handlers.
- `create_node` and `patch_node` HTTP endpoints now accept a `metadata` field.
- Panicking hooks are isolated via `catch_unwind` to prevent one bad hook from crashing the write path.

### Fixed

- HTTP-created nodes now fire mutation hooks (were silently skipped before).
- Schema validation was defined but not wired into any server write path.

Expand Down
6 changes: 4 additions & 2 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ crates/
cortex-proto/ — Protobuf definitions + generated code.
warren-adapter/ — Optional Warren integration (feature-gated).
sdks/
typescript/ — @cortex/client npm package
python/ — cortex-memory PyPI package
typescript/ — cortex-memory-client npm package
python/ — cortex-memory-client PyPI package (`cortex_memory` import)
go/ — Go client module
specs/ — Design specs (tagged IMPLEMENTED/DEFERRED)
docs/ — User-facing documentation
Expand Down Expand Up @@ -108,6 +108,7 @@ The `test_node_schema_golden` test in `redb_storage.rs` will fail immediately if
format changes without these steps being followed.

**Fields added in evolution (specs 09-10):**

- Node: `valid_from`, `valid_until`, `expires_at`, `embedding_model` (all Option, serde default None)
- Edge: `metadata` (HashMap, serde default empty)
- EdgeProvenance: `Custom { kind, detail }` variant
Expand Down Expand Up @@ -137,6 +138,7 @@ 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.

Expand Down
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ crates/
warren-adapter/ Warren NATS adapter (internal)

sdks/
python/ Python SDK (cortex-memory on PyPI)
typescript/ TypeScript SDK (@cortex-memory/client on npm)
python/ Python SDK (cortex-memory-client on PyPI)
typescript/ TypeScript SDK (cortex-memory-client on npm)
go/ Go SDK

specs/ Phase specifications
Expand Down Expand Up @@ -69,4 +69,4 @@ Use GitHub Issues for bugs and feature requests. For questions, use GitHub Discu

## Releasing

Releases are tagged with `vX.Y.Z`. The CI pipeline publishes to crates.io and Docker Hub automatically on tag push.
Releases are tagged with `vX.Y.Z`. The release pipeline publishes the Rust crates, Python and TypeScript SDKs, MCP bridge, binaries, and Docker image automatically on tag push.
10 changes: 5 additions & 5 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ members = [
]

[workspace.package]
version = "0.3.1"
version = "0.3.2"
edition = "2021"
authors = ["Mike Darlington"]
license = "MIT"
Expand Down Expand Up @@ -77,4 +77,3 @@ proptest = "1.6"
criterion = "0.5"



Loading
Loading