
Logic Server
ai.nocturnus由 nocturnus.ai 发布v0.3.11更新于 Oct 24, 2026
Agent reasoning, memory, and token-optimized context for AI applications.
概览
一个本地 MCP 服务器,为助手提供确定性的推理与记忆引擎,每轮只返回发生变化的事实上下文。
- 可以做什么
- 根据对话轮次和工具输出构建按重要性排序的工作事实集,README 建议每轮使用 context 工具。按目标驱动组装上下文,只返回从当前目标可达的事实。获取快照之间的差异,仅显示新增和移除的条目。在线程结束时清除会话中存储的上下文。存储事实与规则,支持反向链推理、证明链、真值维护和时间有效性。
- 适用场景
- 当助手反复重放很长的对话历史、你希望降低 token 用量同时保持业务事实一致时适合使用,例如多轮客服或需要撤回、更新事实的智能体流程。适合希望采用确定性推理而非向量检索或摘要的场景。
- 运行要求
- 作为桌面本地进程运行,通过 stdio 从 npm 包 nocturnusai-mcp 启动。环境变量:NOCTURNUSAI_API_KEY 用于认证访问,NOCTURNUSAI_DATABASE 指定数据库名,NOCTURNUSAI_TENANT 用于多租户隔离,NOCTURNUSAI_URL 指定 NocturnusAI 服务器的基础地址。自然语言抽取需要 LLM 提供方;未配置时自然语言轮次返回零条事实,但谓词语法无需 LLM 即可使用。
安装
在 SourceWeft 中
- 打开 控制台中的 Logic Server,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
NocturnusAI
[CI] [PyPI] [npm] [Docker] [License: BUSL-1.1] [MCP]
The context engineering engine for AI agents: send only what changed.
[NocturnusAI — Context Engineering Engine for AI Agents]
Before / After
The Numbers
Measured on live APIs. 15-turn product support conversation. Real usage.input_tokens counts. Run it yourself.
Claude Opus 4: 5.7× reduction. Gemini 2.0 Flash: 10.0×. Full calculations.
Install
Or use the setup wizard:
Why Developers Star This Repo
- Reproducible token reduction — benchmark in the repo, methodology published, run it against your own workload
- Deterministic inference — same query, same result, every time. No embedding drift, no cosine similarity lottery
- Truth maintenance — retract a fact, all derived conclusions auto-retract. No stale context, no hallucination on operational state
- Plugs into existing stacks — LangChain, LlamaIndex, CrewAI, AutoGen, MCP, Vercel AI SDK, OpenAI Agents SDK, Mastra
- Benchmarkable against naive replay — numbers derived, not invented. Every claim traces to a notebook cell
Framework Quickstarts
How It Works
Three steps. Every turn.
- Extract — raw conversation turns → structured facts via LLM extraction
- Infer — backward-chaining logical inference finds only the facts reachable from the agent's current goal
- Return the delta — a
briefingDeltacontaining only what changed since the last turn
This is not vector search. It is not summarization. It is deterministic inference on a logic engine — Hexastore indexing, backward chaining, and truth maintenance.
The Working Loop
LLM required for natural-language turns. The examples below send raw text turns through an LLM to extract structured facts. If you start the server without an LLM provider, natural-language turns will return zero facts. See Quick Start for setup options, or use predicate syntax (e.g.,
"customer_tier(acme_corp, enterprise)") which works without any LLM.
1. First reduction: POST /context
2. Goal-driven pass: POST /memory/context
3. Later turns: POST /context/diff
Returns only added and removed entries between snapshots.
4. End of thread: POST /context/session/clear
Choose Your Surface
Python SDK
TypeScript SDK
MCP
Use the context tool each turn for a salience-ranked working set. Pair MCP with the HTTP context endpoints when you need goal-driven assembly and diffs.
What Lives Behind The Workflow
When you do need backend mechanics, NocturnusAI provides them:
- Deterministic fact and rule storage
- Backward-chaining inference with proof chains
- Truth maintenance and contradiction handling
- Temporal facts with
ttl,validFrom, andvalidUntil - Multi-tenancy via
X-DatabaseandX-Tenant-ID - MCP, REST, Python SDK, TypeScript SDK, and CLI surfaces over the same engine
Quick Start
Docker (fastest)
Docker with Ollama (enables natural-language extraction)
From this repo
CLI
Documentation
Full docs: nocturnus.ai
Docker Compose (advanced)
Build from Source
Requires JDK 17+.
Contributing
See CONTRIBUTING.md. Issues labelled good first issue are good entry points.
Security
Report vulnerabilities privately via GitHub Security Advisories. See SECURITY.md.
License
Business Source License 1.1 (SPDX: BUSL-1.1). Free for internal use — including internal production — inside your own organization. Offering NocturnusAI or substantial functionality as a product/hosted service to third parties requires a commercial license ([email protected]). Converts to Apache 2.0 on 2030-02-19. See LICENSE and DISCLAIMER.md.
LEGAL & SAFETY NOTICE
NocturnusAI is a deterministic reasoning engine, but its output is only as reliable as the facts provided to it.
- No Warranty of Truth. "Verified" refers to logical consistency of inference, not accuracy of real-world claims.
- Not for Autonomous High-Stakes Decisions. Do not use this engine for unsupervised medical, financial, legal, or physical-safety decisions without an independent human verification step.
- Logic Layer Only. NocturnusAI provides information and inference; it does not execute actions.
- No Liability. See DISCLAIMER.md and LICENSE.
来源:README.md,提交 0dd449a
工具
0版本历史
1- v0.3.11最新Sep 16, 2026
评分
已满足适用检查项的 40%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分
请在仓库或注册中心条目中声明许可证。