How hj12hj/ai-agent-platform works
This repository is an enterprise AI-agent platform split into a governance control plane, a LangGraph execution runtime, and a Vue console. A user submits a chat request through the console; the Platform API applies identity, project, policy, and model configuration before forwarding a managed contract to the runtime. The runtime executes agent graphs and streams progress back for the console to render. README-described capabilities include HITL approvals, MCP/tools, persistent state, workspaces, memory, scheduled tasks, and execution diagnostics. Some runtime internals are unsampled, so those branches are documented at directory level.
Main entry points: runtime-service Runtime Service · service.py Runtime Gateway · ChatSession.vue Chat Workspace · session.service.ts Session Client
Components 22
User Console
- Chat Workspace
apps/platform-web/src/modules/chat/components/ChatSession.vue - Session Client
apps/platform-web/src/services/threads/session.service.ts - Task Console
apps/platform-web/src/modules/chat/composables/useBackgroundTasks.ts
Platform Governance
- Platform API
apps/platform-api/src/platform_api/main.py - Runtime Gateway
apps/platform-api/src/platform_api/modules/runtime_gateway/application/service.py - Project Governance
apps/platform-api/src/platform_api/modules/projects/repository.py - Thread Access
apps/platform-api/src/platform_api/modules/runtime_gateway/application/thread_access.py - Model Catalog
apps/platform-api/src/platform_api/modules/runtime_catalog/application/service.py - Runtime Policies
apps/platform-api/src/platform_api/modules/runtime_policies/application/service.py
Agent Execution
- Runtime Service
apps/runtime-service - Workspace Sandbox
apps/runtime-service/src/runtime_service/sandbox_node/engine.py - Workspace Storage
apps/runtime-service/src/runtime_service/sandbox_node/storage.py - Run Control
apps/runtime-service/src/runtime_service/run_control/service.py - Background Tasks
apps/runtime-service/src/runtime_service/background_tasks/service.py
Agent Capabilities
- Agent Graphs
apps/runtime-service - Tools and MCP
apps/runtime-service - Memory Pipeline
apps/runtime-service/src/runtime_service/services/dearflow_agent - HITL Approvals
apps/runtime-service - Run Diagnostics
apps/runtime-service/src/runtime_service/observability/query.py
Other components
- Platform User
- LLM Provider
- MCP Services
Connections 22
- Platform User → Chat Workspace: submits prompt
README.md - Chat Workspace → Session Client: sends session requests
README.md - Session Client → Platform API: calls platform APIs
README.md - Platform API → Runtime Gateway: routes requests
apps/platform-api/src/platform_api/main.py - Runtime Gateway → Project Governance: checks project scope
apps/platform-api/src/platform_api/modules/runtime_gateway/application/service.py - Runtime Gateway → Thread Access: enforces thread access
apps/platform-api/src/platform_api/modules/runtime_gateway/application/service.py - Runtime Gateway → Model Catalog: loads model settings
README.md - Runtime Gateway → Runtime Policies: applies runtime policy
apps/platform-api/src/platform_api/modules/runtime_gateway/application/service.py - Runtime Gateway → Runtime Service: forwards managed contract
README.md - Runtime Service → Agent Graphs: executes graphs
README.md - Agent Graphs → LLM Provider: requests inference
README.md - Agent Graphs → Tools and MCP: dispatches tool calls
README.md - Tools and MCP → MCP Services: invokes MCP tools
README.md - Agent Graphs → HITL Approvals: pauses for approval
README.md - Runtime Service → Run Control: manages run state
- Runtime Service → Background Tasks: schedules background work
- Runtime Service → Workspace Sandbox: provides workspace execution
apps/runtime-service/src/runtime_service/sandbox_node/engine.py - Workspace Sandbox → Workspace Storage: reads and writes files
apps/runtime-service/src/runtime_service/sandbox_node/storage.py - Agent Graphs → Memory Pipeline: uses long-term memory
README.md - Runtime Service → Run Diagnostics: reports execution diagnostics
apps/runtime-service/src/runtime_service/observability/query.py - Runtime Service → Session Client: streams run events
README.md - Chat Workspace → Task Console: shows task updates