Files
devos/Docs/devos-v1/08-AI-AGENT-ARCHITECTURE.md
T
phptits 0d6cd37579 DevOS v1 + Phase 2: unified resource model, infra ops, website deployment, AI chat ops
- Monorepo: NestJS API (Fastify) + React web (antd/ProComponents) + shared packages
- PostgreSQL/Prisma (unified resources, relations graph, audit, events, jobs)
- Auth/RBAC/workspace isolation, credential vault (AES-256-GCM)
- Servers/SSH, Docker discovery & lifecycle, Job Center
- Websites & deployments (git provider credential clone, env, health verification)
- Domains/DNS (Cloudflare adapter), certificates (TLS probe), monitoring
- Automation (cron/event/webhook HMAC + notifications), AI Gateway, MCP (29 tools)
- AI chat window (LLM function-calling + rules fallback, SSE streaming, approvals)
- Notes: Vditor WYSIWYG markdown editor, non-blocking autosave
- Tests: 35 unit/security tests; UI audit clean (desktop+mobile, deep links)
2026-09-10 06:35:55 +00:00

1.7 KiB

DevOS v1 AI Agent Architecture

1. Principle

AI is an operating layer, not merely a chat feature.

                    AI Gateway
                         |
              +----------+----------+
              |                     |
            Agent                 Memory
              |
       +------+------+------+
       |      |      |      |
     Tools   MCP  Workflow Approval

2. Agent Loop

Observe
  ↓
Discover Resources
  ↓
Plan
  ↓
Risk Evaluation
  ↓
Approval if required
  ↓
Execute Tools
  ↓
Verify
  ↓
Report

3. Tool Examples

  • server.list
  • server.exec
  • server.restart
  • server.getStatus
  • server.getDockerContainers
  • website.list
  • website.deploy
  • website.logs
  • git.repositories
  • git.commits
  • domain.records
  • email.search
  • note.create
  • task.create

4. Context

Agent context should be built from:

  • workspace
  • user permissions
  • relevant resources
  • resource relations
  • recent events
  • task/run history
  • tool schemas

Do not indiscriminately inject the entire database into the model.

5. Risk

Risk levels:

  • LOW
  • MEDIUM
  • HIGH
  • CRITICAL

HIGH and CRITICAL operations require user approval by default.

Examples:

  • production deployment
  • destructive filesystem operations
  • database deletion
  • credential changes

6. Verification

An Agent action is not successful merely because a command returned zero. The Agent should perform domain-specific verification where possible:

  • deployment health
  • HTTP health check
  • container state
  • DNS propagation/result
  • SSL availability

7. Action Log

Agent runs should expose human-readable steps such as:

  • found target server
  • Docker available
  • repository connected
  • deployment created
  • container started
  • health check passed