Skip to content

Plan and Execute Agent node#

Plan and Execute Agent คล้ายกับ ReAct agent แต่เน้นที่การวางแผน มันจะสร้างแผนระดับสูงเพื่อแก้ปัญหางานที่กำหนดก่อน แล้วจึงดำเนินการตามแผนทีละขั้นตอน Agent นี้มีประโยชน์ที่สุดสำหรับงานที่ต้องการแนวทางที่มีโครงสร้างและการวางแผนอย่างรอบคอบ

อ้างอิง AI Agent สำหรับข้อมูลเพิ่มเติมเกี่ยวกับ AI Agent node เอง

Node parameters#

กำหนดค่า Plan and Execute Agent โดยใช้ parameters ต่อไปนี้

Prompt#

Prompt (ข้อความแจ้ง)#

เลือกวิธีที่คุณต้องการให้ node สร้าง prompt (หรือที่เรียกว่า query ของผู้ใช้ หรือ input จากแชท)

เลือกจาก:

  • Take from previous node automatically (รับจาก node ก่อนหน้าโดยอัตโนมัติ): หากคุณเลือกตัวเลือกนี้ node จะคาดหวัง input จาก node ก่อนหน้าชื่อ chatInput
  • Define below (กำหนดด้านล่าง): หากคุณเลือกตัวเลือกนี้ ให้ระบุข้อความคงที่หรือ expression สำหรับเนื้อหาแบบไดนามิกเพื่อใช้เป็น prompt ในฟิลด์ Prompt (User Message)

Require Specific Output Format#

Output Format (รูปแบบ Output)#

พารามิเตอร์นี้ควบคุมว่าคุณต้องการให้ node กำหนดรูปแบบ output ที่เฉพาะเจาะจงหรือไม่ เมื่อเปิดใช้งาน n8n จะแจ้งให้คุณเชื่อมต่อ output parser หนึ่งในรายการต่อไปนี้เข้ากับ node:

Node options#

ปรับแต่งพฤติกรรมของ Plan and Execute Agent node โดยใช้ options เหล่านี้:

Human Message Template#

ป้อนข้อความที่ n8n จะส่งไปยัง agent ในระหว่างการดำเนินการแต่ละขั้นตอน

LangChain expressions ที่มีอยู่:

  • {previous_steps}: มีข้อมูลเกี่ยวกับขั้นตอนก่อนหน้าที่ agent ได้ทำเสร็จแล้ว
  • {current_step}: มีข้อมูลเกี่ยวกับขั้นตอนปัจจุบัน
  • {agent_scratchpad}: ข้อมูลที่ต้องจำสำหรับการวนซ้ำครั้งต่อไป

Templates and examples#

อ้างอิงส่วน Templates and examples ของ AI Agent node หลัก

Common issues#

สำหรับคำถามหรือปัญหาทั่วไปและแนวทางแก้ไขที่แนะนำ โปรดดูที่ Common issues

AI glossary#

  • completion: Completions are the responses generated by a model like GPT.
  • hallucinations: Hallucination in AI is when an LLM (large language model) mistakenly perceives patterns or objects that don't exist.
  • vector database: A vector database stores mathematical representations of information. Use with embeddings and retrievers to create a database that your AI can access when answering questions.
  • vector store: A vector store, or vector database, stores mathematical representations of information. Use with embeddings and retrievers to create a database that your AI can access when answering questions.