opc-agent 4.2.13 → 5.0.0-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (207) hide show
  1. package/.opc/memory.db +0 -0
  2. package/.opc/schedules.json +784 -0
  3. package/.opc/voice-tmp/tts-1776835848670.mp3 +0 -0
  4. package/.opc/voice-tmp/tts-1776835873696.mp3 +0 -0
  5. package/README.md +125 -141
  6. package/README.zh-CN.md +75 -160
  7. package/TASK.md +34 -0
  8. package/data/brain.db/deepbrain.sqlite +0 -0
  9. package/dist/channels/api.d.ts +14 -0
  10. package/dist/channels/api.d.ts.map +1 -0
  11. package/dist/channels/api.js +58 -0
  12. package/dist/channels/api.js.map +1 -0
  13. package/dist/channels/voice.d.ts +21 -0
  14. package/dist/channels/voice.d.ts.map +1 -1
  15. package/dist/channels/voice.js +31 -1
  16. package/dist/channels/voice.js.map +1 -1
  17. package/dist/cli/chat.d.ts.map +1 -1
  18. package/dist/cli/chat.js +104 -0
  19. package/dist/cli/chat.js.map +1 -1
  20. package/dist/cli/setup.d.ts +1 -1
  21. package/dist/cli/setup.d.ts.map +1 -1
  22. package/dist/cli/setup.js +263 -33
  23. package/dist/cli/setup.js.map +1 -1
  24. package/dist/cli.js +201 -116
  25. package/dist/cli.js.map +1 -1
  26. package/dist/core/agent-loop.d.ts +3 -0
  27. package/dist/core/agent-loop.d.ts.map +1 -0
  28. package/dist/core/agent-loop.js +51 -0
  29. package/dist/core/agent-loop.js.map +1 -0
  30. package/dist/core/context-assembler.d.ts +12 -0
  31. package/dist/core/context-assembler.d.ts.map +1 -0
  32. package/dist/core/context-assembler.js +81 -0
  33. package/dist/core/context-assembler.js.map +1 -0
  34. package/dist/core/guardrails.d.ts +16 -0
  35. package/dist/core/guardrails.d.ts.map +1 -0
  36. package/dist/core/guardrails.js +62 -0
  37. package/dist/core/guardrails.js.map +1 -0
  38. package/dist/core/index.d.ts +1 -0
  39. package/dist/core/index.d.ts.map +1 -0
  40. package/dist/core/index.js +3 -0
  41. package/dist/core/index.js.map +1 -0
  42. package/dist/core/iteration-budget.d.ts +12 -0
  43. package/dist/core/iteration-budget.d.ts.map +1 -0
  44. package/dist/core/iteration-budget.js +26 -0
  45. package/dist/core/iteration-budget.js.map +1 -0
  46. package/dist/core/runtime.js +1 -1
  47. package/dist/core/runtime.js.map +1 -1
  48. package/dist/core/types.d.ts +412 -0
  49. package/dist/core/types.d.ts.map +1 -1
  50. package/dist/deepbrain/embedding.d.ts +7 -0
  51. package/dist/deepbrain/embedding.d.ts.map +1 -0
  52. package/dist/deepbrain/embedding.js +108 -0
  53. package/dist/deepbrain/embedding.js.map +1 -0
  54. package/dist/deepbrain/index.d.ts +8 -0
  55. package/dist/deepbrain/index.d.ts.map +1 -0
  56. package/dist/deepbrain/index.js +19 -0
  57. package/dist/deepbrain/index.js.map +1 -0
  58. package/dist/deepbrain/migrate.d.ts +2 -0
  59. package/dist/deepbrain/migrate.d.ts.map +1 -0
  60. package/dist/deepbrain/migrate.js +139 -0
  61. package/dist/deepbrain/migrate.js.map +1 -0
  62. package/dist/deepbrain/provider.d.ts +13 -0
  63. package/dist/deepbrain/provider.d.ts.map +1 -0
  64. package/dist/deepbrain/provider.js +85 -0
  65. package/dist/deepbrain/provider.js.map +1 -0
  66. package/dist/deepbrain/recall.d.ts +9 -0
  67. package/dist/deepbrain/recall.d.ts.map +1 -0
  68. package/dist/deepbrain/recall.js +48 -0
  69. package/dist/deepbrain/recall.js.map +1 -0
  70. package/dist/deepbrain/store.d.ts +36 -0
  71. package/dist/deepbrain/store.d.ts.map +1 -0
  72. package/dist/deepbrain/store.js +342 -0
  73. package/dist/deepbrain/store.js.map +1 -0
  74. package/dist/deepbrain/workspace-files.d.ts +5 -0
  75. package/dist/deepbrain/workspace-files.d.ts.map +1 -0
  76. package/dist/deepbrain/workspace-files.js +159 -0
  77. package/dist/deepbrain/workspace-files.js.map +1 -0
  78. package/dist/evolution/index.d.ts +1 -0
  79. package/dist/evolution/index.d.ts.map +1 -0
  80. package/dist/evolution/index.js +3 -0
  81. package/dist/evolution/index.js.map +1 -0
  82. package/dist/evolution/l1-experience.d.ts +11 -0
  83. package/dist/evolution/l1-experience.d.ts.map +1 -0
  84. package/dist/evolution/l1-experience.js +185 -0
  85. package/dist/evolution/l1-experience.js.map +1 -0
  86. package/dist/evolution/l2-consolidation.d.ts +4 -0
  87. package/dist/evolution/l2-consolidation.d.ts.map +1 -0
  88. package/dist/evolution/l2-consolidation.js +106 -0
  89. package/dist/evolution/l2-consolidation.js.map +1 -0
  90. package/dist/evolution/l2-memskill.d.ts +12 -0
  91. package/dist/evolution/l2-memskill.d.ts.map +1 -0
  92. package/dist/evolution/l2-memskill.js +57 -0
  93. package/dist/evolution/l2-memskill.js.map +1 -0
  94. package/dist/evolution/l3-skill-discover.d.ts +4 -0
  95. package/dist/evolution/l3-skill-discover.d.ts.map +1 -0
  96. package/dist/evolution/l3-skill-discover.js +139 -0
  97. package/dist/evolution/l3-skill-discover.js.map +1 -0
  98. package/dist/evolution/l3-skill-verify.d.ts +12 -0
  99. package/dist/evolution/l3-skill-verify.d.ts.map +1 -0
  100. package/dist/evolution/l3-skill-verify.js +122 -0
  101. package/dist/evolution/l3-skill-verify.js.map +1 -0
  102. package/dist/evolution/l4-desensitize.d.ts +7 -0
  103. package/dist/evolution/l4-desensitize.d.ts.map +1 -0
  104. package/dist/evolution/l4-desensitize.js +30 -0
  105. package/dist/evolution/l4-desensitize.js.map +1 -0
  106. package/dist/evolution/l4-group-evolve.d.ts +8 -0
  107. package/dist/evolution/l4-group-evolve.d.ts.map +1 -0
  108. package/dist/evolution/l4-group-evolve.js +15 -0
  109. package/dist/evolution/l4-group-evolve.js.map +1 -0
  110. package/dist/evolution/maturity-scorer.d.ts +11 -0
  111. package/dist/evolution/maturity-scorer.d.ts.map +1 -0
  112. package/dist/evolution/maturity-scorer.js +21 -0
  113. package/dist/evolution/maturity-scorer.js.map +1 -0
  114. package/dist/index.d.ts +7 -1
  115. package/dist/index.d.ts.map +1 -1
  116. package/dist/index.js +33 -5
  117. package/dist/index.js.map +1 -1
  118. package/dist/providers/agentkits.d.ts +20 -0
  119. package/dist/providers/agentkits.d.ts.map +1 -0
  120. package/dist/providers/agentkits.js +173 -0
  121. package/dist/providers/agentkits.js.map +1 -0
  122. package/dist/providers/model-provider.d.ts +16 -0
  123. package/dist/providers/model-provider.d.ts.map +1 -0
  124. package/dist/providers/model-provider.js +13 -0
  125. package/dist/providers/model-provider.js.map +1 -0
  126. package/dist/providers/model-recommender.d.ts +15 -0
  127. package/dist/providers/model-recommender.d.ts.map +1 -0
  128. package/dist/providers/model-recommender.js +71 -0
  129. package/dist/providers/model-recommender.js.map +1 -0
  130. package/dist/providers/ollama.d.ts +22 -0
  131. package/dist/providers/ollama.d.ts.map +1 -0
  132. package/dist/providers/ollama.js +176 -0
  133. package/dist/providers/ollama.js.map +1 -0
  134. package/dist/providers/openai-compat.d.ts +23 -0
  135. package/dist/providers/openai-compat.d.ts.map +1 -0
  136. package/dist/providers/openai-compat.js +184 -0
  137. package/dist/providers/openai-compat.js.map +1 -0
  138. package/dist/providers/router.d.ts +11 -0
  139. package/dist/providers/router.d.ts.map +1 -0
  140. package/dist/providers/router.js +48 -0
  141. package/dist/providers/router.js.map +1 -0
  142. package/dist/scheduler/cron.d.ts +19 -0
  143. package/dist/scheduler/cron.d.ts.map +1 -0
  144. package/dist/scheduler/cron.js +64 -0
  145. package/dist/scheduler/cron.js.map +1 -0
  146. package/dist/schema/oad.d.ts +72 -72
  147. package/dist/skills/loader.d.ts +16 -0
  148. package/dist/skills/loader.d.ts.map +1 -0
  149. package/dist/skills/loader.js +114 -0
  150. package/dist/skills/loader.js.map +1 -0
  151. package/dist/skills/matcher.d.ts +18 -0
  152. package/dist/skills/matcher.d.ts.map +1 -0
  153. package/dist/skills/matcher.js +70 -0
  154. package/dist/skills/matcher.js.map +1 -0
  155. package/dist/studio/agent-pool.d.ts +17 -0
  156. package/dist/studio/agent-pool.d.ts.map +1 -0
  157. package/dist/studio/agent-pool.js +35 -0
  158. package/dist/studio/agent-pool.js.map +1 -0
  159. package/dist/studio/assistant-tools.d.ts +4 -0
  160. package/dist/studio/assistant-tools.d.ts.map +1 -0
  161. package/dist/studio/assistant-tools.js +36 -0
  162. package/dist/studio/assistant-tools.js.map +1 -0
  163. package/dist/studio/index.d.ts +1 -0
  164. package/dist/studio/index.d.ts.map +1 -0
  165. package/dist/studio/index.js +3 -0
  166. package/dist/studio/index.js.map +1 -0
  167. package/dist/studio/server.d.ts +3 -0
  168. package/dist/studio/server.d.ts.map +1 -1
  169. package/dist/studio/server.js +156 -24
  170. package/dist/studio/server.js.map +1 -1
  171. package/dist/templates/index.d.ts +1 -0
  172. package/dist/templates/index.d.ts.map +1 -0
  173. package/dist/templates/index.js +3 -0
  174. package/dist/templates/index.js.map +1 -0
  175. package/dist/templates/roles/index.d.ts +4 -0
  176. package/dist/templates/roles/index.d.ts.map +1 -0
  177. package/dist/templates/roles/index.js +46 -0
  178. package/dist/templates/roles/index.js.map +1 -0
  179. package/dist/templates/template-provider.d.ts +16 -0
  180. package/dist/templates/template-provider.d.ts.map +1 -0
  181. package/dist/templates/template-provider.js +60 -0
  182. package/dist/templates/template-provider.js.map +1 -0
  183. package/dist/tools/builtin/definitions.d.ts +7 -0
  184. package/dist/tools/builtin/definitions.d.ts.map +1 -0
  185. package/dist/tools/builtin/definitions.js +60 -0
  186. package/dist/tools/builtin/definitions.js.map +1 -0
  187. package/dist/tools/execute-code.d.ts +20 -0
  188. package/dist/tools/execute-code.d.ts.map +1 -0
  189. package/dist/tools/execute-code.js +92 -0
  190. package/dist/tools/execute-code.js.map +1 -0
  191. package/dist/tools/hooks.d.ts +47 -0
  192. package/dist/tools/hooks.d.ts.map +1 -0
  193. package/dist/tools/hooks.js +69 -0
  194. package/dist/tools/hooks.js.map +1 -0
  195. package/dist/tools/index.d.ts +9 -0
  196. package/dist/tools/index.d.ts.map +1 -0
  197. package/dist/tools/index.js +16 -0
  198. package/dist/tools/index.js.map +1 -0
  199. package/dist/tools/permission.d.ts +20 -0
  200. package/dist/tools/permission.d.ts.map +1 -0
  201. package/dist/tools/permission.js +35 -0
  202. package/dist/tools/permission.js.map +1 -0
  203. package/dist/tools/registry.d.ts +25 -0
  204. package/dist/tools/registry.d.ts.map +1 -0
  205. package/dist/tools/registry.js +42 -0
  206. package/dist/tools/registry.js.map +1 -0
  207. package/package.json +1 -1
package/README.md CHANGED
@@ -4,13 +4,13 @@
4
4
 
5
5
  **Your AI workforce, running locally. Zero cloud cost to start.**
6
6
 
7
- One computer. One command. Your own AI employees — working 24/7.
7
+ One computer. One command. Your own AI agentslearning, evolving, working 24/7.
8
8
 
9
- [![npm](https://img.shields.io/npm/v/opc-agent)](https://www.npmjs.com/package/opc-agent)
9
+ [![npm](https://img.shields.io/npm/v/opc-agent/alpha)](https://www.npmjs.com/package/opc-agent)
10
10
  [![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](LICENSE)
11
11
  [![Node](https://img.shields.io/badge/Node.js-%3E%3D18-339933?logo=node.js&logoColor=white)](https://nodejs.org/)
12
12
 
13
- [Quick Start](#-quick-start) · [Why OPC](#-why-opc) · [Studio](#-studio) · [Features](#-features) · [Architecture](#-architecture) · [CLI](#-cli-commands) · [中文](README.zh-CN.md)
13
+ [Quick Start](#-quick-start) · [Features](#-features) · [Architecture](#-architecture) · [CLI](#-cli-commands) · [中文](README.zh-CN.md)
14
14
 
15
15
  </div>
16
16
 
@@ -18,7 +18,7 @@ One computer. One command. Your own AI employees — working 24/7.
18
18
 
19
19
  ## 🚀 Quick Start
20
20
 
21
- **One-line install** (includes Node.js + auto-detects Ollama):
21
+ ### One-Line Install (recommended)
22
22
 
23
23
  ```bash
24
24
  # macOS / Linux
@@ -28,204 +28,188 @@ curl -fsSL https://raw.githubusercontent.com/Deepleaper/opc-agent/main/install.s
28
28
  irm https://raw.githubusercontent.com/Deepleaper/opc-agent/main/install.ps1 | iex
29
29
  ```
30
30
 
31
- **Or via npx** (zero install):
31
+ This automatically installs Node.js, OPC Agent, Ollama, and a recommended AI model based on your hardware.
32
+
33
+ ### Or install manually
32
34
 
33
35
  ```bash
34
- npx opc-agent@latest init
35
- cd my-agent
36
- npx opc-agent studio
36
+ npm install -g opc-agent@alpha
37
+ opc setup # Interactive setup wizard
37
38
  ```
38
39
 
39
- That's it. Open `http://localhost:4000` your AI workforce management Studio is live.
40
+ ### Get started in 30 seconds
41
+
42
+ ```bash
43
+ opc chat # Chat in terminal
44
+ opc studio # Open web UI → localhost:4000
45
+ opc run # Start everything: Agent + Telegram + Web + Studio
46
+ ```
40
47
 
41
48
  ---
42
49
 
43
- ## 💡 Why OPC
50
+ ## Features
44
51
 
45
- | Pain Point | OPC Solution |
46
- |---|---|
47
- | AI agents need expensive cloud APIs | **Ollama-first**: runs 100% locally with zero cost |
48
- | Complex setup, developer-only tools | **One command** Studio GUI, no coding needed |
49
- | Agents lose memory between sessions | **DeepBrain**: persistent 3-layer knowledge that evolves |
50
- | One agent, one trick | **202 workstation templates** across 31 industries |
51
- | No way to manage multiple agents | **Studio dashboard** create, chat, configure, monitor |
52
+ | Feature | Description |
53
+ |---------|-------------|
54
+ | 🧠 **Self-Evolving** | 4-layer evolution engine: Experience Memory Skills Group knowledge |
55
+ | 💰 **Zero Cost Start** | Runs 100% locally with Ollama. No API key needed. |
56
+ | 🎨 **Studio UI** | Web-based management at localhost:4000 models, channels, knowledge, templates |
57
+ | 📱 **Multi-Channel** | Telegram, Web, WeChat, Feishu, Discord, Slack, Email |
58
+ | 🔧 **40 Built-in Skills** | File ops, web search, code execution, image generation, and more |
59
+ | 🤖 **A2A Protocol** | Agent-to-agent communication for multi-agent workflows |
60
+ | 📦 **All-in-One** | DeepBrain (knowledge) + AgentKits (models) + Workstation (templates) |
61
+ | 🔒 **Privacy First** | Your data stays on your machine. No telemetry. |
52
62
 
53
63
  ---
54
64
 
55
- ## 🎨 Studio
56
-
57
- OPC Studio is a web-based management GUI for your entire AI workforce.
65
+ ## 🏗 Architecture
58
66
 
59
- **5 modules, one interface:**
67
+ ```
68
+ ┌──────────────────────────────────────────┐
69
+ │ OPC Agent CLI │
70
+ │ opc chat · opc studio · opc run │
71
+ ├──────────────────────────────────────────┤
72
+ │ Agent Loop │ Self-Evolution (L1-L4) │
73
+ │ Context │ L1 Experience Compile │
74
+ │ Assembly │ L2 Memory Consolidate │
75
+ │ │ L3 Skill Discovery │
76
+ │ │ L4 Group Evolution │
77
+ ├──────────────────────────────────────────┤
78
+ │ DeepBrain │ AgentKits │Workstation │
79
+ │ (Knowledge) │ (Models) │(Templates) │
80
+ │ SQLite+FTS5 │ Ollama/API │ Industry │
81
+ ├──────────────────────────────────────────┤
82
+ │ Channels │
83
+ │ Telegram │ Web │ WeChat │ Feishu │ ... │
84
+ └──────────────────────────────────────────┘
85
+ ```
60
86
 
61
- | Module | What it does |
62
- |---|---|
63
- | 🧑‍💻 **OPC Assistant** | Built-in AI helper (always on top) |
64
- | 🤖 **OPC Agent** | Create agents, chat, configure channels |
65
- | 🧩 **AgentKits** | Model config — Ollama auto-detect + cloud API keys |
66
- | 🧠 **DeepBrain** | Knowledge base — drag-drop docs, auto-categorize, 3-layer browsing |
67
- | 🖥️ **Workstation** | 202 templates across 31 industries — pick a role, deploy an agent |
87
+ ### How it works
68
88
 
69
- ```bash
70
- npx opc-agent studio #http://localhost:4000
71
- ```
89
+ 1. **You talk** → Agent receives message via any channel
90
+ 2. **Agent thinks**Context assembly + tool selection + LLM reasoning
91
+ 3. **Agent acts** → Executes tools, calls APIs, generates content
92
+ 4. **Agent learns** → Every interaction feeds the evolution engine
93
+ 5. **Agent evolves** → Knowledge distills upward: experience → memory → skills
72
94
 
73
95
  ---
74
96
 
75
- ## Features
97
+ ## 💻 CLI Commands
76
98
 
77
- ### 🧠 Knowledge Evolve Engine
78
- - **3-layer knowledge**: Industry → Job → Workstation (auto-distills upward)
79
- - **Local-first**: uses Ollama models zero cost evolution
80
- - **Memory compaction**: distills conversations into persistent knowledge
81
- - **DeepBrain integration**: drag-drop documents, auto-categorize
99
+ | Command | Description |
100
+ |---------|-------------|
101
+ | `opc setup` | Interactive setup wizard |
102
+ | `opc init [name]` | Create new agent project |
103
+ | `opc chat` | Terminal chat with agent |
104
+ | `opc studio` | Open Studio web UI (port 4000) |
105
+ | `opc run` | Start all services (Agent + channels + Studio) |
106
+ | `opc brain stats` | Show knowledge base statistics |
107
+ | `opc brain recall <query>` | Semantic search in knowledge |
108
+ | `opc brain learn <file>` | Import document into knowledge |
109
+ | `opc doctor` | Diagnose installation issues |
82
110
 
83
- ### 💬 Multi-Channel
84
- Connect your agents to users wherever they are:
85
-
86
- Telegram · Slack · Discord · WeChat · Feishu · Email · WhatsApp · Web Chat · Voice · IRC · Matrix · SMS · Line · Nostr · MS Teams · Google Chat · DingTalk · QQ · Twitch · Mattermost
111
+ ---
87
112
 
88
- ### 🔧 53 Built-in Tools
113
+ ## 🔧 Configuration
89
114
 
90
- | Category | Tools |
91
- |---|---|
92
- | **Core** (8) | shell, file I/O, web fetch, web search, browser, vision, datetime, calculator |
93
- | **Developer** (12) | git, GitHub, npm, code exec, JSON transform, regex, text analysis, ... |
94
- | **Productivity** (8) | calendar, email, Jira, Notion, Trello, Slack, summarizer, translator |
95
- | **Integration** (13) | database, PDF reader, CSV analyzer, webhook, vector search, image gen, ... |
96
- | **Knowledge** (7) | memory search, memory store, brain query, brain learn, brain evolve, ... |
97
- | **Media** (5) | image generator, document processor, web scraper, Home Assistant, ... |
115
+ After `opc setup`, all configuration lives in Studio UI (localhost:4000):
98
116
 
99
- ### 🤝 Protocol Support
100
- - **A2A** (Agent-to-Agent): Google-standard inter-agent communication + HTTP transport
101
- - **MCP** (Model Context Protocol): Anthropic-standard tool integration
102
- - **AG-UI**: Frontend streaming protocol
117
+ - **Models** Switch between Ollama models, add cloud API keys
118
+ - **Channels** Configure Telegram bot, WeChat, Feishu, etc.
119
+ - **Knowledge** Drag & drop documents, manage DeepBrain
120
+ - **Templates** Browse industry/job/workstation templates
121
+ - **Agent Settings** — Edit personality, skills, model assignments
103
122
 
104
- ### 🛡️ Enterprise-Ready
105
- - Sandbox execution, API key encryption, rate limiting
106
- - Content filtering, guardrails, HITL (human-in-the-loop)
107
- - Priority queue with fast mode
108
- - Gateway registry for multi-agent networking
123
+ Config files: `~/.opc/config.json` (global), `oad.yaml` (per agent)
109
124
 
110
125
  ---
111
126
 
112
- ## 🏗️ Architecture
113
-
114
- ```
115
- ┌─────────────────────────────────────┐
116
- │ OPC Studio (GUI) │ ← Management dashboard
117
- ├─────────────────────────────────────┤
118
- │ OPC Agent (CLI) │ ← Runtime + TUI chat
119
- ├──────────┬──────────┬───────────────┤
120
- │ AgentKits│ DeepBrain│ Workstation │
121
- │ (Models) │(Knowledge)│ (Templates) │
122
- └──────────┴──────────┴───────────────┘
123
- ↕ ↕ ↕
124
- Ollama SQLite/ 202 roles
125
- Cloud Memory 31 industries
126
- APIs Evolve
127
- ```
127
+ ## 📖 Model Support
128
128
 
129
- ---
129
+ ### Local (Ollama) — Zero Cost
130
+ Auto-detected and recommended based on your RAM:
130
131
 
131
- ## 🖥️ CLI Commands
132
+ | RAM | Recommended Model | Size |
133
+ |-----|------------------|------|
134
+ | ≤3 GB | qwen2.5:0.5b | 400MB |
135
+ | ≤7 GB | qwen2.5:1.5b | 1.0GB |
136
+ | ≤15 GB | qwen2.5:7b | 4.7GB |
137
+ | ≤31 GB | qwen2.5:14b | 9.0GB |
138
+ | 32+ GB | qwen2.5:32b | 19GB |
132
139
 
133
- ```bash
134
- opc init # Create new agent project
135
- opc run # Start agent runtime
136
- opc studio # Launch Studio GUI
137
- opc chat # TUI terminal chat
138
- opc doctor # Health check (13 checks)
139
- opc memory-search <query> # Search agent memory
140
- opc skills list # List available skills
141
- opc deploy # Deploy to cloud
142
- opc publish # Publish to OPC Hub
143
- ```
140
+ ### Cloud (via AgentKits)
141
+ Configure in Studio Models: OpenAI, DeepSeek, Anthropic, Qwen, Google Gemini
144
142
 
145
143
  ---
146
144
 
147
- ## ⚙️ Configuration
148
-
149
- Agents are defined in `oad.yaml`:
150
-
151
- ```yaml
152
- name: customer-support
153
- description: 24/7 AI customer service agent
154
- model: auto # auto-selects best available model
155
- language: zh
156
- channels:
157
- telegram:
158
- token: ${TELEGRAM_BOT_TOKEN}
159
- web:
160
- port: 3000
161
- tools:
162
- - web-search
163
- - memory-search
164
- skills:
165
- - customer-service
166
- - product-knowledge
167
- ```
145
+ ## 🌐 Multi-Channel
146
+
147
+ | Channel | Setup |
148
+ |---------|-------|
149
+ | 💬 Web Chat | Built-in, localhost:3000 |
150
+ | 📱 Telegram | Add bot token in Studio |
151
+ | 💬 WeChat | Add app credentials in Studio |
152
+ | 🐦 Feishu | Add app credentials in Studio |
153
+ | 🎮 Discord | Add bot token in Studio |
154
+ | 💼 Slack | Add bot token in Studio |
155
+ | 📧 Email | Add SMTP config in Studio |
168
156
 
169
157
  ---
170
158
 
171
- ## 🏥 Doctor
159
+ ## 🧬 Self-Evolution
172
160
 
173
- 13 automated checks for agent health:
161
+ OPC Agent gets smarter over time through 4 layers of evolution:
174
162
 
175
- ```bash
176
- opc doctor
177
- ```
163
+ - **L1 — Experience Compilation**: Raw interactions → structured insights (local Ollama)
164
+ - **L2 — Memory Consolidation**: Insights → refined knowledge (cloud AgentKits)
165
+ - **L3 — Skill Discovery**: Patterns → auto-generated skills (cloud AgentKits)
166
+ - **L4 — Group Evolution**: Individual knowledge → shared wisdom (local Ollama)
178
167
 
179
- Checks: config validity, model connectivity, channel auth, memory persistence, tool availability, Ollama status, disk space, Node.js version, and more.
168
+ All L1/L4 processing runs locally at zero cost. L2/L3 uses cloud models for higher quality.
180
169
 
181
170
  ---
182
171
 
183
- ## 📊 Comparison
184
-
185
- | Feature | OPC Agent | OpenClaw | Hermes Agent |
186
- |---------|-----------|----------|--------------|
187
- | GUI Management | ✅ Studio | ❌ CLI only | ❌ CLI only |
188
- | Local-first (Ollama) | ✅ Auto-detect | ❌ Cloud-only | ⚠️ Manual |
189
- | Smart Model Recommend | ✅ Hardware-based | ❌ | ❌ |
190
- | Knowledge Evolution | ✅ 3-layer + distill | ❌ | ⚠️ Manual skills |
191
- | Workstation Templates | ✅ 202 / 31 industries | ❌ | ❌ |
192
- | Built-in Tools | ✅ 53 | ⚠️ ~20 | ⚠️ ~10 |
193
- | Channels | ✅ 20 | ⚠️ 5 | ⚠️ 3 |
194
- | A2A + MCP + AG-UI | ✅ All three | ⚠️ MCP only | ❌ |
195
- | One-line Install | ✅ | ✅ | ❌ |
196
- | Doctor Health Check | ✅ 13 checks | ❌ | ❌ |
197
- | Memory Compaction | ✅ Auto-distill | ❌ | ❌ |
172
+ ## 📦 Project Structure
173
+
174
+ ```
175
+ ~/.opc/ # Global config
176
+ config.json # Settings
177
+ agents/ # Agent data
178
+
179
+ my-agent/ # Agent workspace
180
+ EGO.md # Agent personality
181
+ DEEPBRAIN.md # Knowledge summary
182
+ oad.yaml # Agent definition
183
+ .opc/
184
+ brain.db # Knowledge database
185
+ skills/ # Auto-generated skills
186
+ evolution/ # Evolution logs
187
+ ```
198
188
 
199
189
  ---
200
190
 
201
191
  ## 🤝 Contributing
202
192
 
203
- See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
204
-
205
193
  ```bash
206
194
  git clone https://github.com/Deepleaper/opc-agent.git
207
195
  cd opc-agent
208
196
  npm install
209
- npm run build
210
- npm run dev
197
+ npx tsc # Build
198
+ npx vitest run # Test (1100+ tests)
211
199
  ```
212
200
 
213
201
  ---
214
202
 
215
203
  ## 📄 License
216
204
 
217
- Apache-2.0 see [LICENSE](LICENSE) for details.
218
-
219
- **Open-source components:**
220
- - `opc-agent` / `agentkits`: Apache-2.0
221
- - `deepbrain` / `workstation`: LGPL-3.0
205
+ Apache-2.0 © [Deepleaper](https://github.com/Deepleaper)
222
206
 
223
207
  ---
224
208
 
225
209
  <div align="center">
226
210
 
227
- **Built by [Deepleaper](https://www.deepleaper.com)** · Powering the AI workforce revolution
211
+ **Built by [Deepleaper](https://www.deepleaper.com)** Making AI work for everyone.
228
212
 
229
- ⭐ Star us if OPC helps you build better AI agents!
213
+ ⭐ Star this repo if OPC Agent helps you!
230
214
 
231
215
  </div>
package/README.zh-CN.md CHANGED
@@ -2,15 +2,15 @@
2
2
 
3
3
  # ⚡ OPC Agent — 瞬知 Studio
4
4
 
5
- **你的 AI 劳动力,本地运行。零成本启动。**
5
+ **你的 AI 劳动力,本地运行,零成本启动。**
6
6
 
7
- 一台电脑,一行命令,你的 AI 员工 7×24 小时上班。
7
+ 一台电脑,一行命令,你自己的 AI 员工 7×24 学习、进化、工作。
8
8
 
9
- [![npm](https://img.shields.io/npm/v/opc-agent)](https://www.npmjs.com/package/opc-agent)
9
+ [![npm](https://img.shields.io/npm/v/opc-agent/alpha)](https://www.npmjs.com/package/opc-agent)
10
10
  [![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](LICENSE)
11
11
  [![Node](https://img.shields.io/badge/Node.js-%3E%3D18-339933?logo=node.js&logoColor=white)](https://nodejs.org/)
12
12
 
13
- [快速开始](#-快速开始) · [为什么选 OPC](#-为什么选-opc) · [Studio](#-studio) · [功能](#-功能) · [架构](#-架构) · [CLI](#-命令行) · [English](README.md)
13
+ [快速开始](#-快速开始) · [功能特性](#-功能特性) · [架构](#-架构) · [命令](#-命令) · [English](README.md)
14
14
 
15
15
  </div>
16
16
 
@@ -18,7 +18,7 @@
18
18
 
19
19
  ## 🚀 快速开始
20
20
 
21
- **一行安装**(自动检测 Node.js + Ollama):
21
+ ### 一行安装(推荐)
22
22
 
23
23
  ```bash
24
24
  # macOS / Linux
@@ -28,203 +28,118 @@ curl -fsSL https://raw.githubusercontent.com/Deepleaper/opc-agent/main/install.s
28
28
  irm https://raw.githubusercontent.com/Deepleaper/opc-agent/main/install.ps1 | iex
29
29
  ```
30
30
 
31
- **或者 npx 免安装**:
31
+ 自动安装 Node.js、OPC Agent、Ollama,并根据你的硬件推荐 AI 模型。
32
+
33
+ ### 手动安装
32
34
 
33
35
  ```bash
34
- npx opc-agent@latest init
35
- cd my-agent
36
- npx opc-agent studio
36
+ npm install -g opc-agent@alpha
37
+ opc setup # 交互式配置向导
37
38
  ```
38
39
 
39
- 打开 `http://localhost:4000`,你的 AI 劳动力管理 Studio 就绪了。
40
-
41
- ---
42
-
43
- ## 💡 为什么选 OPC
44
-
45
- | 痛点 | OPC 解决方案 |
46
- |------|-------------|
47
- | AI Agent 需要昂贵的云端 API | **Ollama 优先**:100% 本地运行,零成本 |
48
- | 安装复杂,只有开发者能用 | **一行命令** → Studio 图形界面,不需要写代码 |
49
- | Agent 重启后丢失记忆 | **DeepBrain**:三层持久化知识,自动进化 |
50
- | 一个 Agent 只能做一件事 | **202 个岗位模板**,覆盖 31 个行业 |
51
- | 没法管理多个 Agent | **Studio 仪表盘** — 创建、聊天、配置、监控 |
52
-
53
- ---
54
-
55
- ## 🎨 Studio
56
-
57
- OPC Studio 是你管理整个 AI 劳动力的 Web 界面。
58
-
59
- **5 大模块,一个界面:**
60
-
61
- | 模块 | 功能 |
62
- |------|------|
63
- | 🧑‍💻 **OPC 助手** | 内置 AI 助理(始终置顶) |
64
- | 🤖 **OPC Agent** | 创建 Agent、聊天、配置渠道 |
65
- | 🧩 **AgentKits** | 模型配置 — Ollama 自动检测 + 云端 API Key |
66
- | 🧠 **DeepBrain** | 知识库 — 拖拽上传文档,自动分类,三层浏览 |
67
- | 🖥️ **Workstation** | 202 个岗位模板,31 个行业 — 选模板,部署 Agent |
40
+ ### 30 秒上手
68
41
 
69
42
  ```bash
70
- npx opc-agent studio # → http://localhost:4000
43
+ opc chat # 终端对话
44
+ opc studio # 打开网页管理 → localhost:4000
45
+ opc run # 全部启动:Agent + Telegram + Web + Studio
71
46
  ```
72
47
 
73
48
  ---
74
49
 
75
- ## ✨ 功能
76
-
77
- ### 🧠 知识进化引擎
78
- - **三层知识体系**:行业 → 岗位 → 工位(自动向上蒸馏)
79
- - **本地优先**:使用 Ollama 模型,零成本进化
80
- - **记忆压缩**:对话自动蒸馏为持久化知识
81
- - **DeepBrain**:拖拽文档,自动分类到三层
82
-
83
- ### 💬 20 个渠道
84
- 把你的 Agent 连接到用户所在的任何地方:
85
-
86
- Telegram · Slack · Discord · 微信 · 飞书 · 邮件 · WhatsApp · Web · 语音 · IRC · Matrix · 短信 · Line · Nostr · Teams · Google Chat · 钉钉 · QQ · Twitch · Mattermost
87
-
88
- ### 🔧 53 个内置工具
50
+ ## ✨ 功能特性
89
51
 
90
- | 分类 | 工具 |
52
+ | 特性 | 说明 |
91
53
  |------|------|
92
- | **核心** (8) | Shell、文件 I/O、网页抓取、搜索、浏览器、视觉、日期时间、计算器 |
93
- | **开发** (12) | Git、GitHub、npm、代码执行、JSON、正则、文本分析… |
94
- | **办公** (8) | 日历、邮件、Jira、Notion、Trello、Slack、摘要、翻译 |
95
- | **集成** (13) | 数据库、PDFCSVWebhook、向量搜索、图片生成… |
96
- | **知识** (7) | 记忆搜索、记忆存储、知识查询、知识学习、知识进化… |
97
- | **媒体** (5) | 图片生成、文档处理、网页爬取、Home Assistant… |
98
-
99
- ### 🤝 协议支持
100
- - **A2A**(Agent-to-Agent):Google 标准 + HTTP 传输
101
- - **MCP**(Model Context Protocol):Anthropic 标准工具集成
102
- - **AG-UI**:前端流式协议
103
-
104
- ### 🛡️ 企业级特性
105
- - 沙箱执行、API Key 加密、速率限制
106
- - 内容过滤、护栏、人机协同(HITL)
107
- - 优先级队列 + 快速模式
108
- - Gateway 注册中心(多 Agent 网络)
54
+ | 🧠 **自进化** | 四层进化引擎:经验 记忆 → 技能 → 群体智慧 |
55
+ | 💰 **零成本** | 本地 Ollama 运行,无需 API Key |
56
+ | 🎨 **Studio 管理界面** | 网页端管理:模型、渠道、知识库、模板 |
57
+ | 📱 **多渠道** | TelegramWeb、微信、飞书、DiscordSlack、Email |
58
+ | 🔧 **40 个内置技能** | 文件操作、网页搜索、代码执行、图片生成等 |
59
+ | 🤖 **A2A 协议** | Agent 间通信,多 Agent 协作 |
60
+ | 📦 **一体化** | DeepBrain(知识)+ AgentKits(模型)+ Workstation(模板)|
61
+ | 🔒 **隐私优先** | 数据留在本地,无遥测 |
109
62
 
110
63
  ---
111
64
 
112
- ## 🏗️ 架构
65
+ ## 🏗 架构
113
66
 
114
67
  ```
115
- ┌─────────────────────────────────────┐
116
- OPC Studio(管理界面)
117
- ├─────────────────────────────────────┤
118
- │ OPC Agent(CLI 运行时) │
119
- ├──────────┬──────────┬───────────────┤
120
- AgentKitsDeepBrain Workstation │
121
- (模型) (知识) (模板) │
122
- └──────────┴──────────┴───────────────┘
123
- ↕ ↕ ↕
124
- Ollama SQLite/ 202 岗位
125
- 云端 API 记忆进化 31 行业
68
+ ┌──────────────────────────────────────────┐
69
+ OPC Agent CLI
70
+ │ opc chat · opc studio · opc run │
71
+ ├──────────────────────────────────────────┤
72
+ │ Agent Loop │ 自进化引擎 (L1-L4) │
73
+ 上下文组装 L1 经验编译
74
+ L2 记忆巩固
75
+ │ │ L3 技能发现 │
76
+ │ │ L4 群体进化 │
77
+ ├──────────────────────────────────────────┤
78
+ │ DeepBrain │ AgentKits │ Workstation │
79
+ │ (知识库) │ (模型路由) │ (模板库) │
80
+ ├──────────────────────────────────────────┤
81
+ │ 渠道 │
82
+ │ Telegram │ Web │ 微信 │ 飞书 │ ... │
83
+ └──────────────────────────────────────────┘
126
84
  ```
127
85
 
128
86
  ---
129
87
 
130
- ## 🖥️ 命令行
88
+ ## 💻 命令
131
89
 
132
- ```bash
133
- opc init # 创建 Agent 项目
134
- opc run # 启动 Agent
135
- opc studio # 打开 Studio 管理界面
136
- opc chat # 终端聊天(TUI)
137
- opc doctor # 健康检查(13 项)
138
- opc memory-search <query> # 搜索 Agent 记忆
139
- opc skills list # 查看可用 Skill
140
- opc deploy # 部署到云端
141
- opc publish # 发布到 OPC Hub
142
- ```
90
+ | 命令 | 说明 |
91
+ |------|------|
92
+ | `opc setup` | 交互式配置向导 |
93
+ | `opc init [name]` | 创建 Agent 项目 |
94
+ | `opc chat` | 终端对话 |
95
+ | `opc studio` | 打开 Studio 管理界面 |
96
+ | `opc run` | 启动所有服务 |
97
+ | `opc brain stats` | 知识库统计 |
98
+ | `opc brain recall <query>` | 语义搜索 |
99
+ | `opc brain learn <file>` | 导入文档 |
100
+ | `opc doctor` | 诊断安装问题 |
143
101
 
144
102
  ---
145
103
 
146
- ## ⚙️ 配置
147
-
148
- Agent 通过 `oad.yaml` 定义:
149
-
150
- ```yaml
151
- name: customer-support
152
- description: 24小时 AI 客服
153
- model: auto # 自动选择最佳模型
154
- language: zh
155
- channels:
156
- telegram:
157
- token: ${TELEGRAM_BOT_TOKEN}
158
- web:
159
- port: 3000
160
- tools:
161
- - web-search
162
- - memory-search
163
- skills:
164
- - customer-service
165
- - product-knowledge
166
- ```
167
-
168
- ---
104
+ ## 📖 模型支持
169
105
 
170
- ## 🏥 健康检查
106
+ ### 本地(Ollama)— 零成本
107
+ 根据 RAM 自动推荐:
171
108
 
172
- 13 项自动诊断:
109
+ | 内存 | 推荐模型 | 大小 |
110
+ |------|---------|------|
111
+ | ≤3 GB | qwen2.5:0.5b | 400MB |
112
+ | ≤7 GB | qwen2.5:1.5b | 1.0GB |
113
+ | ≤15 GB | qwen2.5:7b | 4.7GB |
114
+ | ≤31 GB | qwen2.5:14b | 9.0GB |
115
+ | 32+ GB | qwen2.5:32b | 19GB |
173
116
 
174
- ```bash
175
- opc doctor
176
- ```
177
-
178
- 检查项:配置、模型连接、渠道认证、记忆持久化、工具可用性、Ollama 状态、磁盘空间、Node.js 版本等。
117
+ ### 云端(通过 AgentKits)
118
+ Studio → 模型配置中添加:OpenAI、DeepSeek、Anthropic、通义千问、Gemini
179
119
 
180
120
  ---
181
121
 
182
- ## 📊 竞品对比
183
-
184
- | 特性 | OPC Agent | OpenClaw | Hermes Agent |
185
- |------|-----------|----------|--------------|
186
- | 图形管理界面 | ✅ Studio | ❌ 仅 CLI | ❌ 仅 CLI |
187
- | 本地优先 (Ollama) | ✅ 自动检测 | ❌ 仅云端 | ⚠️ 手动 |
188
- | 智能模型推荐 | ✅ 基于硬件 | ❌ | ❌ |
189
- | 知识进化 | ✅ 三层 + 蒸馏 | ❌ | ⚠️ 手动 |
190
- | 岗位模板 | ✅ 202 / 31 行业 | ❌ | ❌ |
191
- | 内置工具 | ✅ 53 个 | ⚠️ ~20 | ⚠️ ~10 |
192
- | 渠道 | ✅ 20 个 | ⚠️ 5 | ⚠️ 3 |
193
- | A2A + MCP + AG-UI | ✅ 全部 | ⚠️ 仅 MCP | ❌ |
194
- | 一行安装 | ✅ | ✅ | ❌ |
195
- | 健康检查 | ✅ 13 项 | ❌ | ❌ |
196
- | 记忆压缩 | ✅ 自动蒸馏 | ❌ | ❌ |
197
-
198
- ---
122
+ ## 🧬 自进化
199
123
 
200
- ## 🤝 贡献
124
+ OPC Agent 越用越聪明:
201
125
 
202
- 查看 [CONTRIBUTING.md](CONTRIBUTING.md) 了解贡献指南。
203
-
204
- ```bash
205
- git clone https://github.com/Deepleaper/opc-agent.git
206
- cd opc-agent
207
- npm install
208
- npm run build
209
- npm run dev
210
- ```
126
+ - **L1 经验编译**:原始对话 → 结构化洞察(本地 Ollama,零成本)
127
+ - **L2 记忆巩固**:洞察 → 精炼知识(云端 AgentKits)
128
+ - **L3 技能发现**:模式 → 自动生成技能(云端 AgentKits)
129
+ - **L4 群体进化**:个体知识 → 共享智慧(本地 Ollama,零成本)
211
130
 
212
131
  ---
213
132
 
214
- ## 📄 许可证
215
-
216
- Apache-2.0 — 详见 [LICENSE](LICENSE)。
133
+ ## 📄 License
217
134
 
218
- **开源组件许可:**
219
- - `opc-agent` / `agentkits`:Apache-2.0
220
- - `deepbrain` / `workstation`:LGPL-3.0
135
+ Apache-2.0 © [Deepleaper](https://github.com/Deepleaper)
221
136
 
222
137
  ---
223
138
 
224
139
  <div align="center">
225
140
 
226
- **由 [跃盟科技 Deepleaper](https://www.deepleaper.com) 构建** · 驱动 AI 劳动力革命
141
+ **由 [跃盟科技](https://www.deepleaper.com) 构建** AI 为每个人工作。
227
142
 
228
- 如果 OPC 对你有帮助,请给我们一颗星!
143
+ 觉得有用?给个 Star!
229
144
 
230
145
  </div>