政府gpt
gov-gpt 为美国支出API构建一个证据支持的语义MCP。
该产品不是薄HTTP包装器。目标是一个工具表面,让 编码或分析代理发现正确的美国支出端点,了解 其输入和输出的商业意义,构建有效请求,检查 证据,并进行有限的现场通话。
方向
主要工作流程是代理式的:
- 代理SDK生产商
scripts/agents作者Semantic Profile V2捆绑包。 - 该模型具有端点调查、协调和语义综合功能。
- 本地代码提供工具、广泛的YOLO shell访问、工件写入、通用
验证器、MCP烟雾测试和推广。
- 允许使用确定性代码作为门。它不应该是作者
端点特定语义。
持久工件是一个四文件语义包:
profiles//semantic/
endpoint.json
semantics.json
evidence.jsonl
usage.md这些捆绑包由MCP服务器加载,并通过语义公开 发现、理解、请求构建、验证和执行工具。
flowchart LR
A["USAspending docs and source"] --> B["Agents SDK producer\nYOLO autonomy"]
B --> C["Semantic Profile V2 bundle"]
C --> D["Generic validators\nreview/repair/story gates"]
D --> E["profiles//semantic"]
E --> F["MCP server\nsemantic + raw tools"]
F --> G["Coding agents and analysts"]快速开始
先决条件:
- Node.js 22+
- npm
- Python 3.11+
OPENAI_API_KEY或CODEX_API_KEY在.env
安装依赖项:
npm --prefix scripts/agents install --silent
npm --prefix scripts/codex install --silent
npm --prefix scripts/mcp install --silent通过语义生成器运行一个端点:
make agents-semantic \
SLUG=v2__search__spending_by_geography \
AGENTS_OUT_ROOT=runs/agents-sdk-demo \
AGENTS_AUTONOMY=yolo验证生成的捆绑包:
make semantic-validate SEMANTIC_ROOT=runs/agents-sdk-demo当一个捆绑包足够重要,可以推广时,进行审查、修复和故事测试:
make agents-review \
SLUG=v2__search__spending_by_geography \
AGENTS_OUT_ROOT=runs/agents-sdk-demo \
> runs/review.json
make agents-repair \
SLUG=v2__search__spending_by_geography \
AGENTS_OUT_ROOT=runs/agents-sdk-demo \
AGENTS_REVIEW_REPORT=runs/review.json \
AGENTS_REPAIR_TASK_ID=
make agents-story \
AGENTS_BUNDLE_GLOB="/Users/saulrichardson/projects/gov-gpt/runs/agents-sdk-demo/*/endpoint.json" \
AGENTS_STORY_OUTPUT=runs/story.json只有在满足以下条件后,才能将语义包升级到MCP加载的配置文件目录中 bundle通过通用门。然后验证并冒烟测试服务器:
scripts/mcp/bin/validate-semantic-bundles
scripts/mcp/bin/smoke-client
scripts/mcp/bin/stdio-server运行时MCP
MCP服务器 scripts/mcp 暴露:
- 语义发现工具,如
usaspending.findConcepts,
usaspending.findEndpoints,以及 usaspending.findWorkflows
- 语义检查工具,如
usaspending.getEndpointSchema,
usaspending.getEndpointSemantics, usaspending.getEvidence,以及 usaspending.getUsageGuide
- 请求助手,例如
usaspending.getRequestTemplate,
usaspending.validateRequest, usaspending.explainValidationError,以及 usaspending.listRequestFields
- 通过执行
usaspending.callEndpoint - 原始端点别名,如
usaspending.v2__search__spending_by_award
客户端配置片段:
scripts/mcp/bin/print-client-configs支持原始剖面管道
年长者 scripts/codex 管道仍然支持原始端点配置文件 世代通过 discover, validate,以及 reconcile它仍然对以下方面有用 原始MCP覆盖率、分阶段文档和共享的Semantic Profile V2验证器。
这不是语义MCP创作路径。新的语义端点知识应该 通过以下方式生产 scripts/agents.
原始剖面流:
python scripts/stage_docs.py --version v2
make pipeline SLUG=v2__awards__last_updated
make promote-profile SLUG=v2__awards__last_updated
scripts/mcp/bin/validate-profiles文档地图
- 工程方法:
docs/engineering-approach.md - 目标MCP形状:
docs/mcp-target-shape.md - 语义配置文件V2合同:
docs/semantic-profile-v2.md - 代理运营模式:
docs/semantic-agent-operating-model.md - YOLO访问审计和压力测试:
docs/agents-sdk-yolo-access-audit.md - 代理SDK运行器:
scripts/agents/README.md - MCP运行时间:
scripts/mcp/README.md - 原料食品法典委员会简介管道:
scripts/codex/README.md - 型材夹具:
profiles/README.md - 操作员手册:
OPERATIONS.md
验证
完整回购验证:
make verify在处理语义MCP时最常用的重点检查:
npm --prefix scripts/agents run typecheck
npm --prefix scripts/agents run test
npm --prefix scripts/agents run smoke
npm --prefix scripts/codex run semantic:validate -- --root runs/agents-sdk
npm --prefix scripts/mcp run typecheck
npm --prefix scripts/mcp run test
scripts/mcp/bin/validate-semantic-bundles