跳转至

English translation of 中文 · The Chinese version is canonical; if they disagree, the Chinese wins.

YAI Agent Core

English · 简体中文

An in-process embedded, adaptive Agent kernel — the SQLite of the Agent world. You do not need to deploy an agent platform, and you do not need to write Agent Loop / Planner / tool-selection code: import the kernel into the software you already have, the host only declares "what capabilities I have", and Core discovers capabilities, picks a strategy, calls tools, and completes the task.

  • Repository: github.com/Gi-Tuu/yai-agent-core (mirrored on Gitee)
  • Install: pip install yai-agent-core · License: MIT · Version: v0.36.0
  • Zero third-party hard dependencies: model, MCP, OpenAPI, browser/desktop, and OTel are all optional and lazily loaded

Run it in 30 seconds

pip install yai-agent-core
import asyncio
from yai_core import AgentCore, ScriptedModel, ModelResponse, ToolCallRequest, build_spec

def search_notes(keyword: str) -> list[str]:
    """Search the host's note store."""     # your own ordinary business function, with no Agent code
    return {"weekly": ["Core skeleton", "tool calls"]}.get(keyword, [])

model = ScriptedModel([                      # offline deterministic model; swap in OpenAICompatProvider() in production
    ModelResponse(content="", tool_calls=[ToolCallRequest(id="c1", name="search_notes",
                 arguments={"keyword": "weekly"})]),
    ModelResponse(content="2 weekly notes this week."),
])
core = AgentCore(model)
core.register_tools([build_spec(search_notes)])   # introspects type hints / docstring to build the tool
print(asyncio.run(core.run("Search the weekly notes and summarize")).final_text)   # 2 weekly notes this week.

The repository also ships a complete example with event streaming: python examples/quickstart.py.

You want to… Read this
Figure out all the docs and which one is authoritative Document map
Know "how far it got, and where the evidence is" Capability and evidence index
Understand the kernel layering and data flow Architecture
Read the code in order (with line-by-line notes) Reading guide → Walkthrough overview
Go to production: permissions, approval, deployment Production permissions guide · Deployment handbook
Do browser / desktop automation Browser extension and Bridge
See measured numbers (rather than slogans) Evaluations and evidence
See versions and changes Changelog
Compare with platforms / frameworks How it differs from peers

What this is (the one-minute version)

  • Capability self-discovery: the type hints + docstring of an ordinary Python function automatically become a JSON Schema tool; external MCP / OpenAPI plug in the same way.
  • Adaptive routing: tasks automatically take direct / react / plan / clarify, and every decision is a visible event — replayable and auditable.
  • Capabilities on demand: sense a capability gap → ask discovery sources for candidates → register → callable in this very turn.
  • Governance: three permission tiers, argument-level approval, scope gates, execution receipt hash chain, trusted change previews.
  • Embeddable: lives in the host process, no standalone service; ten SPI contracts, every part is replaceable.

For more detail read the README and the whitepaper.