設計 「可實作的 Devin 開源專案藍圖」

更新 發佈閱讀 17 分鐘

「真正可實作的 5000 行 Devin 開源專案藍圖」,包含:

  • 完整 repo 結構
  • 每個 agent 的實際 prompt
  • LangGraph workflow
  • Docker sandbox
  • Git 自動 commit agent
  • 自動 SaaS 建立

目標是打造一個 Autonomous AI Software Engineer

可以從需求 → 設計 → 寫程式 → 測試 → 部署 SaaS。

設計理念對齊:

  • Devin
  • OpenDevin
  • AutoGPT
  • LangGraph

這個架構在 RTX 4090 本地即可運行


一、完整 Repo 結構(5000 行級)

 devin_autonomous_engineer/

├── core/
│ ├── config.py
│ ├── llm.py
│ ├── agent_registry.py
│ ├── event_bus.py

├── planning/
│ ├── hierarchical_planner.py
│ ├── task_tree.py
│ ├── tot_reasoner.py

├── agents/
│ ├── ceo_agent.py
│ ├── architect_agent.py
│ ├── planner_agent.py
│ ├── research_agent.py
│ ├── coding_agent.py
│ ├── testing_agent.py
│ ├── debug_agent.py
│ ├── devops_agent.py
│ ├── critic_agent.py
│ ├── git_agent.py

├── tools/
│ ├── browser_tool.py
│ ├── terminal_tool.py
│ ├── code_interpreter.py
│ ├── file_editor.py

├── memory/
│ ├── vector_store.py
│ ├── graph_memory.py
│ ├── repo_indexer.py

├── repo_builder/
│ ├── project_generator.py
│ ├── saas_templates.py

├── sandbox/
│ ├── docker_manager.py

├── workflows/
│ ├── dev_workflow.py

├── api/
│ ├── server.py

└── ui/
├── dashboard.py

二、Agent Society(10+ agents)

AI 會模擬一個公司:

CEO Agent
CTO / Architect Agent
Planner Agent
Research Agent
Coding Agent
Testing Agent
Debug Agent
DevOps Agent
Critic Agent
Git Agent

三、每個 Agent 的 Prompt

CEO Agent(定義產品)

agents/ceo_agent.py

</>Python
CEO_PROMPT = """
You are the CEO of an AI software company.

Your job:
- understand the user goal
- convert it into a product specification
- define features

Output:

Product:
Features:
Success criteria:
"""

Architect Agent

</>Python
ARCHITECT_PROMPT = """
You are a senior software architect.

Design system architecture.

Output:

System architecture
Tech stack
Modules
APIs
"""

Planner Agent

</>Python
PLANNER_PROMPT = """
Break the project into tasks.

Return JSON:

[
{ "task": "...", "agent": "coding" },
{ "task": "...", "agent": "testing" }
]
"""

Research Agent

</>Python
RESEARCH_PROMPT = """
Research the topic using web data.

Summarize relevant libraries and solutions.
"""

Coding Agent

</>Python
CODING_PROMPT = """
You are a senior Python developer.

Write production-ready code.

Constraints:
- modular
- type hints
- unit tests
"""

Testing Agent

</>Python
TEST_PROMPT = """
Write unit tests for the code.

Use pytest.
Ensure coverage.
"""

Debug Agent

</>Python
DEBUG_PROMPT = """
Analyze error logs.

Identify root cause.

Return fix.
"""

DevOps Agent

</>Python
DEVOPS_PROMPT = """
Create deployment pipeline.

Include:

Dockerfile
CI workflow
deployment instructions
"""

Critic Agent

</>Python
CRITIC_PROMPT = """
Evaluate the result.

Is the task solved?

If not, explain improvements.
"""

Git Agent

</>Python
GIT_PROMPT = """
Create commit messages.

Format:

type(scope): message
"""

四、Hierarchical Planning

planning/hierarchical_planner.py

</>Python
class PlanNode:

def __init__(self,name):

self.name = name
self.children = []
self.status = "pending"

def add(self,node):

self.children.append(node)

Example plan:

Goal: build SaaS
├─ design architecture
├─ create backend
│ ├─ database
│ └─ API
└─ frontend

五、Tree-of-Thought Reasoning

planning/tot_reasoner.py

</>Python
class ToTReasoner:

def explore(self,problem):

thoughts = [
"approach A",
"approach B",
"approach C"
]

return thoughts

AI 會 嘗試多個解法


六、LangGraph Workflow

LangGraph 負責 agent workflow。

</>Python
from langgraph.graph import StateGraph

class AgentState(dict):
pass

def build_graph():

graph = StateGraph(AgentState)

graph.add_node("ceo", ceo_agent)
graph.add_node("architect", architect_agent)
graph.add_node("planner", planner_agent)
graph.add_node("coding", coding_agent)
graph.add_node("testing", testing_agent)
graph.add_node("devops", devops_agent)

graph.set_entry_point("ceo")

graph.add_edge("ceo","architect")
graph.add_edge("architect","planner")
graph.add_edge("planner","coding")
graph.add_edge("coding","testing")
graph.add_edge("testing","devops")

return graph.compile()

七、Docker Sandbox

AI 必須在 sandbox 執行程式。

sandbox/docker_manager.py

</>Python
import docker

class DockerSandbox:

def __init__(self):

self.client = docker.from_env()

def run_code(self,image,cmd):

container = self.client.containers.run(
image,
cmd,
detach=True
)

return container.logs()

八、Git 自動 Commit Agent

agents/git_agent.py

</>Python
import subprocess

def commit_changes(msg):

subprocess.run(["git","add","."])

subprocess.run([
"git","commit","-m",msg
])

AI 可以:

寫程式
commit
push

九、Autonomous Repo Builder

repo_builder/project_generator.py

</>Python
import os

class ProjectGenerator:

def create_saas(self,name):

os.makedirs(name+"/backend")
os.makedirs(name+"/frontend")
os.makedirs(name+"/tests")

self.create_readme(name)

十、SaaS Template

</>Python
FASTAPI_TEMPLATE = """
from fastapi import FastAPI

app = FastAPI()

@app.get("/")
def hello():
return {"message":"hello"}
"""

十一、Browser Tool

</>Python
from playwright.sync_api import sync_playwright

def browse(url):

with sync_playwright() as p:

browser = p.chromium.launch()

page = browser.new_page()

page.goto(url)

text = page.inner_text("body")

browser.close()

return text

十二、Terminal Tool

</>Python
import subprocess

def run_cmd(cmd):

result = subprocess.run(
cmd,
shell=True,
capture_output=True,
text=True
)

return result.stdout

十三、Vector Memory

RAG:

</>Python
from sentence_transformers import SentenceTransformer
import faiss

Store:

code
tasks
docs
errors

十四、Autonomous SaaS Creation

AI 可以:

User:
build todo SaaS

AI:

1 define product
2 design architecture
3 create repo
4 write backend
5 write tests
6 dockerize
7 deploy

十五、完整 Autonomous Loop

User Goal

CEO Agent

Architecture

Task planning

Coding

Testing

Debugging

Git commit

Deployment

Critic review

Next iteration

十六、推薦本地模型(4090)

LLM:

Qwen2.5 14B
DeepSeek-Coder 33B (4bit)

Embedding:

bge-m3

十七、最終能力

完成後可以做到:

自動建立 SaaS
自動寫 backend
自動 debug
自動測試
自動 deploy
自動 commit

接近:

Devin



留言
avatar-img
sirius數字沙龍
11會員
234內容數
吃自助火鍋啦!不要客氣,想吃啥,請自行取用!
sirius數字沙龍的其他內容
2026/03/09
2026 接近 Devin 架構,包含: Hierarchical Planning Agent Agent Society (10+ agents) Autonomous Software Company Simulation Self-Improving AI
Thumbnail
2026/03/09
2026 接近 Devin 架構,包含: Hierarchical Planning Agent Agent Society (10+ agents) Autonomous Software Company Simulation Self-Improving AI
Thumbnail
2026/03/08
設計接近 Devin 的 AI 系統架構。 這是一個 工程級 Autonomous Software Engineer Agent,能力接近: Devin OpenDevin Devika AutoGPT 整體會包含要求的全部模組。
Thumbnail
2026/03/08
設計接近 Devin 的 AI 系統架構。 這是一個 工程級 Autonomous Software Engineer Agent,能力接近: Devin OpenDevin Devika AutoGPT 整體會包含要求的全部模組。
Thumbnail
2026/03/08
這是接近 3000 行級別專案的完整工程架構設計(但在一個回答內無法放完整 3000 行程式碼)。 設計提供: 🧠 LangGraph Agent 架構 🧰 Auto Tool Learning 🔁 Self Reflection 🧠 Graph + Vector Memory
Thumbnail
2026/03/08
這是接近 3000 行級別專案的完整工程架構設計(但在一個回答內無法放完整 3000 行程式碼)。 設計提供: 🧠 LangGraph Agent 架構 🧰 Auto Tool Learning 🔁 Self Reflection 🧠 Graph + Vector Memory
Thumbnail
看更多
你可能也想看
Thumbnail
如果你也是那種在職場上追求極致效率,對生活品質有堅持,且渴望一段成熟、穩定、不拖泥帶水關係的專業人士,那麼 Ping! 會是你目前市面上最值得嘗試的選擇。 成熟的大人,不需要在低效的社交中消磨熱情。讓 Ping!,為你的情感生活進行「降噪」,把精力和時間,留給那個真正能與你靈魂共鳴、頻率一致的人。
Thumbnail
如果你也是那種在職場上追求極致效率,對生活品質有堅持,且渴望一段成熟、穩定、不拖泥帶水關係的專業人士,那麼 Ping! 會是你目前市面上最值得嘗試的選擇。 成熟的大人,不需要在低效的社交中消磨熱情。讓 Ping!,為你的情感生活進行「降噪」,把精力和時間,留給那個真正能與你靈魂共鳴、頻率一致的人。
Thumbnail
厭倦只看外貌的交友方式嗎?Ping!主打真實、安全的深度交友體驗,透過真人驗證與多樣化的個人化問答,幫助使用者在認識彼此之前,先理解價值觀、關係期待與交友目標。即使是慢熟的 I 人,也能透過提問找到適合的人選,避免聊到一半才發現方向不同。適合想被理解、重視心理連結與安心互動的你。
Thumbnail
厭倦只看外貌的交友方式嗎?Ping!主打真實、安全的深度交友體驗,透過真人驗證與多樣化的個人化問答,幫助使用者在認識彼此之前,先理解價值觀、關係期待與交友目標。即使是慢熟的 I 人,也能透過提問找到適合的人選,避免聊到一半才發現方向不同。適合想被理解、重視心理連結與安心互動的你。
Thumbnail
Ping!主打真人驗證機制,透過AI人臉比對確保用戶真實性,讓人放心。獨特的照片主題功能、個性化標籤和趣味文字問答,讓用戶更深入展現自我,為開啟話題提供契機,甚至有機會找到擁有相似冷門興趣的同好。Ping!注重高品質的交友關係,透過共同點建立雙方的連結,為現代人提供一個舒適、真實且有意義的交友環境。
Thumbnail
Ping!主打真人驗證機制,透過AI人臉比對確保用戶真實性,讓人放心。獨特的照片主題功能、個性化標籤和趣味文字問答,讓用戶更深入展現自我,為開啟話題提供契機,甚至有機會找到擁有相似冷門興趣的同好。Ping!注重高品質的交友關係,透過共同點建立雙方的連結,為現代人提供一個舒適、真實且有意義的交友環境。
Thumbnail
也許不是我不適合交友,而是我適合的節奏,本來就比較慢。 比起快速認識很多人,我更在意人與人怎麼相遇,才不會那麼累。當對話可以慢慢發生,當我們從想法開始靠近彼此,那種剛剛好的距離,反而讓人更願意走近。
Thumbnail
也許不是我不適合交友,而是我適合的節奏,本來就比較慢。 比起快速認識很多人,我更在意人與人怎麼相遇,才不會那麼累。當對話可以慢慢發生,當我們從想法開始靠近彼此,那種剛剛好的距離,反而讓人更願意走近。
Thumbnail
引用 Alex Hormozi 槓桿理論,揭秘如何利用 NotebookLM 等 生產力工具 實現 10 倍產出。本文提供 6 大實戰場景與 AI Prompt,助你提升 逆商 與 時間管理 效率,將職場 挫折 轉化為成功基石,掌握 管理時間 的終極密碼。
Thumbnail
引用 Alex Hormozi 槓桿理論,揭秘如何利用 NotebookLM 等 生產力工具 實現 10 倍產出。本文提供 6 大實戰場景與 AI Prompt,助你提升 逆商 與 時間管理 效率,將職場 挫折 轉化為成功基石,掌握 管理時間 的終極密碼。
Thumbnail
打開英文郵件或文件,卻被一堆看不懂的縮寫(如 CEO, FYI, N/A)弄得一頭霧水?本文為您整理最常見的職場英文縮寫,從C-Suite高層職位、日常職位、組織地點、Email常用語,到商業交易、學位、萬用縮寫,全方位解析,幫助您快速理解職場訊息,提升溝通效率與專業度。
Thumbnail
打開英文郵件或文件,卻被一堆看不懂的縮寫(如 CEO, FYI, N/A)弄得一頭霧水?本文為您整理最常見的職場英文縮寫,從C-Suite高層職位、日常職位、組織地點、Email常用語,到商業交易、學位、萬用縮寫,全方位解析,幫助您快速理解職場訊息,提升溝通效率與專業度。
Thumbnail
開會到一半,好同事傳訊來,提前告知我,某個專案,可能有些變化,進度應該會再往後push back,「讓妳有個心理準備,知道bottom line在哪,少受點衝撞。」 我感恩好同事的體貼,連我職場性格的盲點,都一併替我設想周到。
Thumbnail
開會到一半,好同事傳訊來,提前告知我,某個專案,可能有些變化,進度應該會再往後push back,「讓妳有個心理準備,知道bottom line在哪,少受點衝撞。」 我感恩好同事的體貼,連我職場性格的盲點,都一併替我設想周到。
Thumbnail
2025 H1,Novartis 交出亮眼成績單── 營收 273 億美元,YoY +13 % 四大核心業務(Cardio-Renal-Metabolic、Immunology、Neuroscience、Oncology)全數雙位數成長
Thumbnail
2025 H1,Novartis 交出亮眼成績單── 營收 273 億美元,YoY +13 % 四大核心業務(Cardio-Renal-Metabolic、Immunology、Neuroscience、Oncology)全數雙位數成長
Thumbnail
文章探討在會議前的輔導中,三個部門在同一展店目標下,由於缺乏主要負責部門而導致的資源不協調問題;同時指出指標與目標的混淆,以及高階主管與基層主管在目標設定上的角色錯置。透過CEO的參與與OGSM專案管理工具的運用,促進了各部門的對話與協作,為2025年度策略會議做好準備。
Thumbnail
文章探討在會議前的輔導中,三個部門在同一展店目標下,由於缺乏主要負責部門而導致的資源不協調問題;同時指出指標與目標的混淆,以及高階主管與基層主管在目標設定上的角色錯置。透過CEO的參與與OGSM專案管理工具的運用,促進了各部門的對話與協作,為2025年度策略會議做好準備。
Thumbnail
面對職場第一件最重要的事情就是看會你老闆。無論那個老闆是你的Leader、Manager、CEO還是任何一個你的上階管理者。
Thumbnail
面對職場第一件最重要的事情就是看會你老闆。無論那個老闆是你的Leader、Manager、CEO還是任何一個你的上階管理者。
Thumbnail
年輕人對於職涯發展充滿困惑,在南下出差途中與老司機討論專案、工作機會和有意義的人生。他分享了放棄臺積電工作的原因,以及對於轉換工作的疑惑。老司機開玩笑地給予了建議,最後鼓舞年輕人專注於解決問題、提出有效策略和做好未來準備是重要的目標。
Thumbnail
年輕人對於職涯發展充滿困惑,在南下出差途中與老司機討論專案、工作機會和有意義的人生。他分享了放棄臺積電工作的原因,以及對於轉換工作的疑惑。老司機開玩笑地給予了建議,最後鼓舞年輕人專注於解決問題、提出有效策略和做好未來準備是重要的目標。
Thumbnail
“產品的成功,是團隊中每個人都做了他們該做的事。但產品的失敗,錯誤都歸咎於產品經理”。— 如果你想避免失敗,就需要先正視產品失敗的根本原因。
Thumbnail
“產品的成功,是團隊中每個人都做了他們該做的事。但產品的失敗,錯誤都歸咎於產品經理”。— 如果你想避免失敗,就需要先正視產品失敗的根本原因。
追蹤感興趣的內容從 Google News 追蹤更多 vocus 的最新精選內容追蹤 Google News