
Tgms
io.github.zxf-work由 GitHub 帳號 zxf-work 發布v0.7.0更新於 Oct 24, 2026
Bi-temporal graph store with 15 verified temporal operators as typed, deterministic MCP tools.
概覽
一個本機雙時態圖儲存,為助理提供 15 個具型別、確定性的時間查詢算子,並以可稽核的事件日誌作答。
- 可以做什麼
- 透過 15 個經驗證的算子執行時間圖查詢:時間可達性、δ-模體、快照差異、突發偵測、區間連接以及依邊事件的分組聚合;算術與集合運算由專用算子完成,而非交給模型。讀取信念日誌,查看哪些信念被修訂及修訂時間,藉此區分演進與更正。對照事件日誌檢查已儲存的答案是否仍然新鮮,並可註冊、檢查或重新整理跨世代的衍生產物。產生內容定址的追蹤紀錄,讓答案中的每項主張都能與產生它的證據進行機器核對。
- 適用情境
- 適用於助理需要回答圖隨時間如何變化的問題,包括某個過去日期在更正之前被相信的狀態,以及答案需要逐項主張可稽核而非自由生成時。
- 執行需求
- 以本機 stdio 程序執行,可透過 uvx 或 pip 從 PyPI 安裝;MCP 伺服器以 serve 指令並指定儲存路徑啟動。示範不需 GPU、API 金鑰或下載資料集;建立自有儲存需載入時間圖資料,資料集載入器會從來源下載。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Tgms,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
TGMS — Agent-Native Bi-Temporal Graph Management System
[CI] [License: Apache-2.0] [Coverage: temporal/ 97%]
A temporal graph database whose query surface is built for LLM agents — and whose answers can be audited claim by claim.
Project page & blog: https://zxf-work.github.io/tgms/ · Paper: paper/main.pdf
LLM agents are unreliable at exactly the things temporal graph analytics requires: arithmetic, identifiers, and asserting only what the evidence shows. TGMS's answer is architectural — give the model no opportunity to do any of them:
- a bi-temporal property graph (valid time × transaction time) that distinguishes evolution ("the edge ended") from correction ("we were wrong"), so agents can answer "what did we believe on March 1?" — a question latest-state snapshots and the RAG configurations we evaluated cannot express. Bi-temporality itself is inherited, not invented here — it has a four-decade literature, a place in SQL:2011, and production databases built around it. We measure against the clearest of those, XTDB: fed the same operation stream, the two systems agree on believed state at 400 of 400 probe points, with TGMS 3.9–4.7× faster at correction-heavy ingest on 23–27× less disk (the head-to-head);
- and because a belief can be corrected after you've already acted on an
answer, TGMS now tells you when that happened:
tgms trace checkreads a saved answer's dependency scope against the event log — no recompute, no store lock required — and returnsFRESH/POSSIBLY_STALE/UNDECIDABLE, sound in the direction that matters (it never calls a stale answer fresh). Measured across two injection campaigns, 6,978 trials: 0 false-fresh verdicts on 447 changed answers in the M4 campaign (run 2, the record of account) and 0 more on 1,852 changed answers in the M5 carve-2 campaign (28,044 trials), where the obvious cheap check — "did the correction touch a row in the stored result?" — is wrong on 47.4% of the M4 trials; - and a saved result you want to keep, not just check, can now maintain
itself:
tgms artifact register/check/refreshturns it into a named, generation-numbered artifact — refresh recomputes only what you ask, the old generation stays byte-identical on disk, and a refresh propagates one hop to whatever else was built on top of it, even when that dependent's own scope was never touched. Measured across the M5 maintenance campaign: 0 false-fresh in 37,371 trials, 0 false-safe over 5,867 propagation decisions (99.0% resolved without recomputing anything), and a 600/600 pinned-answer exemption; - 15 verified temporal operators (reachability over time-respecting
paths, δ-motifs, snapshot diffs, burst detection, interval joins, grouped
aggregation over edge events, and the belief log itself) — typed,
deterministic, bounded,
cost-guarded, exposed as tools (MCP or in-process); identifiers must come
from a resolver, arithmetic from a
computeoperator; - a Planner–Executor–Verifier loop: the LLM only plans and reports; plans are statically validated (including a grounding rule that makes fabricated identifiers impossible and output-field contracts that reject invented result paths), executed deterministically with content-addressed traces, and every claim in the written answer is machine-checked against the trace that produced it — including truncation taint, so "correct arithmetic over incomplete evidence" is caught too;
- a purpose-built native storage engine (Rust, PyO3): bi-temporal columnar segments, a temporal-CSR traversal index, group commit, and a single-writer / many-reader concurrency mode — 24.6 bytes per edge version, versus 78.4 on ClickHouse and 549.7 on PostgreSQL for the same 1M-event log.
Quickstart
No GPU, no API key, no dataset download. tgms demo builds a small store of
its own in a temp directory and runs the arc every TGMS answer follows: what
the graph currently believes, what it believed before a correction landed,
and the trace that backs both claims up. Clean environment to first temporal
result: under 5 minutes.
Once you want your own graph data, the native test suite, the MCP server, or an agent wired to a real LLM, see Full setup below — this quickstart is deliberately the smallest possible first step, not a tour of the operator surface.
Next steps, in the order most people need them: bring your own temporal graph data · give TGMS to an agent over MCP · audit an answer · maintain derived results · what you can rely on across versions · what's coming
Does it work?
Three different questions, three different answers. All three are reported because the third is the least flattering.
1. Does the agent layer beat the alternatives? Dev-split campaign
(CollegeMsg, open-source models served locally on one 24 GB GPU. "Answer
accuracy" is normalized typed-answer accuracy — counts and values scored
strictly, interval answers credited at IoU ≥ 0.5. Full receipts ship with
the paper and the eval records in benchmarks/results-v1/):
- vs static-graph RAG: +36 points, paired-bootstrap 95% CI [0.18, 0.59]
- verifier fault injection: 500/500 injected false claims caught, 0 false positives; on the frozen campaign, 0 of 199 emitted answers contained an unsupported claim with gating (21 of 220 without it) — coverage is 199/282, so some of that is bought by declining to answer
- accuracy tracks planner capability where baselines stay flat: 13.8% / 34.0% / 62.8% at Qwen2.5 7B / 14B / 32B fp16, correction probes saturating at 100% at 32B
2. Is the engine competitive? Six systems answer one 13-query registry — TGMS native, TGMS-on-DuckDB, PostgreSQL, ClickHouse, Neo4j, Memgraph — with every cell hash-verified before it was timed:
The last row is the one we cannot close: ClickHouse keeps a factor of 2.2 on whole-window aggregation at both 1M and 10M, and it is a constant of the shape rather than something that grows with scale. Three rounds of profiling took that gap from 12× to 2.2× and each round found our own implementation rather than the workload. Single latency cells reproduce to about ±20% between days, which is stated everywhere they are quoted.
At 10M events the full query suite runs inside 1.76 GB of peak RSS, 16 concurrent readers get 10.2× the throughput of one, and a live writer costs those readers 0–3% of per-query latency.
3. Can it answer the questions people actually ask? This is the honest one, and it now has a sequel. 110 questions were written by people who saw a plain-language description of two public datasets and never saw the operator list. Of those, 94 were expressible under the fixed 15-operator catalog — 10 were expressible when the study was pre-registered. Of LDBC SNB's 41 read templates, 3 executed — the operator-execution axis (does a plan compile, load, admit and run at all), a lower bar than the stricter ECQR result-contract axis, which stood at 7 of 41 — and that number had not moved in eight sessions, because 35 of the 38 misses needed labelled multi-way pattern matching: a deliberately deferred design decision, not a missing operator.
That deferred decision shipped. TGIR, a 12-primitive compositional temporal-graph IR, now runs the entire 15-operator catalog as byte-identical leaves and additionally compiles some question shapes — including labelled multi-way pattern matching — into chains of those primitives. Both axes were forecast before TGIR was built, frozen before the first row was measured, and moved to exactly the predicted level: LDBC operator-execution coverage 3 → 24 of 41, independent-question coverage 94 → 102 of 110, delivered/predicted 29/29 on the full 52-row forecast (28/28 on the 51 scoreable rows — one row was excluded by name in the freeze because its canonical corpus carries no corrections to find), 0 over-deliveries, 0 misses.
The store is still good and the surface is still narrower than "24 of 41"
sounds. There is no LDBC SNB dataset in this repository. The 21 LDBC
rows execute against a hand-built fixture carrying LDBC's labels,
relationship types and multi-hop topology at a size a reviewer can read on
one screen (scripts/build_ldbc_fixture.py); it establishes that a plan
compiles, loads, admits and executes, and nothing about scale. The
independent-question axis is the one measured on real data (bitcoin-otc,
CollegeMsg), and it's where the admission/cost-guard claim is meaningful.
Both instruments live in the repo (scripts/independent_questions.py,
scripts/ldbc_fit.py), they re-run in seconds, and each capability shipped
has been scored against a forecast made before it was built —
delivered/predicted has now run 14/30, 4/7, 10/13, 14/16, 15/15, 4/8, 5/5,
4/5, and 29/29. 5/5 and 4/5 were the first forecasts made per question
rather than in aggregate, and TGIR's 29/29 is the first forecast — made
per row, before any row was measured — with zero misses across the whole
universe.
What the operators can express
Fifteen operators — fourteen of them unchanged since D-044, because most of
the growth since v0.4.0 happened inside them, driven question by question
by the study above. The newest growth happened underneath them instead:
TGIR, a 12-primitive compositional temporal-graph IR, now runs the
entire operator set as byte-identical leaves — same semantics, digest-
receipted, switchable off with TGIR_PLAN_PATH=off — and additionally
compiles some question shapes, chiefly labelled multi-way pattern matching,
into chains of those primitives. TGIR plans are not yet a user-facing query
language: there is no public syntax for writing one directly, and the
fifteen operators below are still the whole interface an agent (or you)
calls. What changed is what happens underneath a call, and it is measured
in the byte-reproducible record at
benchmarks/tgir-v1/measured.yaml.
The pre-existing fifteen:
Every one of these is verified against the same brute-force oracle as the
operators themselves, and every one is measured in the session that shipped
it. What is not there is written down too, question by question, in the
re-audit tables of scripts/independent_questions.py and
scripts/ldbc_fit.py — both of which print the current blocked-capability
board on report.
Full setup (from source)
Everything below builds TGMS from a checkout instead of the PyPI wheel: real dataset loaders, the native-engine test suite, the MCP server, and an agent loop wired to an actual LLM.
With any OpenAI-compatible LLM endpoint (e.g. vllm serve Qwen/Qwen2.5-7B-Instruct):
Interfaces
Correctness
Every operator is verified against an independent brute-force oracle (500
randomized cases per operator; 97% line coverage in tgms/temporal/
across both backends), plus
metamorphic properties — diff composition and bi-temporal immutability:
any result pinned to a past belief state is byte-identical before and after
later corrections. The same suite runs unmodified against both backends,
which is the whole acceptance argument for the native engine: it has to
satisfy the same human-owned ground truth that DuckDB does.
The write path is property-tested over random assert/retract/correct
interleavings, and the append-only event log replays into either backend
with identical store digests. Process rules are enforced in CI and are not
advisory: tests and the oracle may never share a commit with the
implementation they judge, and every number quoted on the project site is
resolved from docs/site_facts.json at build time, so a stale figure fails
the build rather than the review. See CONTRIBUTING.md.
Layout
Datasets are never bundled: loaders download from source (SNAP) and pin SHA-256 manifests. See docs/eval/ for design, positioning, measurements, and roadmap.
License
Apache-2.0 — see LICENSE. Cite via CITATION.cff.
mcp-name: io.github.zxf-work/tgms
來源:README.md,提交 6dd332e
工具
0版本歷史
1- v0.7.0最新Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分