mayros kg

Query and manage the Cortex knowledge graph. Search triples, list conventions and decisions, trigger code indexing, and explore graph connections.

Global options

  • --cortex-host <host> — Cortex host (default: 127.0.0.1 or from config)
  • --cortex-port <port> — Cortex port (default: 8080 or from config)
  • --cortex-token <token> — Cortex auth token (or set CORTEX_AUTH_TOKEN)

Subcommands

kg search <query>

Natural language search across all triples in the knowledge graph. Returns matching subjects and their connected triples.

Options: --limit <n> (default: 20), --format <fmt> (terminal or json)

kg conventions

List learned project conventions stored in Cortex. Shows the convention text and category (naming, architecture, testing, style, security, etc.).

Options: --format <fmt> (terminal or json)

kg decisions

List recorded architectural decisions with rationale.

Options: --format <fmt> (terminal or json)

kg code

Show the code index status. Use --reindex to trigger a full re-scan.

Options:

FlagDescription
--reindexForce a full re-index of the project
--format <fmt>Output: terminal, json

kg explore <subject>

Explore all triples connected to a specific subject. Useful for understanding relationships in the graph.

Options: --format <fmt> (terminal or json)

kg stats

Show triple counts by type (code index, conventions, decisions, findings, etc.).

Options: --format <fmt> (terminal or json)

kg status

Check Cortex connection health and knowledge graph statistics.

kg explain <tripleId>

Show the provenance of a specific triple — when it was created, by which process, and related context.

Examples

bash
mayros kg search "authentication pattern"
mayros kg conventions
mayros kg decisions
mayros kg code --reindex
mayros kg explore "file:src/index.ts"
mayros kg stats
mayros kg status
mayros kg explain triple-abc123