Cortex Intelligent
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| SEARCH_MODE | No | Search mode: hybrid, vector, or keyword. | hybrid |
| CORTEX_MODEL | No | Override model. | (auto) |
| CORTEX_DB_DIR | No | SQLite store location. | .cortex-data |
| EMBEDDING_MODEL | No | Embedding model. | Xenova/all-MiniLM-L6-v2 |
| EMBEDDING_PROVIDER | No | Embedding provider: local or transformers. | local |
| CORTEX_TIER_OVERRIDE | No | Override model tier. | (auto) |
| CORTEX_PROVISION_BACKUP | No | Backup before write. | 1 |
| CORTEX_VERIFY_ALLOWLIST | No | Verification commands allowlist. | npm test,npm run lint,npm run typecheck |
| CORTEX_GUARDRAILS_STRICT | No | Enforce guardrails. | 1 |
| CORTEX_VERIFY_TIMEOUT_MS | No | Verification timeout in milliseconds. | 300000 |
| KB_MEMORY_HALF_LIFE_DAYS | No | Memory decay half-life in days. | 14 |
| CORTEX_SELF_CRITIQUE_MAX_ITERS | No | Maximum self-critique iterations. | 3 |
| CORTEX_SELF_CRITIQUE_THRESHOLD | No | Self-critique revision threshold. | 0.8 |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
This server publishes no instructions, or was last inspected before Glama recorded them.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": true
} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| system_statsA | Get overall system stats: DB location, documents, chunks, memories, tokens, embedding backend |
| lsp_diagnosticsB | Run language-server-style diagnostics (tsc/pyright/cargo check/go vet) and return structured, location-aware issues. |
| webfetchB | Fetch a public http/https URL and return its title + readable text. Private/loopback hosts are refused. Use |
| browser_fetchB | Fetch a URL using a headless browser (JS-rendered, screenshots). Requires optional playwright/puppeteer; falls back to webfetch when unavailable. |
| webfetch_validateA | Validate a URL for webfetch (protocol + SSRF guard) without fetching it. |
| knowledge_reindexA | Re-embed every stored vector for the currently configured EMBEDDING_PROVIDER/MODEL. Use after changing the embedding model or dimension to migrate the existing store in place instead of wiping and re-ingesting. Searches are blocked while it runs; re-run to resume after an interruption. |
| knowledge_backupA | Snapshot the store to a consistent SQLite file (VACUUM INTO, safe under WAL) and report its integrity. Refuses to overwrite an existing file. Restore is done offline via 'cli restore ' while the server is stopped. |
| knowledge_ingest_textB | Store raw text as a knowledge document (chunked + embedded for later retrieval) |
| knowledge_ingest_fileC | Read a file and store it as a knowledge document. Honours KB_ALLOWED_DIRS when set. |
| knowledge_ingest_dirC | Recursively ingest supported source files from a directory |
| knowledge_searchA | Hybrid semantic + keyword search over stored documents. Returns chunks ranked by relevance with scores. Set explain to see per-leg scores (vector cosine, keyword BM25, RRF contribution) and diagnose ranking. Optional alpha (0..1) tips the balance: 0 = keyword-only, 1 = vector-only, in between blends 'alpha * cosine + (1-alpha) * BM25'. Default uses Reciprocal Rank Fusion. |
| knowledge_retrieveA | Retrieve relevant context chunks as a ready-to-inject context block for the LLM. Prefer this over knowledge_search when the result will be used as context. |
| knowledge_list_documentsB | List stored knowledge documents (newest first, paginated) |
| knowledge_document_statsC | Document storage statistics |
| knowledge_delete_documentC | Delete a document and all its chunks by ID |
| knowledge_sync_sessionA | Ingest an opencode session's user inputs (or the latest active session) into the knowledge store as searchable documents. Use with the session id from opencode, or omit session_id and pass directory to auto-pick the most recent session in that workspace. |
| memory_rememberB | Store a piece of long-term memory (fact, decision, preference, instruction, task, insight, conversation). Use this to persist things that should be remembered across sessions. |
| memory_recallC | Semantically search long-term memories relevant to a query. This is how you remember past context. |
| memory_listB | List memories, optionally filtered by type, tag, or minimum importance |
| memory_getC | Get a single memory by ID |
| memory_updateC | Update content / type / importance / tags of an existing memory |
| memory_forgetC | Delete a memory by ID |
| memory_consolidateA | Deduplicate near-identical memories, boost frequently-used ones, and optionally prune stale memories (enable with env KB_PRUNE=1) |
| memory_statsB | Long-term memory statistics (count, tokens, importance, by type) |
| memory_contextB | Build a compact context block from the most relevant memories for a given topic. Best for injecting memory into prompts. |
| bootstrap_sessionC | Bootstrap a session: detect model, provision agent & skill, record state. |
| provision_agent_skillC | Provision or append agent & skill files (idempotent). |
| list_agents_skillsC | List agent & skill files and their auto-block versions. |
| update_procedure_blockC | Update the auto block in agent & skill files with a new version. |
| detect_modelC | Detect the model in use from env/config/arg. |
| get_model_profileC | Get model profile (tier, capabilities). |
| set_modelC | Override the model for this session (env-level hint). |
| get_guardrailsC | Get procedure guardrails (anti-blunder) for a task/model. |
| model_decisionD | Internal model decision: tier/risk/route/needsVerify. |
| get_procedureC | Get a procedure by name. |
| list_proceduresB | List all procedures. |
| ingest_procedureC | Ingest a new procedure. |
| retrieve_exemplarsC | Retrieve best exemplars for a task (optionally filtered by task_type). |
| ingest_exemplarD | Ingest a high-quality exemplar. |
| self_critiqueC | Structured self-critique (weighted checklist + scoring + severity + verdict) without LLM. |
| score_complianceC | Score procedure compliance of a plan/diff. |
| run_verificationC | Run allowlisted verification commands (test/lint/typecheck). |
| decision_classifyC | Internal decision classification (tier/risk/route/compliance). |
| decision_healthC | Health of the internal decision engine. |
| cognitive_statusD | Cognitive status summary for the current session. |
| init_planA | Initialize PLAN.md if missing (idempotent). |
| read_planC | Read PLAN.md content. |
| update_plan_sectionC | Update a PLAN.md section by heading. |
| init_taskB | Initialize TASK.md if missing (idempotent). |
| init_agentsB | Initialize AGENTS.md if missing (idempotent). |
| init_auditB | Initialize AUDIT.md if missing (idempotent). |
| task_createD | Create a new task. |
| task_listC | List tasks, optionally filtered by status/priority, with pagination. |
| task_getC | Get task by id. |
| task_startC | Set task status to doing. |
| task_doneC | Set task status to done. |
| task_blockC | Set task status to blocked with reason. |
| task_deleteC | Delete a task. |
| task_updateC | Update task title/priority/owner/plan_ref/notes. |
| task_sync_mdC | Sync TASK.md from DB. |
| task_summaryC | Summary of task statuses. |
| task_from_planC | Auto-generate tasks from PLAN.md step/bullet lines. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
TDQS
Scored across 62 tools
Several clusters of tools have unclear boundaries: knowledge_search vs knowledge_retrieve vs retrieve_exemplars, memory_recall vs memory_context vs memory_list, and webfetch vs browser_fetch all overlap in purpose. The four init_* tools (init_plan, init_task, init_agents, init_audit) and decision_classify vs model_decision are near-duplicates that an agent could easily misselect.
There are strong consistent namespaces (knowledge_*, memory_*, task_*), but the surface also mixes bare verb_noun names (get_model_profile, set_model, ingest_procedure, score_compliance, run_verification) with un-prefixed concepts like webfetch, self_critique, and cognitive_status. It is readable but not a single predictable convention.
At 62 tools this far exceeds a well-scoped surface for a knowledge/memory/task assistant, and many tools are redundant or niche (four init_* variants, two fetch tools, three decision/health tools). The count indicates scope creep rather than a tight, purposeful set.
The domain surface is broad and mostly covers the lifecycle: knowledge ingest/search/list/delete/reindex/backup, full memory CRUD plus consolidation, and a fairly complete task lifecycle with plan and procedure support. Minor gaps remain, such as no document edit/update operation and procedures lacking delete/update beyond block versioning, with backup restore only available offline.