
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 分
請在儲存庫或註冊中心條目中宣告授權條款。