IGMED01/Nexus-Context-Orchestration-Engine-for-LLM-Systems
GitHub: IGMED01/Nexus-Context-Orchestration-Engine-for-LLM-Systems
面向 LLM 系统的上下文编排平台,提供高信号上下文筛选、代码变更教学包生成和本地优先持久记忆能力。
Stars: 2 | Forks: 0
# NEXUS
[](https://github.com/IGMED01/Nexus-Context-Orchestration-Engine-for-LLM-Systems/actions/workflows/ci.yml)
[](https://github.com/IGMED01/Nexus-Context-Orchestration-Engine-for-LLM-Systems/actions/workflows/codeql.yml)

用于**上下文选择、教学包和持久记忆**的 CLI 平台。
- **NEXUS** = 完整平台(11 层)
- **LCS** = 上下文引擎层 (`NEXUS:3`)
## NEXUS 是什么(当前)
NEXUS 是一个**学习优先的 AI 工程平台**,实施与教学并行:
- 选择高信号上下文并抑制噪声;
- 生成 `Change / Reason / Concepts / Practice`(变更/原因/概念/实践)教学输出;
- 通过本地优先的弹性机制和可选的外部后端持久化记忆;
- 暴露运维 API 端点(`/api/health`、`/api/axioms`、`/api/costs/:sessionId`、`/api/agent/stream`)。
**当前状态(2026 年 4 月 2 日):**
- 实施强化计划已完成;
- 核心强化检查清单已结项;
- 针对检索、抗噪和 FT 就绪的 CI 和质量门控已激活。
## 安装
```
git clone https://github.com/IGMED01/Nexus-Context-Orchestration-Engine-for-LLM-Systems.git
cd Nexus-Context-Orchestration-Engine-for-LLM-Systems
npm ci --ignore-scripts
npm run doctor:json
# 严格的生产安全配置文件(plan gate + scope lock)
npm run doctor:json -- --config learning-context.config.production.json
```
## 快速开始
```
# 1) 选择高信号上下文
node src/cli.js select --workspace . --focus "auth middleware validation" --format json
# 2) 从真实代码变更构建教学包
node src/cli.js teach --workspace . --task "Harden auth middleware" --objective "Teach request-boundary validation" --changed-files "src/auth/middleware.ts,test/auth/middleware.test.ts" --format json
# 3) 运行 API + 视觉演示
npm run api:nexus
# http://127.0.0.1:8787/api/demo
# 4) 打开交互式 shell(标签页:recall/teach/remember/doctor/select)
node src/cli.js shell --workspace . --project nexus
# 菜单控制:↑/↓ 移动 • Enter 运行 • /skills 技能管理器 • /menu 切换
# 需要真实的 TTY 终端(非管道 stdin)
# 在 Skills Manager 中,选择一个技能以打开单项操作(预览、提升、归档)
# 5) 从重复的 shell 任务生成草稿技能(交互式提议)
npm run skills:auto
# 6) 当 token/时间/错误阈值通过时,将健康的草稿提升为实验性
npm run skills:promote
# 7) 审计安装在 repo + system catalogs 中的重复/相似技能
npm run skills:doctor
# 确定性严格检查(仅 repo 范围)
npm run skills:doctor:strict
# 扩展严格审计(repo + system catalogs)
npm run skills:doctor:strict:full
# 8) 端到端 API 冒烟测试(remember -> recall -> chat -> ask -> guard)
npm run e2e:nexus
```
## Shell 故障排除
- 从仓库根目录运行 shell:
- `cd NEXUS`
- `node src/cli.js shell --workspace . --project nexus`
- 如果终端出现重绘循环,请使用安全渲染模式:
- PowerShell: `$env:NEXUS_SHELL_RENDER_MODE='safe'`
- Bash: `export NEXUS_SHELL_RENDER_MODE=safe`
- 安装后建议验证:
- `npm run doctor && npm run skills:doctor`
- 写入模式命令(`remember`、`close`、`sync-knowledge`、`readme --output`、`ingest-security --output`)需要:
- `--plan-approved true`
## NEXUS 目前功能
- 具备噪声抑制的上下文选择。
- 与变更文件和测试相关联的教学包生成。
- 通过本地优先存储及可选外部电池/后端实现的持久记忆。
- 可选 Go FastScan 边车,用于更快的工程文件发现(安全回退到原生扫描)。
- 内部 SYNC 运行时(detect → chunk → dedup → version → persist),位于 `src/sync`。
- HTTP API + SDK + OpenAPI(`/api/demo` 端点提供一个最小化内联页面)。
- CI 中的防护、可观测性、版本控制和评估门控。
## 文档
- [文档索引](docs/README.md)
- [当前项目状态](docs/status-actual.md)
- [公开路线图](docs/planning/roadmap.md)
- [知识后端](docs/knowledge-backends.md)
- [NEXUS API 指南](docs/nexus-api.md)
- [集成指南](docs/integration.md)
- [技能自动生成器 (MVP)](docs/skills-auto-generator.md)
实施检查清单和执行计划现在是**仅限本地**的产物,不会发布到 GitHub。
## 开源
- [贡献](CONTRIBUTING.md)
- [安全](SECURITY.md)
- [版本控制](VERSIONING.md)
- [更新日志](CHANGELOG.md)
- [许可证](LICENSE)
标签:AI工程平台, GNU通用公共许可证, LLM上下文管理, MITM代理, NEXUS平台, Node.js, Python脚本, SOC Prime, 上下文感知, 上下文编排引擎, 上下文选择, 上下文降噪, 中间件, 代码变更分析, 代码教学, 开发工具, 持久化记忆, 文档结构分析, 本地优先, 流式API, 生产就绪, 知识管理, 自定义脚本, 软件开发生命周期