TestGraph

TestGraph

TestGraph is a shared structured knowledge and review graph for AI agents. Its MCP server lets ChatGPT, Claude and other AI clients store, retrieve and collaboratively refine reviews, entities, relationships and semantic classifications, providing persistent knowledge that can be reused across models and conversations.

Category
访问服务器

README

TestGraph

Experimental AI-native experience graph for shared, verifiable memory across AI assistants.

Status: working pre-release research system. The architecture and MCP workflows have been exercised with multiple AI clients, but the project is not yet presented as a stable production service or API.

TestGraph stores human reviews and AI-derived structure as durable graph knowledge while keeping evidence, provenance and server-verifiable execution separate from model claims. It is designed so that different AI systems can contribute to and reuse the same knowledge without requiring a complete domain schema in advance.

Project goals

  1. Schema emergence: Give several AIs unfamiliar experiences and obtain a useful structure without designing the categories beforehand.
  2. Controlled disagreement: Conflicting classifications converge through evidence, confidence and server rules instead of flip-flopping.
  3. Truthful execution: Models cannot claim that discovery, enrichment or reconciliation happened unless the server can verify it.
  4. Calling-AI capability: TestGraph deliberately uses the calling AI as its semantic and discovery engine. The AI should apply its available reasoning, retrieval and tool capabilities to unfamiliar subjects, derive useful structure and relationships, and reconcile evidence without waiting for TestGraph to prescribe a domain-specific form. TestGraph provides stable graph primitives, persistence and server-side verification; the calling AI provides the open-ended intelligence.

These goals are acceptance criteria for TestGraph's architecture and tests, not merely guidance for individual AI clients.

Standard vocabulary model

Reviews are stored against stable subject_type_id values, not DNS-style concept paths. Flexible input is resolved through canonical subject types and globally unique aliases; case, punctuation, possessives and ordinary plurals are normalised mechanically. Unknown types may be created as provisional entries after dictionary lookup.

Classification is separate metadata. For example, ferry belongs_to transportation improves broad transportation searches but never changes where a ferry review is stored. review is the record type, not a vocabulary node. Reusable structured fields have their own stable IDs and aliases and may be attached to multiple subject types.

Migration 0009_flat_standard_vocabulary deliberately discards the old v2 concept/review data while preserving users, OAuth state, capability credentials and other authentication data.

Local setup

  1. Create a Python 3.11+ virtual environment.
  2. Install dependencies:
pip install -r requirements.txt
  1. Copy .env.example to .env and replace every placeholder secret with a private value.
  2. Run migrations:
alembic upgrade head
  1. Seed schemas and demo identities:
python -m scripts.seed
  1. Start the application:
python run.py

Open http://127.0.0.1:8000 and http://127.0.0.1:8000/docs.

Do not reuse example or development credentials outside a local development environment. Secrets, API keys, OAuth connection codes and owner identifiers must never be committed to the repository.

MCP and OAuth

TestGraph includes a tool-only MCP app. The current multi-model integration is exercised through /mcp-v2. Its production connection uses OAuth 2.1 Authorization Code + PKCE. A connected AI receives a short-lived scoped token; it does not receive the connection code, API key or TestGraph owner ID.

The MCP surface includes review search/fetch/save operations and the newer graph/reconciliation capabilities used by multi-model experiments. Treat the deployed MCP schema as authoritative because this experimental surface is still evolving.

Before a deployment, configure a long random OAUTH_CONNECTION_CODE, set the appropriate OAUTH_OWNER_USER_ID, and ensure production secrets exist only in the deployment environment.

Import the open UCI recipe reviews

After migrations and python -m scripts.seed, run:

python -m scripts.import_uci_recipe_reviews --representative-reviews 100 --load

This downloads the CC BY 4.0 UCI dataset and chooses one evidence-rich review from each of its 100 recipes. It writes the converted records to data/uci_recipe_reviews_100.json and loads them into the configured database. Re-running it is safe: stable source IDs prevent duplicates.

The original review text, 0-5 star score, timestamp, votes, source record ID, licence and attribution are preserved in provenance. The importer interprets explicit statements about flavour, clarity, timing, ingredient availability, difficulty, repeat-worthiness and modifications. Each interpretation retains its supporting source sentence; anything unsupported remains null.

To load the checked bundle without downloading or regenerating it:

python -m scripts.import_uci_recipe_reviews --load-bundle data/uci_recipe_reviews_100.json

Development data reset

A guarded reset page is available at /development/reset. It is hidden and returns 404 unless explicitly enabled:

ENABLE_DEVELOPMENT_RESET=true

The page permanently removes v1/v2 review and knowledge data while preserving users, schemas, OAuth connections and capability credentials. It must remain disabled in a public production deployment.

Tests

pytest -q

A public release should not be cut unless the full test suite passes against the release commit and the deployment readiness check succeeds. See RELEASE_CHECKLIST.md.

Railway deployment

  1. Push the repository to GitHub.
  2. Create a Railway project from the GitHub repository.
  3. Add PostgreSQL.
  4. Reference the Postgres service's DATABASE_URL; do not paste an unresolved Railway reference as a plain string.
  5. Configure production variables, using unique random secrets:
ENVIRONMENT=production
APP_SECRET=<random secret>
DEVELOPMENT_API_KEY=<long random key; development/admin use only>
CLIENT_API_KEYS={}
OAUTH_OWNER_USER_ID=<owner UUID>
OAUTH_CONNECTION_CODE=<long random connection code>
PUBLIC_BASE_URL=https://<your-domain>
ALLOWED_HOSTS=["<your-domain>","<railway-domain>"]
CORS_ORIGINS=["https://<your-domain>"]
ENABLE_DEVELOPMENT_RESET=false

railway.json configures pre-deploy migrations, Uvicorn startup using Railway's $PORT, and readiness checking at /health/ready.

The application converts Railway's postgresql:// URL to SQLAlchemy's postgresql+psycopg:// form because the project uses Psycopg 3. A production deployment that cannot resolve PostgreSQL should stop rather than silently fall back to SQLite.

Architecture implemented

  • Calling-AI capability as the open-ended semantic and discovery engine, with the server as verification/persistence layer
  • Stable flat subject-type IDs
  • Canonical terms and aliases
  • Editable type relationships used for search rather than storage addresses
  • Versioned schema registry
  • Domain-specific Pydantic validation stored as JSON/JSONB
  • Draft-first publication with explicit approval/version
  • Scoped client credentials
  • Central read policy
  • Canonical subject resolution and version-checked draft editing
  • OAuth 2.1 Authorization Code + PKCE, dynamic client registration, refresh-token rotation and scoped access tokens
  • MCP endpoint for authenticated AI access
  • Idempotency keys
  • Provenance, consent, ownership and visibility
  • Pairwise reviewer-reader alignment and reader-specific relevance
  • Audit log and soft deletion
  • Request IDs, consistent JSON errors, request-size limits and pagination-ready endpoints
  • Alembic migrations
  • SQLite locally; PostgreSQL in production
  • Cross-model reconciliation and server-recorded deliberation/assessment workflows

Safe read and editing rules

  • Public lists return only experiences that are both published and public.
  • Exact IDs may also retrieve a published unlisted experience.
  • Drafts and private experiences require an appropriate read credential.
  • aggregate_only experiences are never returned as individual reviews.
  • Resolve subjects before editing or attaching structured knowledge.
  • Version checks protect concurrent draft editing.
  • Optional client credentials must use unique, revocable secrets and the minimum scopes required.

Licence

TestGraph is licensed under the GNU Affero General Public License v3.0 (AGPL-3.0). See LICENSE.

The AGPL permits use, modification and redistribution subject to its terms, including its network-source obligations for modified versions used to provide a network service.

If AGPL-3.0 does not meet your requirements, alternative commercial or proprietary licensing may be available. Contact testgraph@21dle.co.uk to discuss a separate licence agreement.

Contributors should read CONTRIBUTING.md. Contributions are accepted only on terms that preserve the project's ability to offer alternative licences.

Before making the repository public

Read RELEASE_CHECKLIST.md and SECURITY.md. In particular, complete the secret-history review, confirm the public-data boundary, run the complete test suite, and verify a clean deployment from the exact release commit.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选
mcp-server-qdrant

mcp-server-qdrant

这个仓库展示了如何为向量搜索引擎 Qdrant 创建一个 MCP (Managed Control Plane) 服务器的示例。

官方
精选
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选