@almosawy/cortex-brain

中文文档
2.0.4发布于 2026/10/25MITCommonJS近 30 天下载 2120

Cortex Enterprise: The Ultimate AI Code Intelligence & Verification Platform. Zero hallucinations.

原始使用文档

🧠 Cortex Enterprise - The Deterministic Project Brain

Stop AI hallucinations. Give your AI the exact code it needs, not the whole project.

Cortex is a local-first, high-performance code intelligence platform that scans your codebase, builds a dependency graph, and provides verified context for AI agents (like Claude, GPT, or Cursor) with zero hallucinations.

🚀 Why Cortex Enterprise?

  • ⚡ Blazing Fast: Powered by native SQLite (better-sqlite3), search results in <10ms.
  • 🛡️ Zero Hallucinations: Verify any symbol (function, class, file) before AI uses it. If it's not in the graph, it's not real.
  • 💥 Blast Radius: Before modifying a function, see exactly which other files will break.
  • 🕸️ Interactive Dependency Map: A visual graph of your entire codebase.
  • 🐍 Multi-Language Support: Powered by tree-sitter for accurate AST parsing of JavaScript, TypeScript, and Python.
  • 🕵️ Dead Code & Security Audits: Detect unused code and heuristic security vulnerabilities.
  • 📦 AI Context Exporter: Export perfectly formatted Markdown code blocks to paste directly into Claude or ChatGPT.
  • 🔌 Native MCP Support: Connects directly to Claude Desktop and Cursor as an MCP server.
  • 🔒 Local-First: Your code never leaves your machine.

📦 Installation

npm install -g @almosawy/cortex-brain
🎯 Quick Start
Go to your project directory:

bash
cd /path/to/your/project
Scan your codebase (builds the AST graph):

bash
cortex scan
Start the Enterprise Dashboard:

bash
cortex serve
Open your browser at http://localhost:3000.

🛠️ CLI Commands
cortex scan - Build the AST graph, dependency edges, and call graph.

cortex serve - Start the Cortex Enterprise Dashboard (API + UI).

cortex ask "<query>" - Search the codebase from terminal.

cortex verify <type> <name> [file] - Verify if a symbol exists.

cortex context - Generate AI context (Markdown) for the project.

cortex mcp - Start the MCP server for Claude Desktop / Cursor integration.

🔌 MCP Integration (Claude Desktop / Cursor)
Add this to your claude_desktop_config.json or Cursor MCP settings:

json
{
  "mcpServers": {
    "cortex": {
      "command": "cortex",
      "args": ["mcp"]
    }
  }
}
🏗️ Architecture
Scanner: Uses tree-sitter to parse JavaScript/TypeScript/Python into a precise AST.

Graph: Stores nodes (functions, classes, files), edges (imports, defines), and call-graphs in SQLite.

Server: Express.js with Helmet, CORS, Rate Limiting, and Zod validation.

UI: Enterprise dashboard with Dependency Map (D3.js/Canvas), Syntax Highlighting, and Impact Analysis.

📄 License
MI

版本与发布记录

@almosawy/cortex-brain 共发布 10 个版本,首次发布于 2026/10/19;过去 12 个月发布了 10 个版本。

版本发布日期距今
2.0.4latest2026/10/2513 天前
2.0.32026/10/2513 天前
2.0.22026/10/2513 天前
2.0.12026/10/2513 天前
2.0.02026/10/2513 天前
1.0.42026/10/1920 天前

关于 @almosawy/cortex-brain 的常见问题

@almosawy/cortex-brain 是什么?

Cortex Enterprise: The Ultimate AI Code Intelligence & Verification Platform. Zero hallucinations.

如何安装 @almosawy/cortex-brain?

在项目目录运行 npm install @almosawy/cortex-brain,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 cortex,可以用 npx cortex 直接运行。

@almosawy/cortex-brain 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/almosawy__cortex-brain 是否存在。

@almosawy/cortex-brain 支持 ESM 还是 CommonJS?

以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。

@almosawy/cortex-brain 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=18.0.0。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@almosawy/cortex-brain 可以商用吗?

@almosawy/cortex-brain 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@almosawy/cortex-brain 的下载量有多少?

根据 npm 官方下载统计,@almosawy/cortex-brain 在 2026/10/06 – 2026/11/04 这 30 天内被下载 2,120 次,日均约 71 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@almosawy/cortex-brain 还在维护吗?

最新版本 2.0.4 发布于 2026/10/25(13 天前);至今共发布 10 个版本,其中过去 12 个月发布了 10 个;首次发布于 2026/10/19。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。