关于 Attesta
Attesta 是面向 AI Agent 的葡萄牙住宅房产数据与验证平台,提供带来源信息的数据和签名 JWS 验证。它包含数据采集与实体匹配流程、REST API 和 MCP 接口,并支持通过 JWKS 验证签名。
主要功能
- 01采集房产数据并支持内置样例
- 02匹配和解析房产记录
- 03提供 REST 与 MCP 接口
- 04生成并验证 JWS 签名
- 05通过 JWKS 发布公钥
- 06可选接入 LiteLLM 模型
适用场景
- 01在样例数据上运行本地采集流程
- 02通过 API 查询葡萄牙住宅房产数据
- 03验证房产数据的 JWS 签名
- 04用标注声明运行评估
MCP 相关
Attesta 在 `/mcp` 提供 MCP 接口,使 MCP 客户端可访问其房产数据能力。它还提供 REST API、JWKS 和证据相关接口。
配置
远程服务无需本地安装。选择你使用的客户端,复制配置或使用一键安装。
https://api-production-d9143.up.railway.app/mcpclaude mcp add --transport http doralboim-attesta https://api-production-d9143.up.railway.app/mcp{"mcpServers":{"doralboim-attesta":{"type":"http","url":"https://api-production-d9143.up.railway.app/mcp"}}}在 Cursor 中打开{"servers":{"doralboim-attesta":{"type":"http","url":"https://api-production-d9143.up.railway.app/mcp"}}}在 VS Code 中打开{"mcpServers":{"doralboim-attesta":{"type":"http","url":"https://api-production-d9143.up.railway.app/mcp"}}}{"mcpServers":{"doralboim-attesta":{"serverUrl":"https://api-production-d9143.up.railway.app/mcp"}}}命令在终端中运行;JSON 粘贴到对应客户端的 MCP 配置后重启。需要授权的服务会在首次连接时提示登录。
工具
详细介绍
Attesta
B2A 平台:提供葡萄牙住宅房产数据的来源证明级别保障,并为 AI Agent 提供签名 JWS 验证。
权威文档: attesta-architecture.md · attesta-agent-prompt.md
快速开始
make install
cp .env.example .env
make db-up # Postgres + pgvector
make migrate # apply Alembic migrations
make dev # API at :8000
| 端点 | URL |
|---|---|
| 健康检查 | /healthz |
| REST API | /docs |
| MCP | /mcp |
| JWKS | /.well-known/jwks.json |
| Agent 发现 | /llms.txt |
流水线(本地)
make ingest # attesta-ingest --fixture (bundled JSON corpus)
make resolve # attesta-resolve
make test
数据摄取
默认: 使用 tests/fixtures/ 中附带的固定数据,无需外部爬虫凭据。
make ingest # same as attesta-ingest --fixture
attesta-ingest --fixture # explicit
attesta-ingest --source idealista_pt # optional: Apify actor (needs APIFY_* in .env)
attesta-ingest --source imovirtual # optional: Apify actor
实时门户采集器实现 app/ingestion/base.py(BaseCollector)。基于 Apify 的 Idealista/Imovirtual 采集器以可选插件形式提供;添加新数据源时,应通过继承实现,而不是重构流水线。参见 docs/decisions/008-fixture-first-ingestion.md。
如需扩充生产数据集:选择采集器策略(构建 Apify actors、直接 HTTP、授权数据源或 CSV 导入),配置环境变量,并在 Railway 上安排数据摄取工作进程。
CI
GitHub Actions 会在 SQLite 和 Postgres 上运行 ruff、mypy(仅供参考)和 pytest。
决策
架构决策记录:docs/decisions/
Cursor 规则:.cursor/rules/
里程碑状态
- M0 — 骨架、CI、docker-compose、alembic 脚手架
- M1 — 架构、数据摄取工作进程、固定数据、PII 测试
- M2 — 实体匹配器、读取 API
- M3 — MCP 工具、计量关口、护栏
- M4 — 验证流水线、JWS/JWKS、证据 API、评估测试框架(62 条声明)、证明规范
- M5 — Railway 三服务配置、演示和验证脚本、OpenAPI 导出
验证
make eval # 62 labeled claims, 75% threshold
python scripts/verify_jws.py <jws> --local
python scripts/demo.py # E2E against local API
make openapi # writes public/openapi.json
LLM(可选,通过 LiteLLM 实现与提供商无关)
在 .env 中设置 LLM_ENABLED=true,并配置模型和提示词文件路径(参见 .env.example)。
使用 LiteLLM——将 LLM_PARSE_MODEL / LLM_ADJUDICATE_MODEL 指向任意受支持的提供商(anthropic/、openai/、gemini/、azure/、groq/ 等)。
提供商 API 密钥遵循 LiteLLM 的环境变量约定——只需设置所选提供商对应的密钥。
示例和成本估算参见 distribution/llm-providers.md。
证明规范:public/attestation-spec.md
市场数据契约(统计数据/可比房产数据封装):public/market-data-contract.md
评论
一个开放协议,规定了 AI 应用如何以统一方式连接外部工具与数据源。客户端负责与模型对话,MCP 服务负责提供工具、资源和提示模板,两者通过标准消息通信,同一个服务可以被不同客户端复用。