GetNotes Tools
PrimeIntellect-ai/prime-agent
Tool นี้คืออะไร
Prime Agent เป็นเอเจนต์ AI แบบโอเพนซอร์สสำหรับการเขียนโค้ดและงานวิจัยที่ซับซ้อนและใช้เวลานาน เหมาะสำหรับนักพัฒนาและนักวิจัยที่ต้องการเครื่องมือที่สามารถเรียนรู้ ปรับปรุงตัวเอง และทำงานต่อเนื่องได้แม้จะตัดการเชื่อมต่อเทอร์มินัล
ข้อมูลโปรเจกต์
ดาว
9.2K
Forks
889
License
MIT
อัปเดต GitHub ล่าสุด
9 ส.ค. 2569
เพิ่มใน GetNotes
17 ส.ค. 2569
Repository
PrimeIntellect-ai/prime-agent
แปลและเรียบเรียงโดย AI
เนื้อหาฉบับภาษาไทย
ใช้อ่านเพื่อทำความเข้าใจเบื้องต้น โปรดตรวจสอบรายละเอียดสำคัญกับเอกสารต้นฉบับด้านล่าง
Prime Agent เป็นเอเจนต์แบบโอเพนซอร์สสำหรับการเขียนโค้ดและงานวิจัยทั่วไปและงานที่ใช้เวลานาน ได้รับการออกแบบโดยใช้แนวคิดหลักสองประการ:
- Recursive Language Model (RLM) ถือว่าบริบทเป็นตัวแปร (prompt-as-a-variable) และเครื่องมือต่างๆ เช่น ซับเอเจนต์แบบเรียกซ้ำ เป็นการเรียกใช้ฟังก์ชัน (programmatic tool /sub-agent calling) ภายใน REPL แบบคงอยู่
- Continual Harness จัดเก็บพร้อมต์เสริม, หน่วยความจำ, คำอธิบายทักษะ, และข้อกำหนดซับเอเจนต์ที่นำกลับมาใช้ใหม่ได้ในฐานะสถานะที่คงทน ซึ่ง Prime Agent สามารถปรับปรุงได้ผ่านการอัปเดตเล็กๆ ที่อิงตามหลักฐาน โดยค่าเริ่มต้นจะเป็นแบบโลคัลเฉพาะเซสชัน
Prime Agent ผสมผสานสภาพแวดล้อมการควบคุม Python แบบคงอยู่เข้ากับสถานะ harness ที่คงทน เพื่อให้บริบทการทำงานที่เป็นประโยชน์และรูปแบบการทำงานที่นำกลับมาใช้ใหม่ได้สามารถคงอยู่ได้นานกว่าหน้าต่างแชทเดียว
- ทุกอย่างเป็นแบบโปรแกรม: IPython แบบคงอยู่เป็นเครื่องมือโมเดลในตัว; การดำเนินการไฟล์, คำสั่งเชลล์, การใช้เครื่องมือ, ซับเอเจนต์, และการจัดการบริบทเกิดขึ้นผ่านโค้ด
- มีซับเอเจนต์ในตัว:
rlm(...)สร้างเอเจนต์ลูกจริงสำหรับการทำงานแบบขนานหรือเบื้องหลัง และส่งคืนผลลัพธ์แบบโปรแกรม - Harness สามารถปรับปรุงได้:
/refineตรวจสอบเส้นทางการทำงานปัจจุบันและสามารถใช้การอัปเดตเล็กๆ ที่อิงตามหลักฐานกับสถานะ harness เสริมได้ มันไม่เขียนทับพร้อมต์ระบบพื้นฐานที่ไม่เปลี่ยนแปลงได้ และสแนปช็อตที่บันทึกไว้รองรับการย้อนกลับ - ทักษะสามารถเรียกใช้งานได้: ทักษะคือแพ็กเกจ Python ที่สามารถนำเข้าได้ และเครื่องมือสร้างทักษะในตัวสามารถเปลี่ยนเวิร์กโฟลว์ที่เกิดซ้ำให้เป็นทักษะของโปรเจกต์หรือส่วนตัวได้
- เซสชันทำงานในเบื้องหลัง: เอเจนต์ที่ทำงานโดย daemon จะยังคงทำงานต่อไปเมื่อเทอร์มินัลตัดการเชื่อมต่อ และสามารถเชื่อมต่อใหม่ได้ในภายหลัง
- เอเจนต์สื่อสารกันโดยตรง: เอเจนต์ที่กำลังทำงานสามารถแลกเปลี่ยนข้อความและประสานงานกันได้โดยไม่ต้องส่งทุกอย่างผ่านผู้ใช้
- งานที่ใช้เวลานานยังคงดำเนินต่อไป: การบีบอัดอัตโนมัติ, เป้าหมายที่คงอยู่, heartbeats, ตารางเวลา, โหมดอัตโนมัติ, และซับเอเจนต์ที่คงอยู่ ช่วยรักษางานที่ทำค้างไว้ในแต่ละรอบและเซสชันเทอร์มินัล
เริ่มต้นใช้งาน
ติดตั้งเวอร์ชันเสถียรล่าสุดบน macOS หรือ Linux:
curl -fsSL https://app.primeintellect.ai/prime-agent/install.sh | shตัวติดตั้งจะดาวน์โหลดเวอร์ชันที่ระบุ, ตรวจสอบ SHA-256 checksum, ติดตั้งคำสั่ง prime-agent, และสามารถเตรียมรันไทม์ IPython ที่เอเจนต์ใช้
เริ่ม Prime Agent จาก repository หรือไดเรกทอรีที่คุณต้องการให้มันทำงาน:
cd /path/to/project
prime-agentในการเปิดใช้งานครั้งแรก ให้รัน /login เพื่อเลือกผู้ให้บริการการสมัครสมาชิกหรือ API-key Prime Agent ทำงานในไดเรกทอรีปัจจุบันและสามารถรันคำสั่งและแก้ไขไฟล์ได้ที่นั่น ใช้โคลนแบบใช้แล้วทิ้ง, worktree ที่สะอาด, หรือจุดตรวจสอบอื่นที่คุณสามารถตรวจสอบและกู้คืนได้
Prime Agent รันคำสั่ง Python และคำสั่งโปรเจกต์ที่สร้างโดยโมเดลด้วยสิทธิ์ผู้ใช้ของคุณ กระบวนการ worker และ kernel ของมันช่วยปรับปรุงการแยกวงจรชีวิตและการกู้คืน; พวกมัน ไม่ใช่ แซนด์บ็อกซ์ด้านความปลอดภัย ตรวจสอบการเปลี่ยนแปลงและใช้เฉพาะ repository, คำแนะนำ, ทักษะ, และส่วนขยายที่เชื่อถือได้เท่านั้น รันโค้ดหรือคำแนะนำที่ไม่น่าเชื่อถือในแซนด์บ็อกซ์ภายนอกหรือสภาพแวดล้อมที่จำกัด
คำสั่งที่มีประโยชน์:
prime-agent agents # เรียกดูเซสชันที่กำลังทำงาน, ว่าง, และที่บันทึกไว้
prime-agent attach <agent> # เชื่อมต่อใหม่กับเซสชันที่กำลังทำงาน
prime-agent --resume [path|id] # เรียกดูเซสชันหรือกลับมาทำงานต่อโดยตรง
prime-agent status # ตรวจสอบสถานะบริการเบื้องหลัง
prime-agent doctor [--fix] # ตรวจสอบหรือซ่อมแซมบริการเบื้องหลัง
prime-agent update [--force] # อัปเดต Prime Agent
prime-agent shutdown [--force] # หยุดเอเจนต์, worker, และบริการเบื้องหลังทั้งหมดสร้างขึ้นสำหรับงานที่ใช้เวลานาน
Prime Agent ถูกสร้างขึ้นมาสำหรับงานที่ใช้เวลานาน โดยเฉพาะอย่างยิ่งสำหรับการประเมินผลในการวิจัย คุณสมบัติเหล่านี้มีให้ใช้งานใน TUI และเมื่อรันในโหมดอัตโนมัติ
- Continual Harness:
/refineสามารถบันทึกบทเรียนที่เน้นและตรวจสอบได้เป็นพร้อมต์เสริม, หน่วยความจำ, คำอธิบายทักษะที่นำกลับมาใช้ใหม่ได้, หรือข้อกำหนดซับเอเจนต์ พร้อมประวัติการปรับปรุงที่บันทึกไว้ มันไม่ได้มาแทนที่การแพ็กเกจและตรวจสอบทักษะที่เรียกใช้งานได้ใหม่ - การสื่อสารโดยตรงระหว่างเอเจนต์: เอเจนต์ที่กำลังทำงานและซับเอเจนต์ที่คงอยู่สามารถค้นพบกัน, แลกเปลี่ยนข้อความ, และนำทางงานที่กำลังดำเนินอยู่ได้
- ความต่อเนื่องที่รองรับโดย Daemon: เซสชันที่ใช้งานอยู่, สถานะ IPython, ตารางเวลา, และซับเอเจนต์ยังคงทำงานต่อไปเมื่อเทอร์มินัลตัดการเชื่อมต่อและสามารถเชื่อมต่อใหม่ได้ในภายหลัง
- Heartbeats และตารางเวลา:
/heartbeat,rlm_heartbeat, และprime-agent scheduleสามารถกลับเข้าสู่เซสชันได้เป็นระยะหรือตามเวลาที่กำหนด - เป้าหมายที่คงอยู่:
/goalทำให้วัตถุประสงค์และความคืบหน้ายังคงใช้งานได้ในแต่ละรอบจนกว่าจะเสร็จสิ้น, หยุดชั่วคราว, หรือถูกล้าง - โหมดอัตโนมัติแบบจำกัด:
/autonomousทำงานต่อไปภายในงบประมาณรอบ, โทเค็น, และเวลาที่กำหนดค่าไว้ และสามารถรัน quality gates ที่ผู้ใช้กำหนดได้ เกตที่ผ่านจะตรวจสอบเฉพาะสิ่งที่เกตนั้นยืนยันเท่านั้น; การถึงขีดจำกัดไม่ได้หมายความว่างานสำเร็จ
เอกสารประกอบ
- เริ่มต้นใช้งานอย่างรวดเร็ว — ติดตั้ง, ยืนยันตัวตน, และรันเซสชันแรก
- การใช้งานและข้อมูลอ้างอิง CLI — คำสั่ง, เซสชัน, ขีดจำกัดอัตโนมัติ, และโหมดเอาต์พุต
- เอเจนต์ที่ทำงานนานและทำงานเบื้องหลัง — ตัดการเชื่อมต่อและเชื่อมต่อใหม่, เป้าหมาย, heartbeats, และตารางเวลา
- โมเดลการเขียนโปรแกรม RLM — IPython แบบคงอยู่, ซับเอเจนต์, ทักษะ, และโมเดลความน่าเชื่อถือ
- โหมด JSON และ โหมด RPC — ระบบอัตโนมัติแบบ Headless และการผสานรวม
- ทักษะ — ติดตั้งและสร้างความสามารถที่นำกลับมาใช้ใหม่ได้
- การตั้งค่าผู้ให้บริการ — ผู้ให้บริการการสมัครสมาชิกและ API-key
- ภาพรวมสถาปัตยกรรม — ขอบเขตของ daemon, worker, kernel, และการคงอยู่
- การพัฒนา — สร้างและรันจากซอร์สโค้ด
การมีส่วนร่วม
เริ่มต้นด้วย GitHub Discussion สำหรับ คำถามทั่วไป, รายงานข้อผิดพลาด, และ คำขอคุณสมบัติ ผู้ดูแลจะย้ายงานที่ได้รับการยอมรับไปยัง Issues และ pull request จะได้รับการตรวจสอบจากผู้ดูแลและผู้มีส่วนร่วมที่ได้รับการรับรอง
อ่าน แนวทางการมีส่วนร่วม สำหรับกระบวนการทั้งหมด รายงานช่องโหว่ด้านความปลอดภัยแบบส่วนตัวโดยปฏิบัติตาม นโยบายความปลอดภัย
คำขอบคุณ
เอเจนต์และ TUI ของเราสร้างขึ้นบน pi เราขอขอบคุณผู้เขียน pi สำหรับผลงานอันมีค่าของพวกเขา
สัญญาอนุญาต
Prime Agent เป็นโอเพนซอร์สเต็มรูปแบบและเผยแพร่ภายใต้ MIT License
เอกสารโปรเจกต์
อ่านเอกสารต้นฉบับ
README วิธีติดตั้ง วิธีใช้งาน และข้อกำหนดจาก repository ต้นฉบับ
Prime Agent is an open-source coding and research agent for general and long-running work. It is designed around two core abstractions:
- The Recursive Language Model (RLM) treats context as variables (prompt-as-a-variable) and tools like recursive subagents as function calls (programmatic tool /sub-agent calling) inside a persistent REPL.
- The Continual Harness stores supplemental prompts, memories, skill descriptions, and reusable subagent specifications as durable state that Prime Agent can refine through small, evidence-backed updates, local to the session by default.
Install
Install the latest stable version with the one-command installer:
curl -fsSL https://app.primeintellect.ai/prime-agent/install.sh | shOn Windows, install from PowerShell:
irm https://app.primeintellect.ai/prime-agent/install.ps1 | iexThe Windows installer downloads the latest stable Windows x64 build and verifies its checksum before installation.
Why Prime Agent
Prime Agent combines a persistent Python control environment with durable harness state, so useful working context and reusable operating patterns can outlive a single chat window.
- Everything is programmatic: a persistent Python REPL is the built-in model tool; file operations, shell commands, tool use, subagents, and context management happen through code.
- Subagents are built in:
rlm.spawn(...)spawns real child agents for parallel or background work and returns their results programmatically. - The harness can improve:
/refinereviews the current trajectory and can apply small, evidence-backed updates to supplemental harness state. It never rewrites the immutable base system prompt, and recorded snapshots support rollback. - Skills can be executable: Python skills in your user configuration are imported into the kernel; repository skills provide Markdown instructions without automatic code execution.
- Sessions run in the background: daemon-backed agents keep running when the terminal disconnects and can be reattached later.
- Agents communicate directly: running agents can exchange messages and orchestrate one another without routing everything through the user.
- Long tasks keep moving: automatic compaction, persistent goals, heartbeats, schedules, autonomous mode, and retained subagents preserve progress across turns and terminal sessions.
Getting Started
Start Prime Agent from the repository or directory you want it to work in:
cd /path/to/project
prime-agentOn first launch, run /login to choose a subscription or API-key provider. Prime Agent works in the current directory and can run commands and modify files there. Use a disposable clone, clean worktree, or another checkpoint you can inspect and restore.
Prime Agent executes model-generated Python and project commands with your user permissions. Its worker and kernel processes improve lifecycle isolation and recovery; they are not a security sandbox. Review changes and use trusted repositories, instructions, and skills only. Run untrusted code or instructions in an external sandbox or restricted environment.
Useful commands:
prime-agent agents # Browse running, idle, and saved sessions
prime-agent attach <agent> # Reattach to a running session
prime-agent --resume [path|id] # Browse sessions or resume one directly
prime-agent status # Inspect background service state
prime-agent doctor [--fix] # Inspect or repair background services
prime-agent update [--force] # Update Prime Agent
prime-agent shutdown [--force] # Stop every agent, worker, and background servicePrime Agent can also serve the Agent2Agent (A2A) 1.0 protocol, so any A2A client can drive it:
prime-agent --mode a2a # Serve A2A on http://127.0.0.1:7800
PRIME_AGENT_A2A_TOKEN=<secret> prime-agent --mode a2a --a2a-port 7800
curl http://127.0.0.1:7800/.well-known/agent-card.json # Public agent cardEach A2A contextId gets its own Prime Agent session, and its tasks run one at a time. A task is one prompt turn, plus the follow-up turns of the work it started (subagents, goal and autonomous continuations); replies stream over SSE. Every route except the agent card requires Authorization: Bearer <token>. Without PRIME_AGENT_A2A_TOKEN, the mode mints a token for the run, writes it to an owner-only file in the agent dir, and prints the path. To serve several clients, pass --a2a-clients <file> instead: a JSON object mapping each client name to its own token, such as {"ci": "<token>", "dashboard": "<token>"}. Each client sees only the tasks and contexts it created; another client's task answers like an unknown one, and the same contextId from two clients is two conversations. A message whose acceptedOutputModes excludes the card's output mode (text/markdown) is refused. CancelTask stops the task's turn, its queued input, its subagents, and any goal or autonomous loop. --a2a-max-contexts (default 64) caps the conversations that hold a live worker; a new contextId beyond it is refused. Behind a TLS front, --a2a-public-url sets the URL the card advertises. Contexts and tasks live in the server's memory: after a restart, a reused contextId starts a new conversation.
Built for Long-Running Work
Prime Agent is built for long-running work, especially for evaluations in research. These features are available in the TUI, and when run autonomously.
- Continual Harness:
/refinecan persist focused, reviewable lessons as supplemental prompts, memories, reusable skill descriptions, or subagent specifications, with recorded refinement history. It does not replace packaging and reviewing new executable skills. - Direct agent-to-agent communication: running agents and retained subagents can discover one another, exchange messages, and steer active work.
- Daemon-backed continuity: active sessions, Python REPL state, schedules, and subagents keep running when the terminal detaches and can be reattached later.
- Heartbeats and schedules:
/heartbeat,rlm_heartbeat, andprime-agent schedulecan re-enter a session periodically or at a specific time. - Persistent goals:
/goalkeeps an objective and its progress active across turns until it is completed, paused, or cleared. - Bounded autonomous mode:
/autonomouscontinues within configured turn, token, and time budgets and can run user-defined quality gates. A passed gate checks only what that gate verifies; reaching a limit does not imply task success.
Contributing
Start with a GitHub Discussion for general questions, bug reports, and feature requests. Maintainers promote accepted work into Issues, and pull requests are reviewed from maintainers and vouched contributors.
License
Prime Agent is fully open source and released under the MIT License.
Citation
If you use this codebase in your research, please cite Prime Agent:
@article{karten2026prime,
title={Prime Agent: A Self-Improving RLM Harness},
author={Karten, Seth and Zhang, Alex L. and Thomas, Kevin and Müller, Sebastian and Bakouch, Elie and Auras, Daniel and Senghaas, Mika and Obeid, Fares and Dunas, Konstantin and Hagemann, Johannes and Jaghouar, Sami},
journal={arXiv preprint arXiv:2608.23552},
year={2026}
}Available at https://arxiv.org/abs/2608.23552.
