Skip to main content

infer

Use the infer skill to generate speculative inference candidates from claims, persist them on branch-local inference graphs, and run the full mutation pipeline that coordinates active memory, claims, Terminus persistence, and speculative ranking.

来源信息

仓库
Tyler-R-Kendrick/agentic_speculative_knowledge
最近来源活动
2026年4月10日 14:25
检测到的 SKILL.md 语言
英语
星标
0
分支
0

安装方式

默认使用会先检查来源的 Prompt;你也可以切换为直接命令,或下载本地副本。

检查来源文件

决定是否安装前,请先阅读 SKILL.md,以及 SkillsMP 当前展示的配套文件。

正在显示 SKILL.md

SKILL.md
来源说明 · 只读预览
name
infer
description
Use the infer skill to generate speculative inference candidates from claims, persist them on branch-local inference graphs, and run the full mutation pipeline that coordinates active memory, claims, Terminus persistence, and speculative ranking.
# Infer Generate speculative knowledge from existing claims and persist it on isolated inference branches. ## When to use - Running the mutation pipeline end-to-end on new observations - Generating inference candidates (abductive, heuristic, predictive, etc.) - Producing facet relation candidates between claims - Persisting ranked speculative output to a Terminus inference branch ## Quick start ```python import pathlib from src.active_memory.models import WorkingItem from src.persistence.pipeline import MutationPipeline from src.terminus.adapter import TerminusMemoryRepository from src.manifold_sidecar import ManifoldRankingService root = pathlib.Path(".agent-memory") repo = TerminusMemoryRepository(url="http://localhost:6363") ranker = ManifoldRankingService() pipeline = MutationPipeline( root, enable_terminus=True, terminus_repo=repo, manifold_service=ranker, enable_inference=True, ) item = WorkingItem( item_type="observation", content="The auth service failed after a certificate rotation.", session_id="sess-1", ) result = pipeline.run(item, session_id="sess-1") print(result.inference_candidates) # number of candidates generated print(result.ranked_inference_candidates) # number ranked by manifold sidecar print(result.inference_branch) # e.g. "inference/sess-1" ``` ### Using the generator directly ```python from src.inference.generator import InferenceGenerator from src.claims.extractor import ClaimExtractor extractor = ClaimExtractor() claims = extractor.extract(text="The API started returning 401 errors.") generator = InferenceGenerator() candidates = generator.generate_from_claims( claims, source_branch="inference/sess-1", source_commit="journal-event-abc", session_id="sess-1", ) facets = generator.generate_facet_candidates( claims, provenance_commit="journal-event-abc", source_branch="inference/sess-1", ) ``` ## Key APIs | Class | Method | Purpose | |---|---|---| | `MutationPipeline` | `run()` | Full pipeline: active write → journal → claims → Terminus → inference → ranking | | `InferenceGenerator` | `generate_from_claims()` | Produce `InferenceNode` candidates from a list of claims | | `InferenceGenerator` | `generate_facet_candidates()` | Produce `FacetRelation` candidates between adjacent claims | ## Grounding - `src/persistence/pipeline.py` — mutation pipeline orchestration - `src/inference/generator.py` — rule-based inference and facet generation - `src/inference/models.py` — `InferenceNode` and `FacetRelation` schemas - `src/claims/extractor.py` — upstream claim extraction - `tests/integration/test_inference_flow.py` — integration coverage - `notebooks/02_speculative_inference_and_facets.ipynb` — executable walkthrough ## Rules 1. Route orchestration through `MutationPipeline` in `src/persistence/pipeline.py` so all pipeline steps stay synchronized. 2. Reuse `InferenceGenerator` from `src/inference/generator.py` for candidate creation. 3. Speculative output must stay on `inference/*` branches; never write directly to trusted memory. 4. Validate with `tests/integration/test_inference_flow.py`.
在 GitHub 查看