Skip to content

Latest commit

 

History

History
152 lines (110 loc) · 3.41 KB

File metadata and controls

152 lines (110 loc) · 3.41 KB

Quick Start — 5 Minutes to Memory

This guide gets you from zero to a working Cortex instance in 5 minutes.

1. Install

Linux / macOS (recommended)

curl -sSf https://raw.githubusercontent.com/MikeSquared-Agency/cortex/main/install.sh | sh

The script detects your OS and architecture, downloads the right binary, and places it in ~/.local/bin/ (or /usr/local/bin/ if run as root). No Rust toolchain, no protoc, no system dependencies required.

Via Cargo

cargo install cortex-memory

Docker

docker pull mikesquared/cortex:latest

Manual download

Download a pre-built binary from the latest release:

Platform Architecture File
Linux x86_64 cortex-linux-x86_64.tar.gz
Linux arm64 cortex-linux-arm64.tar.gz
macOS x86_64 cortex-macos-x86_64.tar.gz
macOS arm64 (M1+) cortex-macos-arm64.tar.gz

Extract and place the cortex binary somewhere on your $PATH.

2. Initialise

mkdir my-project && cd my-project
cortex init

Answer the prompts — the defaults work fine for getting started.

3. Start

cortex serve
# Cortex is now running at localhost:9090 (gRPC) and localhost:9091 (HTTP)

4. Store Knowledge

cortex node create \
  --kind fact \
  --title "The API uses JWT authentication" \
  --importance 0.7

5. Search

cortex search "authentication"
# 1. 0.94  fact  The API uses JWT authentication  [id: abc123]

6. Get a Briefing

cortex briefing my-agent

7. Explore the Graph

Open http://localhost:9091/viz in your browser to see a live force-directed visualisation of your knowledge graph.

8. Create a Prompt

cortex prompt migrate prompts.json

Where prompts.json contains:

[
  {
    "slug": "helpful-assistant",
    "type": "system",
    "branch": "main",
    "sections": {
      "identity": "You are a helpful assistant.",
      "constraints": "Be concise and accurate."
    },
    "metadata": {},
    "tags": ["assistant"]
  }
]

Or create prompts via the HTTP API:

curl -X POST http://localhost:9091/prompts \
  -H "Content-Type: application/json" \
  -d '{
    "slug": "helpful-assistant",
    "type": "system",
    "sections": { "identity": "You are a helpful assistant." }
  }'

9. Bind a Prompt to an Agent

# Create an agent node
cortex node create --kind agent --title "my-agent"

# Bind the prompt
cortex agent bind my-agent helpful-assistant --weight 1.0

# Verify the binding
cortex agent show my-agent

10. Select and Observe

# Ask Cortex which variant to use right now
cortex agent select my-agent --task-type coding --sentiment 0.7

# After the interaction, record how it went
cortex agent observe my-agent \
  --variant-id UUID --variant-slug helpful-assistant \
  --sentiment-score 0.8 --task-outcome success

Cortex updates the edge weight using an exponential moving average, so good prompts rise and bad ones fade — automatically.

Next Steps