Feature request: Pydantic AI integration
For human review. This issue was drafted from the Knolo Adoption Targets research. A human will review it and implement it manually. No code or pull request accompanies it.
Motivation
Pydantic AI is a popular type-safe Python agent framework with a built-in MCP client, so @knolo/mcp plugs in directly. A documented, tested path strengthens Knolo's Python story next to CrewAI (#95).
Adoption case
Sheet traction (Knolo Adoption Targets, Nov 2 candidate):
- pydantic/pydantic-ai: 20,992 GitHub stars (GitHub API, checked 2026-11-02)
- PyPI pydantic-ai: 1,723,783 downloads last week (https://pypistats.org/api/packages/pydantic-ai/recent, checked 2026-11-02)
Sources: https://github.com/pydantic/pydantic-ai ; https://ai.pydantic.dev/mcp/client/ ; https://pypistats.org/packages/pydantic-ai
What exists today
@knolo/tools0.2.0 (in tree): host-agnostic read-only service. Pins a V5 Knowledge Image by file SHA-256 and state root, checks the policy root, and writes a query receipt before results return. Caller identity is supplied by the host.@knolo/mcp0.2.0 on main (npm still 0.1.0): stdio server withknolo_search,knolo_get,knolo_verify,knolo_status, plusknolo_kar_evaluate,knolo_kar_verify,knolo_cortex_verifyfor mounts with a pinned graph (PR #80, PR #87). Started withnpx -y @knolo/mcp --config /absolute/knolo-mcp.json. Stdio only, no network at runtime.@knolo/coreand@knolo/cli6.2.0, including KAR, composition and Cortex. PyPIknolo5.5.1 (packages/core-python) has no KAR features.- Existing adapters:
@knolo/openclaw,@knolo/langchain,@knolo/llamaindex. Open requests for other frameworks: #90 (OpenAI Agents SDK), #95 (CrewAI, Python), #93 (Mastra), #92 (Vercel AI SDK).
Proposed design
examples/pydantic-ai: an agent that attaches @knolo/mcp as a stdio MCP server (npx -y @knolo/mcp --config ...) through Pydantic AI's MCP client, runsknolo_search, and returns a typed result model that carries the receipt id, state root and object ids so answers can be cited.- A CI smoke test that runs the example offline against a fixture image using a test model, so no model API key is needed.
- Optional, decided at review: a small
knolo-pydantic-aitoolset over PyPI knolo 5.5.1 for search and get only. No KAR features are promised in Python, since PyPI knolo 5.5.1 lacks them.
Scope
In: the example, the CI smoke test, README docs. Out: a Python port of KAR or Cortex, hosted services, network image downloads, write tools, any model calls inside Knolo. Any listing on Pydantic AI docs would be a separate manual step.
Acceptance criteria
- Example runs offline against a fixture image and returns results with receipt ids.
- Pin, policy and audit failures surface the same error codes as @knolo/tools (
ACCESS_DENIED,AUDIT_UNAVAILABLE, etc.). - KAR and Cortex tools only appear when a graph is pinned, matching @knolo/mcp behavior.
- Docs state that verification checks integrity and does not decide that a claim is true.
Open questions
- Is the MCP example enough, or is a native Python toolset worth shipping before Python has KAR?
- Share one Python example harness with #95 (CrewAI)?
Related
- #79 / PR #80: @knolo/mcp read-only server
- #84 / PR #87: KAR and Cortex tools in @knolo/mcp
- #95: CrewAI tool (Python)
- #90: OpenAI Agents SDK integration (same MCP-first pattern)
Knolo is open source under Apache-2.0, built by Hive Forensics AI Inc. R&D.