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, blunder patterns) from the registry. |
| 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
Most tools target distinct resources and actions across memory, knowledge, tasks, procedures, and session management. A few clusters overlap, such as knowledge_search vs knowledge_retrieve, webfetch vs browser_fetch, and the decision/model diagnostic tools, but their descriptions generally clarify the distinction.
The set is predominantly snake_case with predictable domain/action naming such as task_create, memory_recall, and knowledge_ingest_file. Minor deviations exist, including webfetch/browser_fetch without a clear domain prefix and noun-first names like memory_stats mixed with verb-first names like get_procedure.
62 tools is far above a reasonable scoped surface for this server and spans many loosely related areas. Several tools could likely be consolidated or moved to separate services, making the surface heavy for an agent to navigate.
Core domains have broad coverage: memory has full CRUD plus consolidation/context, knowledge has ingest/search/list/delete/backup/reindex, and tasks have full lifecycle operations. There are minor lifecycle gaps for procedures and exemplars, which lack obvious update/delete/list management operations, but core workflows are well covered.