Knowing

io.github.blackwell-systems由 GitHub 账号 blackwell-systems 发布v0.16.0更新于 Oct 24, 2026

Content-addressed code graph with 22 MCP tools for AI agents.

概览

AI 生成的概览

一个本地 MCP 服务器,将代码仓库索引为内容寻址图,为助手提供排序后的代码上下文、影响范围、测试范围和可离线验证的证明。

可以做什么
构建与查看代码图:索引仓库、查询图、查看仓库结构与跨仓库调用者,并追踪数据流和符号间路径。理解影响:计算改动的爆炸半径,为任务、文件或拉取请求生成排序上下文,并解释符号排名原因。比较与审查:对比快照和语义变更、评估 PR 影响、列出过期边。运行时与归属:查看运行时流量、死路由和追踪统计,查询代码所有者、社区和测试范围。证明与维护:生成 Merkle 证明和不存在证明、校验图完整性,并清除某个仓库的数据。
适用场景
适合助手在代码库中工作时使用,用图排序的上下文替代反复的 grep 与读取;也适合需要影响分析、测试选择、PR 审查支持,或为审计提供可离线验证的代码关系证明的场景。
运行要求
以本地进程通过 stdio 运行,可通过 npm 安装(README 也列出 Homebrew、pip 和 Go)。需要一个 git 仓库进行索引;首次启动会自动索引,约需 10 到 30 秒。无需 API 密钥或模型下载。运行时追踪工具需要导入 OpenTelemetry 追踪数据。
安装前请注意
服务器会在本地读取并索引仓库源文件,并保存图数据库。untrack_repo 工具会删除某仓库的全部已存数据,包括节点、边、快照和反馈。--watch 参数会在文件变更时重新索引。嵌入默认关闭,可通过参数启用。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Knowing,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

English · 简体中文 · Русский · हिन्दी · العربية

[knowing]

[Blackwell Systems] [DOI] [MCP Tools] [Languages and Formats] [License]


Self-adapting code intelligence engine. Observes its own graph density and adjusts retrieval strategy automatically. 38 edge types, 28 MCP tools, 263 equivalence classes, cryptographic proofs. Gets smarter with scale, not dumber.


[!NOTE] Built on published research: Content-Addressing as a Computation Primitive for Software Relationship Intelligence (DOI: 10.5281/zenodo.20342255)

Your architecture diagram says service A calls service B. Can you prove it?

knowing can. It builds a content-addressed graph of extracted code relationships, snapshots it as a Merkle tree tied to a git commit, and generates cryptographic proofs that verify offline. Agents use it for ranked context. Security teams use it for audit. Platform teams use it to compare code against production traces.

It gets better every time you use it. When code changes, stale knowledge expires automatically.

bash
brew install blackwell-systems/tap/knowing
json
{ "mcpServers": { "knowing": { "command": "knowing", "args": ["mcp", "--watch"] } } }

That's it. The MCP server auto-indexes your repo on first launch. No model downloads, no API keys. Your agent now has ranked context, blast radius, test scope, and implicit noise demotion that improves results during active sessions.

Verify it works: Ask your agent: "Use the context_for_task tool to find symbols related to [something you know exists in your code]." You should see ranked symbols with scores and file paths from your codebase. If results are empty, the repo is still indexing (10-30 seconds on first launch). If results seem unrelated, see Troubleshooting.

Not using an AI agent? Skip to CLI usage below.

You want to...Start here
Give your AI agent graph-ranked contextMCP setup
Explore the graph from the CLICLI usage
Understand how retrieval worksIntroduction
Audit with cryptographic proofsAudit & Compliance

Three Things, One Architecture

knowing is three products built on one foundation (content-addressed graph with hierarchical Merkle trees):

1. Context engine for AI agents One call returns the most relevant symbols for a task, ranked by graph centrality, recency, and learned usefulness, packed to fit your token budget. 263 framework equivalence classes bridge vocabulary gaps when keywords fail. 47% fewer tool calls. 84% fewer tokens. Results improve with feedback.

2. Audit primitive for compliance Every graph state is a Merkle root tied to a git commit. knowing prove generates a cryptographic proof that a relationship existed. knowing verify checks it offline. knowing fsck verifies the entire graph in 98ms. Supply chain detection extracts credential access, process spawning, and network exfiltration edges to flag structurally suspicious code.

3. Noise demotion that learns Symbols returned but never used by the agent get demoted on future queries. When code changes, feedback expires automatically (verified via package Merkle roots). The system gets more precise during active sessions. That is the property knowing is built around.

These aren't separate features. They're structural consequences of content-addressing: the same hash that makes context cacheable also makes it provable, and the same Merkle root that detects staleness also expires stale feedback.


What It Answers

For your agent:

  • "I'm changing this function. What breaks?" (blast radius across callers, tests, routes, repos)
  • "Give me 50,000 tokens of context for this task." (graph-ranked, not grep-searched)
  • "Which tests should run?" (call-graph traversal, 98% precision)

For your platform team:

  • "Is this route used in production?" (static analysis + OTel runtime traces)
  • "What did the service graph look like at a specific snapshot?" (snapshot chain, each root tied to a git commit)

For your security team:

  • "Prove service A calls service B at this commit." (Merkle proof, verifiable offline)
  • "Prove this dependency does NOT exist." (absence proof via sorted leaves)
  • "Generate a compliance report." (knowing audit -proofs, one command)
  • "Does this package read credentials and spawn processes?" (knowing audit-supply-chain --scan-all)

Numbers

WhatResult
Cross-system retrievalP@10=0.330 cold start (302 tasks, 17 repos, 8 languages)
vs competitors3.79x codegraph (19K stars), 6.00x GitNexus, 6.35x Gortex, 22.0x grep
Equivalence classes277 hand-curated + learned from usage, bridging vocab to symbols (+57% P@10)
Noise demotionPer-cluster implicit feedback: R@10 +5.2%, MRR +12.6% (Django 5 rounds)
Tool calls saved47% fewer (one context call replaces repeated grep+read)
Token savings84% fewer tokens (GCF wire format)
Repeat query speed93x faster (Merkle-keyed subgraph cache)
Merkle diff517x faster than full edge scan at 100K edges
Test scope98% precision, 82% recall
Graph integrity check98ms (24,936 edges)
Proof generation72us generate, 1.2us verify
Feedback expiration100% expire on code change, 11% overhead
Indexing throughput16 repos (8 languages) in ~60s
Language coverage16/16 repos pass (Go, Python, TS, Rust, Java, C#, Ruby, multi)
Edge types38 (including supply chain: reads_env, executes_process)

All benchmarks are reproducible. The cross-system benchmark (P@10=0.330) uses 17 repos pinned to exact commits with a corpus manifest and setup script for full from-scratch reproduction. See METHODOLOGY.md for protocol details.


Quick Start

Path A: MCP server (recommended for AI agents)

bash
# 1. Installbrew install blackwell-systems/tap/knowing# Or: npm install -g @blackwell-systems/knowing# Or: pip install knowing# Or: go install github.com/blackwell-systems/knowing/cmd/knowing@latest
# 2. Add to your agent config (.mcp.json, Claude Code settings, etc.)#    See "MCP Integration" below for the config block.#    The server auto-indexes your repo on first launch. Done.

Path B: CLI usage (explore the graph yourself)

bash
# 1. Install (same as above)brew install blackwell-systems/tap/knowing
# 2. Index your repoknowing add .
# 3. Verify the index workedknowing stats# You should see node and edge counts. A healthy TypeScript repo with 50K LOC# typically produces 2K-10K nodes and 5K-30K edges. If you see very few edges,# the extractors may not have found your code (check language support below).
# 4. Get context for a taskknowing context -task "refactor auth middleware" -format gcf
# 5. Check graph integrityknowing fsck

Verify your setup

After indexing, run these commands to confirm everything is working:

bash
# Show node/edge counts, repos, snapshotsknowing stats
# Search for a symbol you know exists in your codeknowing query "MyKnownFunction"
# Check graph integrity (should report 0 errors)knowing fsck
# If results seem wrong, check if the graph is staleknowing stale

If knowing stats shows zero nodes or very few edges, see Troubleshooting below.

More CLI commands

bash
# Find affected testsknowing test-scope -files internal/auth/middleware.go
# Explain why a symbol ranked where it didknowing why -task "refactor auth" -symbol "SessionHandler"
# Prove a relationship exists (cryptographic Merkle proof)knowing prove -source "AuthService" -target "SessionStore"
# Verify offline (no database needed)knowing verify proof.json
# Check if the graph is stale (CI gate: exits 1 if stale)knowing stale
# Supply chain audit (scan all files for suspicious patterns)knowing audit-supply-chain --scan-all
# Remove a repo (evicts all data: nodes, edges, snapshots, feedback)knowing remove ./path/to/repo

For the full command reference, see CLI Reference.

MCP Integration

Add the MCP server to your agent. The config is the same everywhere; only the file path differs.

AgentConfig file
Claude Code.mcp.json (project root) or ~/.claude/mcp.json (global)
Cursor.cursor/mcp.json
Windsurf~/.codeium/windsurf/mcp_config.json
VS Code (Copilot, Continue, Cline, Roo).vscode/mcp.json
Zed~/.config/zed/settings.json under "context_servers"
Codex (OpenAI)codex.json or --mcp-config flag
JetBrainsSettings > Tools > MCP Servers
json
{  "mcpServers": {    "knowing": {      "command": "knowing",      "args": ["mcp", "--watch"],      "transport": "stdio"    }  }}

The --watch flag re-indexes on file changes. Your agent always queries fresh data. No manual knowing index or database path needed: the MCP server auto-indexes the git repository on first launch and registers it in the roster for future sessions.

Embeddings are off by default (confirmed neutral on cold-start benchmarks). Use --embeddings to enable if experimenting. The graph structure and equivalence classes carry retrieval quality.

What your agent gets: The key tool is context_for_task. When your agent calls it with a task description, knowing returns ranked, relevant code symbols packed into a token budget. This replaces grep-read loops. Other useful tools: blast_radius (what breaks if I change this?), test_scope (which tests to run?), explain_symbol (why did this rank here?). See MCP Tools Reference for all 28 tools.

Verify it works:

  1. Start a session with your agent
  2. Ask: "Use the context_for_task tool to find symbols related to [something specific in your code]"
  3. You should see ranked symbols with scores and file paths from your codebase

If results are empty: the repo may still be indexing (10-30 seconds on first launch). If results seem unrelated: use specific symbol names in your task description (e.g., "find the AuthMiddleware handler" not "find auth code"). You can also verify from the CLI:

bash
knowing stats          # should show nodes and edgesknowing query "MyFunc" # should find symbols you recognize

For HTTP transport (multi-agent, daemon mode):

bash
knowing serve -addr :8100 .
json
{  "mcpServers": {    "knowing": {      "url": "http://localhost:8100",      "transport": "streamable-http"    }  }}

Why This Works

Git versions files. knowing versions the understanding of code.

The entire system is built on one idea: content-addressed identity. Every symbol, relationship, and snapshot is SHA-256 hashed. This single choice gives you:

  • Staleness detection for free. Changed file = new hash = stale edges are known without scanning.
  • Caching for free. Same package root = same results. 93x speedup on unchanged queries.
  • Integrity for free. Verify all stored hashes and snapshot chain continuity. 98ms.
  • History for free. Each snapshot is a Merkle root tied to a git commit. Walk the chain.
  • Feedback expiration for free. Feedback stores the package Merkle root. Code changes = root changes = old feedback is invisible.
  • Proofs for free. Merkle path from leaf to root is a self-contained cryptographic proof.
Gitknowing
What it versionsFile contentsCode relationships and their meaning
Unit of storageblobnode + edge + provenance + confidence
Identitysha256(content)sha256("node\0" + repo + package + name + kind)
Snapshottree of blobsHierarchical Merkle: repo -> package -> edge-type -> leaf
DiffWhich lines changedWhich packages changed, what broke, what's new
HistoryWhat code looked likeWhat the codebase understood about itself

How It Works

+------------------------------------------------------------------+|                         knowing daemon                            |+----------------+------------------------+--------------------------+|   Indexer      |     Graph Store        |      MCP Server          ||                |                        |                          || 23 extractors  | Content-addressed      | 28 tools + 8 resources   || tree-sitter    | SQLite + Merkle tree   | stdio / HTTP (1.8s index)|| LSP + SCIP     | 38 edge types          | GCF / GCB / JSON         || OTel traces    | Subgraph cache (93x)   | PackRoot dedup (99%)     ||                | Embedding vector cache | Embedding re-ranker      ||                | Community detection    | Supply chain audit       |+----------------+------------------------+--------------------------+

Two planes:

  • Execution: indexes repos, extracts symbols and relationships, ingests traces, stores snapshots.
  • Intelligence: computes blast radius, context packs, test scope, feedback, communities from the stored graph.

The boundary matters: intelligence features read the graph and produce derived results. They cannot corrupt graph facts. A bad ranking produces a bad recommendation; it cannot invalidate a proof.


Capabilities

Languages And Formats

Language/FormatExtractorFramework/Pattern Detection
Gotree-sitter + go/packages + SCIPnet/http, gin, echo, chi, gorilla/mux
TypeScript/JavaScripttree-sitterExpress.js, Fastify, Hono, NestJS, Next.js
Pythontree-sitterFlask, FastAPI, Django
Rusttree-sitterActix, Axum, Rocket
Javatree-sitterSpring annotations
C#tree-sitterASP.NET attributes
Protocol Bufferstree-sitterservice, message, enum, RPC declarations
Terraform (HCL)tree-sitterresource, data, module, variable declarations
SQLtree-sittertables, views, functions, procedures, FK edges
Kubernetes YAMLyaml.v3deployments, services, configmaps, label-selector edges
CloudFormation/SAMyaml.v3resources, !Ref/!GetAtt/!Sub cross-references
Docker Composeyaml.v3services, ports, networks, depends_on links
GitHub Actionsyaml.v3workflows, jobs, steps, action references
Serverless Frameworkyaml.v3functions, events, resource references
CSS/SCSStree-sitterselectors, custom properties, var() dependencies
Event/MQ patternsmulti-languageKafka, NATS, SQS, RabbitMQ publish/subscribe
OpenAPI/JSON Schemajson/yamlendpoints, models, $ref resolution
DockerfileparserFROM base images, COPY --from multi-stage deps, EXPOSE ports
Makefileparsertarget dependencies, include directives, variable references
Helm Chartsyaml.v3chart dependencies, template references, values injection
GitLab CIyaml.v3job needs, extends templates, include files, artifacts
package.json (npm)jsondependencies, devDependencies, peerDependencies, scripts
GraphQLparsertype definitions, field type references, interface implementations
Rubytree-sitterclasses, modules, method definitions, require edges
.env filesparserenvironment variable declarations, cross-file references

All extractors fire per file via multi-dispatch; results are merged. Tree-sitter produces edges at confidence 0.7 (ast_inferred); go/packages and SCIP at 0.95-1.0 (ast_resolved, scip_resolved).

MCP Tools

ToolPurpose
index_repo, graph_query, repo_graphBuild and inspect the graph
cross_repo_callers, blast_radius, trace_dataflow, flow_betweenUnderstand impact and paths
snapshot_diff, semantic_diff, pr_impact, stale_edgesCompare graph states and review changes
runtime_traffic, dead_routes, trace_statsQuery runtime-observed relationships
context_for_task, context_for_files, context_for_pr, explain_symbolRanked context for agents
ownership, ownership_query, test_scope, communities, plan_turn, feedbackRoute work, query code owners/authors, select tests, improve ranking
prove, prove_absent, fsckCryptographic proofs, absence proofs, integrity verification
untrack_repoEvict all data for a repository (nodes, edges, files, snapshots, feedback, task memory, graph notes)

MCP prompts: refactor_safely, review_pr, investigate_dead_code.

MCP Resources

8 read-only resources for agent orientation without a tool call:

ResourceWhat it returns
knowing://reportGraph size, top kinds, hotspot count, snapshot age
knowing://schemaNode kinds, edge types, provenance tiers, hash format
knowing://statsCounts by repo, kind, and edge type
knowing://reposAll tracked repos with counts and last-indexed time
knowing://sessionContext calls, symbols served, cache hits/misses, uptime
knowing://index-healthHealthy/stale/corrupted status, integrity check
knowing://communitiesCommunity list with cohesion and Merkle roots
knowing://community/{id}Single community detail (resource template)

Wire Formats

FormatPurposeSavings vs JSON
GCF (Graph Compact Format)LLM consumption: line-oriented, positional fields84% fewer tokens
GCB (Graph Compact Binary)Service transport and caching: varint, length-prefixed74% fewer bytes
JSONHuman debugging, generic consumersBaseline

GCF uses |-separated fields and local IDs ($1 -> $3) instead of repeated qualified names. Parseable by LLMs while fitting 5x more graph context into the same token budget. Session-stateful deduplication reduces repeated symbols by 47%.


Current Boundaries

  • Static blast radius follows calls edges; other edge types provide context, not traversal.
  • Runtime tools require OpenTelemetry trace ingestion; without traces they have no observations.
  • LSP enrichment: Go, TypeScript, Python, Rust, Java, C#. Auto-detected from project markers. Others fall back to tree-sitter.
  • Embeddings are off by default (confirmed neutral on cold-start benchmarks, session 23). Use --embeddings to opt in.

Documentation

DocContents
IntroductionHow it works, retrieval pipeline explained, 5-minute walkthrough
ArchitectureSystem design, schemas, content addressing, daemon model
FeaturesImplementation inventory, entry points, limitations
Audit & ComplianceMerkle proofs, fsck, snapshot chain, CI gates
CLI ReferenceCommands, flags, examples, troubleshooting
MCP ToolsTool schemas, parameters, return formats
Edge TypesRelationship semantics and provenance
Context PackingRWR, HITS, ranking, token budgeting
Embedding Re-rankerLocal inference, vector cache, latency profile
Runtime TracesOTel ingestion and runtime confidence
Wire FormatsGCF, GCB, JSON formats and benchmarks
RoadmapCompleted workstreams and next priorities
BenchmarksReproducible value benchmarks with performance contracts
ResearchThe thesis knowing is built on: content-addressing as a computation primitive (DOI: 10.5281/zenodo.20342255)
HooksClaude Code hook integration

License

Apache-2.0 (c) 2026 Dayna Blackwell / Blackwell Systems. See LICENSE and NOTICE.

来源:README.md,提交 988a9e7

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

2
  1. v0.16.0最新Sep 23, 2026
  2. v0.15.1Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分