perseus
Perseus is an MCP server that eliminates AI assistant cold-starts by delivering live, verified workspace context. It provides tools for querying environment state, reading files, managing tasks, and coordinating multi-agent workflows.
Context & File Operations
perseus_get_context– Retrieve the full rendered workspace snapshot (services, environment, tasks, memory, health) in markdown or JSON.perseus_read,perseus_list,perseus_tree,perseus_include– Read file contents, list directories, view directory trees, and include/render other files.perseus_env– Read and validate environment variables with fallback support.perseus_date– Get the current date/time in a configurable format.
Health, Drift & Validation
perseus_health,perseus_get_health– Run context-maintenance heuristics (stale skills, duplicate tasks, oversized context warnings).perseus_services– Health-check running services (e.g., Docker containers, APIs) with status and latency.perseus_drift– Detect configuration/context drift.perseus_validate– Validate rendered blocks against JSON schemas.
Memory & Session Management
perseus_waypoint,perseus_session– Retrieve the latest checkpoint summary and recent session digests to recover state.perseus_memory,perseus_mimir– Query narrative project memory (Mnēmē) and recall persistent memories via BM25/FTS5 search.perseus_sibyl,perseus_sibyl_state– Query and surface Sibyl auto-injected structured context documents.
Task & Agent Coordination
perseus_agora– View and filter tasks fromtasks/*.mdby status (open, in_progress, completed, cancelled).perseus_inbox– Read agent messages, with filtering for unread.perseus_skills– List available skills with staleness flags, filterable by category.perseus_auto-skill– Instruct an agent to load a specific skill before beginning work.
Execution & External Tools
perseus_query– Run arbitrary shell commands (requires explicit opt-in).perseus_tool– Execute allowlisted external tools.perseus_perseus– Fetch rendered context from a remote Perseus instance.
Metadata & Architecture
perseus_mason– Generate code architecture concept maps (feature-to-file mappings).perseus_tooltrim– Get filtered tool descriptions and usage statistics.perseus_prompt– Retrieve system prompt blocks.
Provides live context and workspace state to Hermes Agent (by NousResearch), enabling it to start sessions with pre-resolved, verified facts about the workspace.
Perseus™ 🪞 — One command. Zero orientation.
Published on PyPI · Official MCP Registry · Glama · Smithery · Lulu MCPs
pip install perseus-ctx==1.0.26 && cd your-project && perseus quickstart
Zero to rendered context in three lines — no config spelunking:
pip install perseus-ctx==1.0.26 # 1. install
cd your-project && perseus quickstart # 2. scaffold .perseus/context.md + config
perseus render .perseus/context.md -o AGENTS.md # 3. write live context your agent readsquickstart detects your stack, scaffolds .perseus/context.md, writes config,
and verifies a render. Step 3 writes the file your assistant loads at session
start (AGENTS.md, CLAUDE.md, .cursorrules, ...). Keep it live with
perseus watch (or cron/systemd/launchd). Full walkthrough:
Quickstart.
For the one-page product boundary and independent evaluation sequence, see the
Evaluator Guide.
What you get
Live context before the first turn — render current workspace values with their source and freshness boundaries instead of making an assistant rediscover them.
One source, any assistant — write
.perseus/context.mdonce and render to.hermes.md,AGENTS.md,CLAUDE.md,.cursorrules, or another assistant context file.Local-first by default — the core renderer reads your workspace locally; no account or hosted service is required.
MCP-native when you need it — expose the same live context as a stdio or SSE MCP server, with shell-executing tools opt-in.
Context, memory, and session terms
Perseus resolves and shapes the active working context; Perseus Vault owns durable-memory persistence and recall.
Active working context is the current, task-relevant workspace state — files, services, tasks, and other facts that can change. Perseus resolves and shapes it at render time before the assistant sees it.
Durable memory is information intended to survive session boundaries. Perseus Vault owns its persistence and recall.
Recalled memory is the subset of durable memory returned for a query and shaped into the rendered context. The public
@memorydirective remains the compatibility API name for Vault-backed recall; existing MCP compatibility names remain unchanged.Session history is Perseus's recent checkpoint and session-digest record.
@waypointand@sessionexpose it; it is distinct from durable memory. An explicit capture may persist a checkpoint in Perseus Vault as durable memory.
Fastest path
pip install perseus-ctx==1.0.26
cd your-project
perseus quickstartThat creates .perseus/context.md and a project config, detects common stacks,
and verifies the first render. See the 5-minute quickstart
for assistant profiles, refresh options, and security settings.

Perseus is the system around the model: current context, governed memory, and reviewable evidence for consequential agent work.
Perseus Context Engine resolves live workspace state before execution. Perseus Vault carries selected, time-valid memory across sessions. Perseus Ledger records supplied events and evidence references for later review. The operator still chooses the model, keys, data path, deployment, and execution authority.
The current source-checked LongMemEval measurement is the fully offline, judge-free
session-level recall lane in the Perseus Vault repository. On the public _s
split (500 questions, 23,867 ingested sessions), the committed hybrid path reaches
83.2% recall@1, 96.6% recall@3, 98.8% recall@5, 99.8% recall@10, and 0.8949 MRR
against answer_session_ids. This is a company-run retrieval measurement: it is
retrieval-only, not end-to-end QA accuracy; not a customer result, production
validation, independent holdout, or cross-model comparison; the committed report,
harness,
and methodology boundaries are public.
Deprecated answerer/judge experiments are not current product claims. Read the Evaluator Guide and canonical claim registry before reusing a measurement.
🛡️ Platform
Perseus is one platform with three layers. Each layer has a distinct job; together they keep agent work oriented, durable, and reviewable.
Layer | What it does | Page |
Perseus Context Engine | Resolves configured workspace state into a bounded briefing with source and configuration boundaries before the model runs. | |
Perseus Vault | Persists governed memory across sessions with local-first storage, retrieval, and confidence-aware records. | |
Perseus Ledger | Records hash-chained events and evidence so consequential work can be reconstructed and reviewed. |
The benchmarks desk is the proof surface for measured results. It is not a fourth product or a substitute for a customer evaluation.
Perseus Vault — Persistent Memory (MCP)
Perseus Vault is the governed-memory component for Perseus. Its default local stdio path uses SQLite and FTS5 and does not require a Perseus-hosted service or API key. The release binary includes the default local embedding model. Optional connectors and network transports change that boundary and remain under operator configuration. Representative MCP tools include perseus_vault_remember, perseus_vault_recall, perseus_vault_context, perseus_vault_traverse, perseus_vault_decay, perseus_vault_stats, and perseus_vault_health.
📄 Product page → | 📚 Versioned MCP API reference → | ⭐ Vault on GitHub →
Install (v2.23.2, x86_64 Linux; verified before extraction):
set -euo pipefail
workdir="$(mktemp -d)"
trap 'rm -rf "$workdir"' EXIT
archive="$workdir/perseus-vault-x86_64-unknown-linux-gnu.tar.gz"
curl -fSL -o "$archive" https://github.com/Perseus-Computing-LLC/perseus-vault/releases/download/v2.23.2/perseus-vault-x86_64-unknown-linux-gnu.tar.gz
printf '%s %s\n' '7143709aa6c9c29128e5daae47c13ddcc6ec56b35c7a605726b51f635309998e' "$archive" | sha256sum -c -
tar -xzf "$archive" -C "$workdir"
test -f "$workdir/perseus-vault"
mkdir -p "$HOME/.local/bin"
install -m 0755 "$workdir/perseus-vault" "$HOME/.local/bin/perseus-vault"Use the v2.23.2 release page for macOS, Windows, other architectures, and provenance. Then run perseus doctor to confirm Perseus can reach it.
Hermes Agent — add to ~/.hermes/config.yaml:
mcp_servers:
perseus_vault:
command: "perseus-vault"
args: ["serve"]Claude Desktop / Cursor — add to your MCP settings:
{
"mcpServers": {
"perseus_vault": {
"command": "perseus-vault",
"args": ["serve"]
}
}
}Perseus integration — add to .perseus/config.yaml:
perseus_vault:
enabled: true
command: ["perseus-vault", "serve"]The perseus-vault binary self-resolves its canonical default DB path, so no --db argument is needed (its default is ~/.perseus-vault/data/perseus-vault.db). The perseus_vault: configuration block is the sole supported memory configuration. Then add @memory mode=search query="your terms" to .perseus/context.md and Perseus resolves live recall at render time.
Works with any MCP-compatible assistant.
Related MCP server: Context7 MCP
Wire Perseus to Your Assistant (MCP)
Perseus implements the Model Context Protocol (MCP), exposing tools over stdio or SSE transport. Most tools resolve workspace state when invoked, but freshness is tool-specific: the remote Perseus compatibility tool can cache results, waypoint data has a TTL, and explicit cache-enabled paths follow their configured policies.
Stable launcher for MCP and schedulers: Use
~/.local/bin/perseusin shell commands. In JSON/YAML MCPcommandfields, replace~with your home directory because exec-style clients do not perform shell expansion. This install-managed launcher stays stable across package upgrades instead of baking a version-specific Python or Library path into background configuration. Interactive shell commands may still useperseus; verify the resolved entry point withcommand -v perseuswhen diagnosing an installation.
⚠️ Security Gate: Shell-executing directives (
@query,@agent,@services command:) requireexport PERSEUS_ALLOW_DANGEROUS=1. Without it, shell directives are silently skipped.
Quick Start (MCP Server)
pip install perseus-ctx==1.0.26
~/.local/bin/perseus mcp serve # stdio (Claude Desktop, Claude Code, Cursor, Codex)For the loopback-only SSE listener, set a bearer token in the protected Perseus config before launch. The server binds to 127.0.0.1, rejects non-loopback Host headers, and refuses an unauthenticated bind unless the operator explicitly overrides that safeguard. Multi-machine deployments need a separately reviewed authenticated proxy or tunnel:
mcp:
sse_bearer_token: "<secret from your secret manager>"~/.local/bin/perseus mcp serve --transport sse --port 8420Assistant-Specific Wiring
Pick your assistant and add the config block shown:
Hermes Agent (~/.hermes/config.yaml):
mcp_servers:
perseus:
command: /home/yourname/.local/bin/perseus
args: ["mcp", "serve", "--workspace", "/path/to/workspace"]Then verify with hermes mcp test perseus. Tools appear as mcp_perseus_* in your session.
Use an absolute path for
--workspace. Perseus's non-interactive shell context has a limited PATH, so the stable launcher above avoids relying on interactive-shell lookup.
Claude Desktop (claude_desktop_config.json):
{
"mcpServers": {
"perseus": {
"command": "/Users/yourname/.local/bin/perseus",
"args": ["mcp", "serve", "--workspace", "/path/to/workspace"]
}
}
}Claude Code (.mcp.json in your project root):
{
"mcpServers": {
"perseus": {
"command": "/Users/yourname/.local/bin/perseus",
"args": ["mcp", "serve"]
}
}
}Cursor (.cursor/mcp.json):
{
"mcpServers": {
"perseus": {
"command": "/Users/yourname/.local/bin/perseus",
"args": ["mcp", "serve"]
}
}
}Codex (~/.codex/config.toml or per-project .mcp.json):
{
"mcpServers": {
"perseus": {
"command": "/Users/yourname/.local/bin/perseus",
"args": ["mcp", "serve"]
}
}
}Rovo Dev (.mcp.json in repo root):
{
"mcpServers": {
"perseus": {
"command": "/Users/yourname/.local/bin/perseus",
"args": ["mcp", "serve"]
}
}
}Rovo Dev also reads AGENTS.md at session start — pair MCP tools with rendered context for a complete setup.
Docker
docker build -t perseus .
docker run --rm -v /path/to/workspace:/workspace perseus mcp serveSee Container Runtime for full Docker and compose deployment.
MCP Registry
Published as io.github.Perseus-Computing-LLC/perseus on the official MCP Registry (search "perseus"). Includes server.json for zero-config discovery.
Current MCP interface
Perseus Context Engine exposes workspace-context operations over MCP. The current public interface centers on rendering and inspecting context, checking health, reading explicitly allowed workspace sources, and connecting to Perseus Vault for durable memory. Code-level compatibility identifiers are not separate Perseus products.
Sensitive operations that execute a shell command or local agent process are excluded from the default tool set. They require an explicit mcp.tool_allowlist entry and the applicable dangerous-operation gate. They run with the current user's permissions and are not sandboxed.
Use the technical setup guide for host configuration. The Context Engine MCP compatibility reference isolates code-level identifiers from the public product summary. Use the versioned Perseus Vault MCP reference for the release-bound Vault tool surface.
The Problem
Every AI assistant session starts cold. Before useful work begins, the assistant burns turns on orientation — checking which services are running, reading stale config files, rediscovering where you left off. Static markdown files (.cursorrules, CLAUDE.md) rot immediately. The port you wrote down has changed. The container that was "always running" hasn't been started since Tuesday.
Stale context isn't neutral. It's drag.
The Fix: Resolve Before Context
Perseus is a pre-processor. You write directives in a source document — @query, @services, @waypoint — and Perseus resolves them at render time, then outputs plain markdown. The assistant receives the rendered values together with the source and configuration boundaries that produced them.
Without Perseus With Perseus
──────────────────────────────── ──────────────────────────────────
"Port is 3001 (check .env)" → Port: 3001
"47 tests (may be stale)" → Tests: all passing (run 8s ago)
"Check docker ps first" → mongo-dev: Up 4h 12m
"Where did we leave off?" → Checkpoint: webhook handler written,
pending test runPerseus replaces your assistant's context file — CLAUDE.md, .cursorrules, AGENTS.md, .hermes.md — with rendered live context. If you already have a hand-written context file, migrate its static content into .perseus/context.md first. Perseus overwrites the output file on every render. Add @perseus to line 1 of your source and it becomes live. The assistant never sees directive syntax. It sees a rendered snapshot whose freshness depends on the source, configuration, and runtime availability.
Quick Start (30 Seconds to Live Context)
perseus quickstart # auto-detects project, scaffolds context, rendersSmart init detects your stack and tailors the setup:
Python →
@memoryqueries for test patterns, type annotationsRust → trait bounds, lifetime annotations, cargo config
Node.js/TS → npm scripts, ESLint config, component patterns
Go, Java, C/C++, Docker — all detected automatically
Falls back to a sensible generic query when unknown
The output file name is the only assistant-specific detail:
Assistant | Output file |
Claude Code |
|
Hermes Agent |
|
Cursor |
|
Codex |
|
Rovo Dev |
|
Any other | Whatever your assistant reads at session start |
Hermes priority order:
.hermes.md→AGENTS.md→CLAUDE.md. Render to.hermes.mdfor highest priority.
Keep it fresh with cron, launchd, systemd, or perseus watch:
# Linux systemd (auto-refresh every 5 minutes)
~/.local/bin/perseus systemd create .perseus/context.md --output AGENTS.md --interval 5m --install --enable
# macOS launchd
~/.local/bin/perseus launchd create .perseus/context.md --output AGENTS.md
# Cron (any POSIX host)
~/.local/bin/perseus cron create .perseus/context.md --output AGENTS.md --every 5 --installSee the file-based Hermes integration guide for generated context-file setup and adapter patterns for full integration details.
Why Perseus? (Proof, Hardening, and Enterprise Value)
Perseus delivers context rendered from configured sources, with freshness limits made visible, so AI assistants spend fewer turns orienting themselves. Here's how it stands up:
Performance & efficiency
Current public measurements belong in the methods desk and claims registry. Each reusable figure must keep its method, dataset, denominator, control, and limitation attached.
Reliability & Security
Perseus is tested against edge cases that challenge the resolve-before-context contract. The current security boundary and documented posture live in SECURITY.md and on the public security page:
MCP SSE bearer-token auth —
POST /messagerequires Bearer token viamcp.sse_bearer_tokenconfig key (falls back toserve.auth_tokenfor backward compat). Unauthenticated requests receive 401.Platform-portable MCP timeout —
_call_tool()usesThreadPoolExecutor+Future.result(timeout=...)instead of Unix-only SIGALRM. Works on Windows, macOS, and Linux.
Platform support: Perseus is developed and CI-tested on Linux. macOS is supported but not in CI. Windows core rendering, MCP transport, and Task Scheduler integration work with known POSIX-specific shell, path, and LSP caveats.
Foreign resolver SSRF protection — URL allowlist via
foreign_resolver.url_allowlist, private-IP blocking (block_private_ips, default true), HMAC signature verification (verify_signaturesnow defaults to true, minimum 32-char secret). Redirects re-check destination IPs. Localhost (127.0.0.1, ::1) explicitly allowed for local testing.Workspace boundaries — Symlink escapes (direct, relative, chained, to
/etc) are all blocked. The trust-gate resolves symlinks to their real target before checking boundaries.Context overflow protection —
@readand@includewarn and truncate when files exceedmax_read_bytes/max_include_bytes(512 KB default,Nonefor unlimited).Transitive resolution —
@includeon.mdfiles recursively renders directives up tomax_include_depth(default 5), with cycle detection.Integrity drift — Optional
integrity_checkcaptures file mtimes before render and warns if any file changed mid-resolution.Plugin permission gating — Plugin directives with
executes_shell=Trueare gated behindallow_query_shell, like built-ins. This is a permission gate, not a sandbox: enabled plugin code runs with the current user's permissions. Plugin errors are caught and surfaced as inline warnings.
Edge-case tests cover circular dependencies, race conditions, symlink escapes, and context overflow. These four config knobs live under render: in ~/.perseus/config.yaml.
Perseus reads from a live filesystem — there is no snapshot isolation unless you enable integrity_check. Files can change between directive resolutions. The render output reflects whatever was on disk at the moment each directive resolved, not a single atomic point-in-time. This is the documented tradeoff for a local pre-processor (low overhead by default, check when it matters), but it is not a database transaction.
The O_CREAT | O_EXCL checkpoint locking is atomic on local POSIX filesystems. Network filesystems (NFS < v4, SMB, cloud mounts) may not honor these semantics — if you run a multi-agent relay across machines, use a local disk or a filesystem with verified atomic-create support.
perseus.py is a compiled build artifact produced by scripts/build.py from the modular src/perseus/ tree. It is not hand-maintained as a single file. The source modules are the canonical form.
Research references
The architecture draws on published work about context contracts, governed selection, structured context, and protocol security. Those papers motivate design questions; they do not validate Perseus products or supply reusable Perseus benchmark claims.
Use the public methods desk and claims.json for current Perseus measurements, controls, denominators, and limitations.
How Perseus Works
The first line in this illustrative syntax sample is the directive protocol marker, not the installed package version. Dates, task names, and rendered values below are examples, not current release or test evidence:
@perseus v1.0.8
# Context — @date format="YYYY-MM-DD HH:mm z"
## What's Running
@query "docker ps --format 'table {{.Names}}\t{{.Status}}'"
## Last Session
@waypoint ttl=86400
## Ports
@read .env key="API_PORT" fallback="3001"
## Active Tasks
@agora status=open,in_progress
## Skills Available
@skills flag_stale=true category=devops,github
## Project Memory
@memory focus="recent"Perseus renders this:
# Context — 2026-05-27 08:33 CDT
## What's Running
mongo-dev Up 4 hours
redis-dev Up 4 hours
## Last Session
Checkpoint written: 2026-05-27T08:28
Task: webhook handler — written, pending test run
Next: run pytest tests/test_webhook.py
## Ports
3001
## Active Tasks
| ID | Title | Status | Scope |
|---|---|---|---|
| task-08 | List and Tree Directives | Complete | medium |
| task-12 | Perseus Vault Narrative Memory | Complete | large |
## Skills Available
| Skill | Category | Updated |
|---|---|---|
| hermes-agent | autonomous-ai-agents | 2026-05-20 |
| github-pr-workflow | github | 2026-05-15 |
| docker-stack-auditing ⚠ | devops | 2026-03-01 |
| documentation-audit | software-development | 2026-05-26 |
## Project Memory
### Recent
- [Illustrative] Reviewed a retry classification and shell-input hardening change.
- [Illustrative] Added an MCP integration path for a project workspace.
- [Illustrative] Published an earlier package release.
- [Illustrative] Added plugin directives, macros, hooks, and pipes.The assistant never sees a directive. It sees a rendered snapshot of which skills are available, which tasks are open, and what decisions were recently made; those values should be checked against their source and freshness limits.
Extensibility in Practice
Macros reduce repetition. Pipes compose. Aliases keep things short:
@macro health-check %service%
@query "curl -s http://%service%:8080/health"
@services
- name: %service%
url: http://%service%:8080/health
@endmacro
@q "git log --oneline -5" | @cache ttl=300
@health-check my-apiThe assistant sees resolved output — never a directive.
Full directive reference: docs/DIRECTIVES.md.
Session Waypoints
If an agent session crashes or a connection drops, Waypoints preserve the execution state.
perseus checkpoint \
--task "Implementing webhook integration" \
--status "handler written, pending test run" \
--next "run pytest tests/test_webhook.py" \
--workspace /workspace/myprojectThe next session recovers immediately with perseus recover — workspace-aware, freshness-gated, no re-orientation.
Composition boundary
Perseus Context Engine writes bounded context artifacts and workspace checkpoints. Other systems can read those files to coordinate work, but the Context Engine is not an orchestration platform and the repository does not claim an enterprise deployment from that composition pattern.
Architecture
operator-authored context source
|
v
Perseus Context Engine
- validates enabled directives
- resolves allowed local sources
- gates optional shell and network operations
- emits bounded markdown plus diagnostics
|
+--> compatible assistant host
+--> optional Perseus Vault recall
+--> optional Perseus Ledger evidence recordPerseus Vault and Perseus Ledger remain separate components. Extensions, hooks, custom directives, and external service checks execute only when the operator configures them; they inherit the current user's permissions and can change the local-only data boundary.
Tiered Context (Progressive Disclosure)
Not every question needs the full environment injected. A "what's 2+2?" shouldn't pull in Docker health checks, skill listings, and session digests. Perseus now ships tiered context rendering — the agent is the RAG.
perseus render .perseus/context.md --tier 1 # core context (~12 directives, lean)
perseus render .perseus/context.md --tier 2 # + services, skills, sessions
perseus render .perseus/context.md # everything (backward compatible)Three tiers, assigned per directive in the registry:
Tier | Name | What goes here |
1 | Always | Core context — lightweight, always needed ( |
2 | Conditional | Task-specific, heavier ( |
3 | On-Demand | Bulky/expensive — the agent pulls it if needed ( |
Directives above the tier limit are skipped and reported in a Context Manifest:
> 📋 Context Manifest — Tier limit: 1
>
> • @services (Tier 2 / Conditional) — Health-check listed services
> • @skills (Tier 2 / Conditional) — List available skills
> • @query (Tier 3 / On-Demand) — Run a shell command and embed stdout
>
> Re-run with `perseus render --tier 2` for conditional context,
> or `--tier 3` for full context on demand.Template authors can override per-instance with @tier:N:
@services @tier:1 # Always resolve this block, even though @services defaults to Tier 2
docker
nginx
@endSet render.default_tier: 1 in ~/.perseus/config.yaml to make lean context the default for all renders. No embedding model, no LLM routing — one integer comparison per directive gates resolution. The agent sees what's available and can pull it on demand.
Prompt-Size Forensics (perseus prompt-size + @budget)
Context is the scarcest resource in agent systems — and it's usually spent blind. perseus prompt-size renders a context and shows exactly where every byte went, attributed per directive, with a static-vs-dynamic split:
perseus prompt-size .perseus/context.md # human table, largest offenders first
perseus prompt-size .perseus/context.md --json # stable, deterministic JSON for CI diffing
perseus prompt-size .perseus/context.md --since HEAD~5 # per-directive budget delta vs a git refperseus prompt-size: context.md (tier 3)
total: 5950 bytes, 2270 tokens [tiktoken:cl100k_base — exact]
split: static 43 B / cacheable 45 B / volatile 5862 B (attributed 5907 + static 43 = 5950 — exact)
Per directive (largest first):
5862 B 2249 tok 98.52% [ volatile] @env PATH line 7
45 B 9 tok 0.76% [cacheable] @include "sub.md" line 8Byte-exact accounting — per-directive bytes + static template bytes sum to the rendered total with no unattributed remainder (the
accounting.exactfield asserts this in--json).Tokenizer-aware — real BPE counts via
tiktoken(cl100k_base) when it happens to be installed (labeledexact); otherwise a deterministic offline heuristic clearly labeledestimate. Never a network call.Static vs. dynamic split — see how much of the render is a cacheable prefix vs. per-render volatility (
@env,@date,@query).--since <git-ref>diff mode — renders the file's content at the ref (viagit show, offline) and reports which directive's contribution grew, so "someone added an@includethat doubled the prompt" is caught in review.
Pair it with a @budget declaration in the source to gate context bloat in CI:
@perseus
@budget max=8000 strict forensic
...perseus prompt-size checks every @budget after the render: under budget passes silently; over budget warns with the per-directive offender breakdown — or exits non-zero when the declaration says strict (or the CLI is invoked with --strict). forensic expands the overflow report to the full per-directive table plus the static/cacheable/volatile split. The directive itself renders as empty text, so it costs nothing in the context it guards.
Scope contract: @budget declarations are read from the top-level source text before conditionals are evaluated — top-level only. A @budget inside an @include'd file is not enforced (prompt-size warns and reports it under included_budgets in --json); a @budget inside a false @if branch is still enforced, because the scan is text-level. In --json output, static.tokens is derived (total − Σ per-directive tokens, clamped at 0 and flagged tokens_derived) — the byte accounting is the measured, exact invariant.
Directive Aliases
Config-driven shorthand — single-pass, no recursive expansion:
# ~/.perseus/config.yaml
directives:
aliases:
"@q": "@query"
"@svc": "@services"
"@stale-skills": "@skills flag_stale=true category=all"Pre-defined aliases: @q→@query, @r→@read, @svc→@services, @mb→@memory,
@ag→@agora, @wp→@waypoint, @sess→@session. Config aliases override them.
Custom Schema Validators
Plugin validators for domain-specific schemas:
@query "cat endpoints.yaml" schema="plugin:endpoint_list"Validator modules in ~/.perseus/validators/ export a validate(value, schema_def)
function returning (valid: bool, message: str).
Event Webhooks
POST render lifecycle events to an external URL with optional HMAC-SHA256 signing:
webhooks:
enabled: true
url: "https://hooks.example.com/perseus-events"
secret: "your-hmac-key"
events:
- on_render_start
- on_render_complete
- on_directive_errorSpeculative Prefetch (@speculate)
Speculative execution for context assembly (#607): a transparent Markov / frequency predictor over your recorded waypoint (checkpoint) transitions predicts the next task, and Perseus pre-warms that task's context after the current render completes — so the first render of the next turn is already hot. No ML dependencies; the predictor interface is pluggable for a future LLM backend.
Off by default. Enable it in config and opt a source in with the pragma:
# ~/.perseus/config.yaml
speculate:
enabled: true # master gate — default false (zero behavior change)
k: 3 # top-k predicted next intents to consider
budget_tokens: 2000 # cumulative token budget per speculation pass
confidence_threshold: 0.30 # only warm predictions at/above this probability
intents: # intent pattern (fnmatch) → prefetch directive line(s)
"deploy*":
- '@read "runbook.md" @cache ttl=300'
"review*":
- '@query "git log --oneline -10" @cache ttl=120'@perseus v1
Your context here...
@speculate k=3 budget=2000The @speculate pragma never appears in rendered output; k= / budget=
override the config for that source. Speculation is synchronous-after-render:
it can never delay or interleave with the live render, and a failure inside
speculation never breaks a render.
Cache safety: speculative warms run through the same prefetch executor and use the exact key derivation the renderer reads (workspace-scoped base key + dependency fingerprint), so a speculative entry is just an early warm — it can never shadow or poison real reads. On the real turn the renderer re-derives the fingerprint and TTL as usual, so a wrong prediction costs nothing.
Observability:
$ perseus explain --speculate
Speculate: enabled=true backend=markov k=3 threshold=0.30
History: 42 intent(s); current: review PR
Predicted next intents:
1. deploy staging p=0.67 [1 candidate(s), 1 warm]
- warm: @read "runbook.md" @cache ttl=300
Past speculation: hits=12 misses=4 hit_rate=0.75 (settled=16)Prediction outcomes (hit/miss per settled prediction, budget spend, warm
results) persist to a workspace-keyed stats file
(<cache_dir>/speculate_stats-<workspace_hash>.json, atomic writes) with a
documented shape — a future @bandit ledger integration can consume it as a
value signal.
Context profiles and durable-memory boundary
Perseus Context Engine resolves and shapes the active working context. Perseus Vault owns durable-memory persistence and recall. The default on_demand profile adds a retrieval pointer instead of preloading a memory dump; relevant and legacy always modes require explicit configuration.
profiles:
default: { context_target: 200000, memory: on_demand }An explicit @memory directive is a code-level compatibility interface for requesting recalled memory. It is not a separate product. Recalled material can be stale or incomplete, so live workspace state and operator policy remain authoritative.
To disable automatic recall pointers, set perseus_vault.auto_inject: false. See the setup guide and the versioned Vault API reference for the current boundary.
Full Documentation
Document | What it covers |
Every command and flag | |
The definitive setup, config, automation, and troubleshooting guide | |
All directives with modifiers and examples | |
Generate context files for Hermes | |
Wire Perseus to any AI assistant | |
Docker and compose deployment | |
5-minute setup walkthrough | |
Guarantees, trust model, permissions | |
Dev setup, test suite, commit conventions | |
End-to-end workflow recipes | |
Real-world usage patterns | |
Benchmark methodology and results | |
JSON contracts for agent consumption | |
Current deployment guidance with pinned versions | |
Trust model, workspace boundaries, secrets | |
Living roadmap (live |
Defense and Government
Perseus Computing LLC can contribute current context, governed memory, and reviewable evidence around a prime-led or program-owned workflow. It does not replace the mission system, qualified integrator, approving authority, or accreditation process.
Record | Current public scope |
Company identifiers | UEI |
Assessment evidence | Owner-held NIST SP 800-171 Basic and CMMC Level 2 self-assessments scored 110 for their recorded enclave scope. These are company self-assessments, not independent assessments or C3PAO certification. |
JCP / DD2345 | Certification |
Software publication | MIT-licensed source, SBOM, and security materials are published. Publication does not create Government approval or accreditation. |
Deployment boundary | Local CLI and stdio paths do not require a Perseus-hosted service. A program or integrator remains responsible for packaging, hardening, keys, networks, data handling, testing, and authorization. |
Review the bounded Defense and Government page or contact Perseus Computing LLC at perseus@perseus.observer.
IP & Legal
Patent Pending. A provisional patent application covering Perseus's resolve-before-context pipeline architecture is on file with the USPTO. See docs/ip/ for the public IP portfolio, including technical disclosures and evidence exhibits.
PERSEUS™ identifies software published by Perseus Computing LLC. Internal subsystem names are compatibility identifiers, not separate public product lines.
Privacy Policy
Perseus Context Engine has a local default render path. Authored network directives, optional transports, and external integrations change that boundary.
Data Collection
The default local renderer does not send Perseus telemetry or require a Perseus-hosted service.
Operators choose the sources, output paths, network directives, and integrations they enable.
Data Usage & Storage
Perseus reads project files, git state, and environment variables to resolve context directives.
On the default local path, project data remains in the operator environment. Authored HTTP directives or external integrations can send operator-selected data to their configured destination.
When paired with Perseus Vault for persistent memory, memory data is stored locally per the Perseus Vault privacy policy.
Third-Party Sharing
The local default path does not share project data with Perseus Computing LLC.
Optional MCP servers, HTTP directives, package registries, and other external services apply their own data and transport policies when the operator enables them.
Data Retention
Perseus does not retain data independently. Rendered context is ephemeral and regenerated on each invocation.
For persistent memory, see Perseus Vault's privacy policy.
Contact
Email: perseus@perseus.observer
GitHub: Perseus-Computing-LLC/perseus
License
License: MIT — see LICENSE. This license does not include a patent grant; patent rights are reserved separately.
Third-party notices: see NOTICE.
Available Tools
33 toolsperseus_agoraARead-only
List tasks from the project task board (tasks/*.md files). Use to see what is open, in progress, or completed. Filter by status. Read-only; returns task array with id, title, status, scope.
Inputs: status. Returns: tasks
perseus_auto_skillARead-only
Instruct the agent to load a specific skill before starting work. Use at the top of context documents to enforce critical hygiene skills (e.g., memory-hygiene, agent-safety). Renders as a mandatory instruction block. Read-only.
Inputs: skill. Returns: rendered
perseus_budgetARead-only
Declare a token budget for the rendered context (renders as empty text). Enforced by perseus prompt-size: an over-budget render warns — or fails with strict — with a per-directive byte/token breakdown (#606). Declarations are read from source text before conditionals are evaluated; top-level only — a @budget inside an @include'd file is not enforced (prompt-size warns) (#626). Read-only.
Inputs: max, strict, forensic.
perseus_captureARead-onlyDestructive
Write recent session checkpoints to Perseus Vault as durable memories (#713) — the write side of the memory loop, symmetric to @memory recall. Idempotent per checkpoint (re-render upserts, never duplicates). Use at session boundaries so lessons persist immediately instead of waiting for a scheduled harvest. WRITES to the vault; never cached.
Inputs: limit.
perseus_context_diffARead-onlyDestructive
Render a compact 'Since last session' delta (#714): git branch/commits, Agora task-board changes, new inbox messages, new checkpoints, and new vault session memories since the last recorded snapshot. Use at the top of a context document so the assistant spends zero turns re-orienting on unchanged state. Maintains its own per-workspace snapshot (refresh debounced by render.context_diff_min_age_s); reset=true forces a new baseline. Never cached.
Inputs: reset.
perseus_dateARead-only
Current date/time
Inputs: format. Returns: unix, iso8601, datetime
perseus_driftARead-only
Detect drift between predicted and actual tool usage patterns via the Pythia oracle. Use when tool behavior seems off or after config changes. For workspace hygiene checks, prefer perseus_health. Read-only; returns a markdown drift report.
Inputs: args. Returns: rendered
perseus_envCRead-only
Embed environment variable
Inputs: schema, fallback, required. Returns: value, source, variable
perseus_focusADestructive
The global-workspace tier: a small, capacity-bounded (default 32), salience-ranked set of items Perseus broadcasts into context — the shared 'what I'm working on now' set for the agent and its subagents. With no args, renders the current working set. add=/pin= admit items; the lowest-salience non-pinned items are evicted when it overflows. Distinct from long-term recall (@mimir/@memory): bounded and actively maintained, not unbounded memory.
Inputs: add, pin, drop, clear, +4 more.
perseus_get_contextARead-only
Return the full rendered Perseus context for the workspace.
Inputs: format. Returns: format, rendered
perseus_get_healthARead-only
Run Daedalus context-maintenance heuristics — cache health, directive resolution stats, memory integrity check.
Inputs: no named parameters. Returns: report, status
perseus_healthARead-only
Audit workspace context health: stale skills, duplicate tasks, oversized output. Use before starting work to catch drift. For deep Daedalus heuristics (cache, directive stats), use perseus_get_health. Read-only; returns status enum and metric counts.
Inputs: args. Returns: checks, status, stale_skills, duplicate_tasks, +1 more
perseus_inboxARead-only
Read agent-to-agent messages from the workspace inbox. Use to check for coordination messages from other agents. Filter to unread only. Read-only; returns message array with read/unread status.
Inputs: limit, unread. Returns: messages, unread_count
perseus_includeARead-only
Include and render another Perseus source file, recursively resolving its directives. Use to compose context from multiple files or share common sections across workspaces. Bound a growing file with last=N (final N lines) or since=14d/2w/24h (recent dated sections only). Use mode=reference (or render.host_loaded_paths) to emit a one-line pointer instead of inlining files the host agent already loads natively. Read-only; resolved directives inherit the parent configuration.
Inputs: path (required), last, mode, since. Returns: source, rendered
perseus_listARead-only
List directory contents or structured data. Use to discover files before reading with perseus_read. Supports sorting by name, modified time, or size. Read-only; for hierarchical view, prefer perseus_tree.
Inputs: path (required), sort, limit. Returns: count, entries
perseus_masonARead-only
Query the Mason code architecture concept map to find which files implement a feature. Use before editing code to understand where changes should go. Read-only; returns concept map and mapped file list.
Inputs: query. Returns: files, concept_map
perseus_memoryARead-only
Search LOCAL project memory (FTS5, zero-network) for past decisions and architecture notes. Use for in-workspace recall. For cross-session persistent facts, use perseus_mneme instead. Read-only; returns results array with mode and count.
Inputs: k, mode, type, alias, +11 more. Returns: mode, count, results
perseus_mimirARead-only
Query the EXTERNAL Mneme memory server for cross-session, curated facts that survive across workspaces. Use for long-lived knowledge (bug patterns, design decisions). For fast local recall, prefer perseus_memory. Read-only; falls back to local FTS5 if Mneme is unreachable. (Also exposed as perseus_mneme; perseus_mimir is a deprecated alias.)
Inputs: k, type, query, scope. Returns: count, query, results
perseus_mnemeARead-only
Query the EXTERNAL Mneme memory server for cross-session, curated facts that survive across workspaces. Use for long-lived knowledge (bug patterns, design decisions). For fast local recall, prefer perseus_memory. Read-only; falls back to local FTS5 if Mneme is unreachable. This is the primary name for this tool; perseus_mimir is a deprecated alias kept for backward compatibility.
Inputs: k, type, query, scope. Returns: count, query, results
perseus_perseusARead-only
Fetch rendered context from a remote Perseus instance by URL. Use to pull live workspace state from another machine or container. Read-only; caches results — re-fetch when remote state may have changed.
Inputs: url. Returns: rendered, source_url
perseus_profileARead-only
Select the per-model context profile for this document (#608): sets the context target and memory posture (on_demand/relevant/always) used by the automatic memory injection layer. Use at the top of a context document, e.g. @profile claude-sonnet-4-6. Unknown names fall back to the default profile. First-wins (#627): with multiple @profile lines only the first non-fenced one governs — later banners are marked ignored, and @profile inside a code fence is documentation, never a directive. Read-only.
Inputs: model.
perseus_promptARead-only
Define a system prompt block that instructs the AI assistant about how to use the rendered context. Use to set behavioral rules, memory hygiene gates, or context interpretation guidelines. Read-only; rendered as-is into the output.
Inputs: args. Returns: rendered
perseus_readARead-only
Read and embed file contents into the rendered context. Use to inject config values, environment files, or any text file. Can extract specific keys from structured files. Read-only; use perseus_list or perseus_tree to browse before reading.
Inputs: path (required), key, schema, fallback. Returns: path, content, truncated
perseus_researchA
Search an EXTERNAL paper-search MCP server (BGPT by default) for scientific literature and inject per-paper Methods/Results blocks. Use to ground claims in published studies. Self-gates on research.enabled; degrades gracefully when the provider is unreachable. Read-only; speaks JSON-RPC over stdio (no shell).
Inputs: limit.
perseus_servicesADestructive
Health-check all services listed in the workspace context (HTTP endpoints, Docker containers, shell commands). Use to verify the environment is healthy before starting work. May make network calls and execute shell commands per service definition — side effects depend on configured checks.
Inputs: args. Returns: services
perseus_sessionARead-only
List recent session digests with task summaries and outcomes. Use to understand what was done recently across sessions. For the single most recent checkpoint, prefer perseus_waypoint. Read-only; returns session array with count.
Inputs: count. Returns: count, sessions
perseus_skillsARead-only
List available skills with descriptions and freshness status. Use to discover what capabilities are installed. Filter by category for smaller output. Read-only; stale skills flagged automatically.
Inputs: limit, category, flag_stale. Returns: skills
perseus_tokensCDestructive
Embed token budget for rendered context
Inputs: args.
perseus_toolADestructive
Run an external tool that has been allowlisted in the Perseus configuration. Use for approved integrations only. Requires the tool name to be present in the allowlist. Destructive — executes the tool with the user's permissions.
Inputs: name (required). Returns: output, exit_code
perseus_tooltrimARead-only
Return filtered toolset metadata and usage statistics. Use to understand what tools are available and how they are being used. For full tool metadata, set full=true. Read-only; stats mode returns aggregated counts.
Inputs: full, stats. Returns: count, tools
perseus_treeARead-only
Display a directory tree with configurable depth. Use to understand project structure at a glance. For flat file listings with metadata, use perseus_list instead. Read-only; depth limits control output size.
Inputs: path (required), depth. Returns: root, tree
perseus_validateARead-only
Validate a rendered block against a JSON Schema. Use to enforce structure on configuration blocks, task definitions, or any schema-constrained section. Read-only; returns pass/fail with error messages.
Inputs: schema. Returns: valid, errors
perseus_waypointARead-only
Return the most recent session checkpoint: what was being worked on, status, and next steps. Use at session start to resume where you left off. Stale after TTL (default 24h). Read-only; lightweight — call freely.
Inputs: ttl. Returns: stale, timestamp, checkpoint
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 33 tools
Most tools have a distinct purpose, but several pairs overlap: perseus_health/perseus_get_health, local vs external memory (perseus_memory/perseus_mneme/perseus_mimir alias), and perseus_tokens/perseus_budget. Descriptions usually clarify the boundary, but an agent could still mis-select between related recall, health, and token-budget tools.
All tools share the perseus_ prefix and lowercase style, which is helpful, but the second half mixes nouns (tokens, health, profile), verbs (read, include, capture), and quirky names (perseus_perseus, tooltrim, get_health vs health). The pattern is readable but not consistent enough to predict tool names.
33 tools is well beyond the comfortable 3-15 range and even past the 25-tool threshold for 'too many'. Many are small directives or niche utilities that could be consolidated; the count dilutes the server's coherence.
The core context lifecycle is well covered: render (get_context/include/read), configure (profile/prompt/budget), recall (memory/session/waypoint), and health-check (health/drift). Notable gaps are mostly read-only surfaces like tasks, inbox, and skills, which have no write/manage counterparts, but these feel outside the server's primary context-rendering purpose.
Maintenance
Related MCP Connectors
MCP server for your apps' tools and custom tools, plus hosted AI agents and approval-gated workflows
Nifty's MCP server — exposes tasks, projects, messages, and files as tools for AI agents.
AI Reasoning Cache & Consensus Layer with 11 MCP tools via Streamable HTTP.
Self-hosted AI workspace: semantic RAG document search, long-term memory, and AI chat via MCP.
Related MCP Servers
- FlicenseAqualityBmaintenanceNode.js server implementing Model Context Protocol (MCP) for filesystem operations.70141,381,610 npm91,897-
- AlicenseAqualityBmaintenanceA Model Context Protocol server that fetches up-to-date, version-specific documentation and code examples from libraries directly into LLM prompts, helping developers get accurate answers without outdated or hallucinated information.21,132,421 npm64,431MIT
- AlicenseAqualityDmaintenanceSimple sequential thinking MCP in python1128 PyPI5MIT
- AlicenseBqualityCmaintenanceA local-first, agent-agnostic MCP server that provides semantic search, persistent memory, and automated code review capabilities for development workflows. It leverages the Auggie SDK to offer advanced tools for codebase indexing, implementation planning, and deterministic static analysis.5248MIT