How ai-setu-yn/ai-runtime works
AI Runtime is an enterprise orchestration service for answering /chat requests through planning, tool execution, observation, and response generation. The graph emphasizes that documented request flow, with supporting security, guardrail, authorization, search, and capability-retrieval subsystems. Edges use README statements or source-index references; several runtime modules were not sampled, so undocumented wiring is omitted.
Main entry points: agent.py General agent · service.py Tool executor · chat_service.py Chat service · runtime.py Chat API
Components 29
Request and agent
- Chat API
app/api/routes/runtime.py - Chat service
app/services/chat_service.py - Workflow manager
app/graph/workflow.py - General agent
app/agent/agent.py - Agent decisions
app/agent/decision.py - Agent observations
app/agent/observation.py - Agent memory
app/agent/memory.py - Runtime state
app/graph/state.py
Planning and generation
- Planner service
app/planner/service.py - Planner parser
app/planner/parser.py - Plan models
app/models/planner.py - Model gateway
app/model_gateway/client.py - Response generator
app/graph/nodes/response_generator.py
Tools and integrations
- Tool executor
app/tool_executor/service.py - Tool registry
app/tool_registry/service.py - MCP client
app/mcp_client/client/client.py - MCP servers
- Web search
app/web_search/client.py
Security and safety
- Security classifier
app/security/service.py - Authentication
app/security/auth.py - Guardrail engine
app/guardrails/engine.py - Guardrail audit
app/guardrails/audit.py - RBAC authorization
app/rbac/service.py
Runtime support
- Capability retrieval
app/capability_retrieval/service.py - Capability repository
app/capability_retrieval/repository.py - Capability models
app/capability_retrieval/models.py - Conversation context
app/conversation/context.py - Request context
app/middleware/request_context.py
Other components
- Chat caller
Connections 27
- Chat caller → Chat API: submits chat
README.md - Chat API → Chat service: routes request
README.md - Chat service → Workflow manager: starts workflow
README.md - Workflow manager → General agent: runs agent
README.md - General agent → Planner service: plans request
README.md - Planner service → Model gateway: requests plan
README.md - Planner service → Planner parser: parses plan
app/planner/parser.py - Planner parser → Plan models: produces plan models
app/planner/parser.py - General agent → Tool executor: executes plan
README.md - Tool executor → Tool registry: resolves tools
app/tool_executor/service.py - Tool executor → MCP client: invokes tools
app/tool_executor/service.py - MCP client → MCP servers: calls server
README.md - Tool executor → Web search: searches web
app/tool_executor/service.py - General agent → Agent observations: records observations
README.md - General agent → Agent decisions: chooses next step
README.md - General agent → Agent memory: uses memory
- General agent → Response generator: finalizes response
README.md - Response generator → Model gateway: generates response
README.md - Workflow manager → Runtime state: converts state
README.md - Chat service → Security classifier: classifies request
app/services/chat_service.py - Chat service → Guardrail engine: checks content
app/services/chat_service.py - Guardrail engine → Guardrail audit: records decisions
app/guardrails/engine.py - Chat API → Authentication: authenticates caller
- Tool executor → RBAC authorization: checks authorization
- Capability retrieval → Capability repository: reads and writes
app/capability_retrieval/service.py - Capability retrieval → Capability models: uses data models
app/capability_retrieval/service.py - Request context → Conversation context: sets request context
app/middleware/request_context.py