ข้ามไปที่เนื้อหา

Configuration

OpenJarvis ใช้ไฟล์ตั้งค่า TOML ในการควบคุมการเลือก engine, ตัวตนของโมเดล, memory backend, พฤติกรรมของเอเจนต์ และอื่นๆ หน้านี้คือเอกสารอ้างอิงฉบับสมบูรณ์สำหรับทุกตัวเลือกการตั้งค่า จัดกลุ่มตาม primitive

ตำแหน่งไฟล์ Config

ไฟล์ตั้งค่าอยู่ที่:

~/.openjarvis/config.toml

OpenJarvis จะสร้างไดเรกทอรี ~/.openjarvis/ และเติม config เริ่มต้นให้เมื่อคุณรัน jarvis init

การย้ายไดเรกทอรีของ OpenJarvis

OpenJarvis เก็บ state ทั้งหมด ของมัน — config, ฐานข้อมูล, cache, log, credential, skill, recipe, connector — ไว้ใต้ root เดียว เพื่อไม่ให้รก โฟลเดอร์ home ของคุณเกินหนึ่งโฟลเดอร์ โดยค่าเริ่มต้น root นี้คือ ~/.openjarvis แต่คุณสามารถย้ายมันได้

root ถูก resolve ตามลำดับความสำคัญดังนี้:

  1. $OPENJARVIS_HOME — override แบบชัดเจน ทั้งตัวติดตั้งและ Python runtime จะยึดตามนี้
  2. $XDG_DATA_HOME/openjarvis — ใช้เมื่อมีการตั้งค่า $XDG_DATA_HOME (ไดเรกทอรี openjarvis เดียวซ้อนอยู่ใต้นั้น ตามข้อกำหนด XDG Base Directory)
  3. ~/.openjarvis — ค่าเริ่มต้น เมื่อไม่มีการตั้งค่า environment variable ใดๆ path ที่ resolve ได้จะเป็นค่านี้เป๊ะๆ ดังนั้นการติดตั้งเดิมจะไม่ถูกกระทบ
# ย้ายทั้งต้นไม้ install + runtime ตอนติดตั้ง:
OPENJARVIS_HOME=~/apps/openjarvis curl -fsSL https://open-jarvis.github.io/OpenJarvis/install.sh | bash

# หรือสำหรับรันครั้งเดียว / shell profile ของคุณ:
export OPENJARVIS_HOME=~/apps/openjarvis

ตรวจสอบว่าข้อมูลของคุณอยู่ที่ไหนด้วย:

jarvis config path

การย้ายข้อมูล (Migration)

เนื่องจากค่าเริ่มต้นไม่เปลี่ยนแปลง จึงไม่จำเป็นต้องย้ายข้อมูล สำหรับ การติดตั้งเดิม หากคุณตั้งค่า OPENJARVIS_HOME (หรือ XDG_DATA_HOME) บน เครื่องที่มีข้อมูลอยู่ใน ~/.openjarvis อยู่แล้ว OpenJarvis จะมองหาข้อมูล ที่ตำแหน่งใหม่และจะไม่เห็นข้อมูลเก่าของคุณ — ย้ายเองหากต้องการเก็บไว้: mv ~/.openjarvis "$OPENJARVIS_HOME"

$OPENJARVIS_CONFIG ยังคงชี้ไปยังไฟล์ config.toml แบบชัดเจน แยกจาก root หากคุณต้องการ override เฉพาะ path ของไฟล์ config เท่านั้น

การสร้าง Configuration

การตั้งค่าครั้งแรก

jarvis init

คำสั่งนี้จะ:

  1. รันการตรวจจับฮาร์ดแวร์อัตโนมัติ (ยี่ห้อ/รุ่น/VRAM ของ GPU, ยี่ห้อ/จำนวนคอร์ของ CPU, RAM)
  2. เลือก engine ที่แนะนำตามฮาร์ดแวร์ของคุณ
  3. เขียน ~/.openjarvis/config.toml พร้อมค่าเริ่มต้นที่เหมาะสม

การสร้าง Configuration ใหม่

หากต้องการเขียนทับ config ที่มีอยู่แล้ว:

jarvis init --force

Warning

--force จะเขียนทับไฟล์ config ที่มีอยู่ของคุณ สำรองข้อมูล config ก่อนหากคุณมีการตั้งค่าที่กำหนดเอง

หมวดหมู่ของ Configuration

ไฟล์ config จัดกลุ่มเป็นหมวด TOML ที่สอดคล้องกับ primitive ทั้งห้า ทุกฟิลด์มีค่าเริ่มต้นอยู่แล้ว คุณจึงต้องระบุเฉพาะค่าที่ต้องการเปลี่ยนเท่านั้น


[engine] — Inference Engine

ควบคุมว่าจะใช้ inference engine ตัวไหน และแต่ละ engine เข้าถึงได้อย่างไร ตอนนี้การตั้งค่า engine ถูก ซ้อน (nested) อยู่ใต้หมวดย่อยของแต่ละ engine แทนที่จะเป็นฟิลด์แบบเรียบ (flat)

[engine]
default = "ollama"

[engine.ollama]
host = "http://localhost:11434"

[engine.vllm]
host = "http://localhost:8000"

[engine.sglang]
host = "http://localhost:30000"

# [engine.llamacpp]
# host = "http://localhost:8080"
# binary_path = ""

[engine] ระดับบนสุด:

ฟิลด์ ชนิด ค่าเริ่มต้น คำอธิบาย
default string ตรวจจับอัตโนมัติ Engine backend เริ่มต้น หนึ่งใน: ollama, vllm, llamacpp, sglang, cloud ตั้งค่าอัตโนมัติโดย jarvis init ตามการตรวจจับฮาร์ดแวร์

[engine.ollama]:

ฟิลด์ ชนิด ค่าเริ่มต้น คำอธิบาย
host string http://localhost:11434 Base URL สำหรับเซิร์ฟเวอร์ API ของ Ollama

[engine.vllm]:

ฟิลด์ ชนิด ค่าเริ่มต้น คำอธิบาย
host string http://localhost:8000 Base URL สำหรับเซิร์ฟเวอร์ที่เข้ากันได้กับ OpenAI ของ vLLM

[engine.sglang]:

ฟิลด์ ชนิด ค่าเริ่มต้น คำอธิบาย
host string http://localhost:30000 Base URL สำหรับเซิร์ฟเวอร์ SGLang

[engine.llamacpp]:

ฟิลด์ ชนิด ค่าเริ่มต้น คำอธิบาย
host string http://localhost:8080 Base URL สำหรับเซิร์ฟเวอร์ HTTP ของ llama.cpp (llama-server)
binary_path string "" Path ไปยัง binary ของ llama.cpp หากไม่ได้อยู่ใน $PATH

Engine Fallback

หาก engine เริ่มต้นที่ตั้งค่าไว้เข้าถึงไม่ได้ OpenJarvis จะตรวจสอบ engine ที่ลงทะเบียนไว้ทั้งหมดโดยอัตโนมัติ และ fallback ไปยังตัวใดก็ได้ที่ยังทำงานปกติ

ความเข้ากันได้ย้อนหลัง (Backward Compatibility)

ชื่อฟิลด์แบบเรียบเดิม (ollama_host, vllm_host, llamacpp_host, llamacpp_path, sglang_host) ยังคงใช้งานได้ในฐานะ property ที่เข้ากันได้ย้อนหลัง config ใหม่ควรใช้รูปแบบหมวดย่อยแบบซ้อน


[intelligence] — ตัวตนของโมเดลและค่าเริ่มต้นการ Generate

ควบคุมว่าจะใช้โมเดลไหน, path ของ weight, การ quantize และพารามิเตอร์ sampling เริ่มต้นสำหรับการ generate พารามิเตอร์การ generate เช่น temperature และ max_tokens ย้ายมาอยู่ที่นี่แทนที่จะอยู่ใต้ [agent]

[intelligence]
default_model = ""
fallback_model = ""
# model_path = ""
# checkpoint_path = ""
# quantization = "none"
# preferred_engine = ""
# provider = ""
temperature = 0.7
max_tokens = 1024
# top_p = 0.9
# top_k = 40
# repetition_penalty = 1.0
# stop_sequences = ""

ฟิลด์ตัวตนของโมเดล:

ฟิลด์ ชนิด ค่าเริ่มต้น คำอธิบาย
default_model string "" Identifier ของโมเดลที่ต้องการ (เช่น qwen3:8b) เมื่อว่าง นโยบาย router จะเลือกโมเดลแบบไดนามิก
fallback_model string "" โมเดลที่ใช้เมื่อ default ไม่พร้อมใช้งาน
model_path string "" Path หรือ HuggingFace repo ID สำหรับ weight ในเครื่อง (เช่น "./models/qwen3-8b.gguf" หรือ "Qwen/Qwen3-8B")
checkpoint_path string "" Path ไปยัง checkpoint ที่ fine-tune แล้ว หรือไดเรกทอรี LoRA adapter
quantization string "none" รูปแบบ quantization ค่าที่รับได้: none, fp8, int8, int4, gguf_q4, gguf_q8
preferred_engine string "" Override engine สำหรับโมเดลนี้ (เช่น "vllm") มีความสำคัญเหนือกว่า engine.default
provider string "" คำใบ้ผู้ให้บริการโมเดล: local, openai, anthropic, google, minimax ใช้โดย Cloud engine เพื่อจัดเส้นทางการเรียก API

ฟิลด์ค่าเริ่มต้นการ Generate (override ต่อการเรียกแต่ละครั้งได้):

ฟิลด์ ชนิด ค่าเริ่มต้น คำอธิบาย
temperature float 0.7 อุณหภูมิของ sampling ค่ายิ่งต่ำ ผลลัพธ์ยิ่งแน่นอน (deterministic)
max_tokens int 1024 จำนวน token สูงสุดที่จะ generate ต่อการเรียกหนึ่งครั้ง
top_p float 0.9 มวลความน่าจะเป็นของ nucleus sampling
top_k int 40 Top-k sampling: พิจารณาเฉพาะ token อันดับ top-k ในแต่ละขั้นตอน
repetition_penalty float 1.0 ลงโทษ token ที่ซ้ำ ค่ามากกว่า 1 ช่วยลดการซ้ำ
stop_sequences string "" สตริงหยุดคั่นด้วยคอมมา การ generate จะหยุดเมื่อสร้างสตริงหยุดใดๆ ขึ้นมา

เมื่อทั้ง default_model และ fallback_model ว่างเปล่า OpenJarvis จะใช้นโยบาย router ที่ตั้งค่าไว้ (ดู [learning]) เพื่อเลือกโมเดลจากที่มีอยู่บน engine ที่ใช้งานอยู่

ลำดับความสำคัญในการเลือก Engine

เมื่อต้อง resolve ว่าจะใช้ engine ไหนสำหรับโมเดล SystemBuilder, sdk.py และ cli/ask.py จะตรวจสอบฟิลด์ตามลำดับนี้:

1. Explicit --engine CLI flag or engine_key= SDK parameter
2. config.intelligence.preferred_engine
3. config.engine.default
4. First healthy engine discovered at runtime

วิธีนี้ทำให้คุณ pin โมเดลใดโมเดลหนึ่งเข้ากับ engine เฉพาะได้ โดยไม่ต้องเปลี่ยน engine เริ่มต้นของทั้งระบบ:

[engine]
default = "ollama"

[intelligence]
default_model = "llama3.2:3b"
model_path = "./models/llama-3.2-3b.Q4_K_M.gguf"
quantization = "gguf_q4"
preferred_engine = "llamacpp"

[agent] — พฤติกรรมของเอเจนต์

ควบคุมเอเจนต์เริ่มต้น, จำนวนรอบสูงสุด, การเลือก tool, system prompt และการแทรกบริบทจาก memory

[agent]
default_agent = "simple"
max_turns = 10
# tools = ""
# objective = ""
# system_prompt = ""
# system_prompt_path = ""
context_from_memory = true
ฟิลด์ ชนิด ค่าเริ่มต้น คำอธิบาย
default_agent string "simple" เอเจนต์เริ่มต้นที่ใช้ มีให้เลือก: simple, orchestrator, react, operative, monitor_operative
max_turns int 10 จำนวนรอบการเรียกใช้ tool สูงสุดสำหรับเอเจนต์ orchestrator ก่อนที่จะต้องสร้างคำตอบสุดท้าย
tools string "" รายการ tool ที่เปิดใช้งานเป็นค่าเริ่มต้น คั่นด้วยคอมมา (เช่น "calculator,think")
objective string "" สตริงจุดประสงค์แบบกระชับ สำหรับการจัดเส้นทาง, การเรียนรู้ และเอกสารประกอบ
system_prompt string "" System prompt แบบ inline มีความสำคัญเหนือ system_prompt_path เมื่อตั้งค่าไว้
system_prompt_path string "" Path ไปยังไฟล์ system prompt (.txt หรือ .md)
context_from_memory bool true จะแทรกบริบทที่เกี่ยวข้องจาก memory เข้าไปในคำถามโดยอัตโนมัติหรือไม่

พารามิเตอร์การ Generate ย้ายที่แล้ว

temperature และ max_tokens ย้ายจาก [agent] ไปยัง [intelligence] แล้ว config เก่าที่มีฟิลด์เหล่านี้อยู่ใต้ [agent] จะถูกย้ายไปยัง [intelligence] โดยอัตโนมัติตอนโหลด

ความเข้ากันได้ย้อนหลัง

ชื่อฟิลด์เดิม default_tools ยังคงใช้งานได้ในฐานะ property ที่เข้ากันได้ย้อนหลังสำหรับ tools config ใหม่ควรใช้ tools

การแทรกบริบท (Context Injection)

เมื่อ context_from_memory = true และมีการ index เอกสารไว้แล้ว ทุกคำถามจะค้นหา memory หา chunk ที่เกี่ยวข้องโดยอัตโนมัติ แล้วนำมาต่อไว้เป็นบริบทของระบบ วิธีนี้ทำให้โมเดลเข้าถึงฐานความรู้ที่ index ไว้ของคุณได้โดยไม่ต้องทำอะไรเพิ่ม ปิดได้ด้วย --no-context บน CLI หรือ context=False ใน SDK


[learning] — นโยบายการเรียนรู้

ควบคุมว่าระบบการเรียนรู้เปิดใช้งานอยู่หรือไม่ และตั้งค่านโยบายของแต่ละ primitive ผ่านหมวดย่อยแบบซ้อน

[learning]
enabled = false
update_interval = 100
# auto_update = false

[learning.routing]
policy = "heuristic"
# min_samples = 5

# [learning.intelligence]
# policy = "none"

# [learning.agent]
# policy = "none"

# [learning.metrics]
# accuracy_weight = 0.6
# latency_weight = 0.2
# cost_weight = 0.1
# efficiency_weight = 0.1

[learning] ระดับบนสุด:

ฟิลด์ ชนิด ค่าเริ่มต้น คำอธิบาย
enabled bool false ระบบการเรียนรู้เปิดใช้งานอยู่หรือไม่
update_interval int 100 จำนวน trace ระหว่างการอัปเดตนโยบายอัตโนมัติแต่ละครั้ง
auto_update bool false จะสั่งอัปเดตนโยบายอัตโนมัติเมื่อถึง interval หรือไม่

[learning.routing] — นโยบาย Router:

ฟิลด์ ชนิด ค่าเริ่มต้น คำอธิบาย
policy string "heuristic" นโยบาย router สำหรับเลือกโมเดล มีให้เลือก: heuristic, learned (ขับเคลื่อนด้วย trace), sft (supervised fine-tuning), grpo (RL stub)
min_samples int 5 จำนวน trace ขั้นต่ำที่ต้องมีก่อนจะเชื่อการตัดสินใจ routing ที่เรียนรู้มา

[learning.intelligence] — นโยบายการเรียนรู้ของ Intelligence:

ฟิลด์ ชนิด ค่าเริ่มต้น คำอธิบาย
policy string "none" นโยบายการเรียนรู้ของ Intelligence มีให้เลือก: none, sft ใช้ sft เพื่อเรียนรู้การ routing โมเดลจาก trace ที่สะสมไว้

[learning.agent] — นโยบายการเรียนรู้ของเอเจนต์:

ฟิลด์ ชนิด ค่าเริ่มต้น คำอธิบาย
policy string "none" นโยบายการเรียนรู้ของเอเจนต์ มีให้เลือก: none, agent_advisor, icl_updater
max_icl_examples int 20 จำนวนตัวอย่าง in-context สูงสุดที่เก็บไว้ใน library ตัวอย่าง ICL
advisor_confidence_threshold float 0.7 คะแนนความมั่นใจขั้นต่ำที่ advisor จะแนะนำให้เปลี่ยนกลยุทธ์

[learning.metrics] — น้ำหนักของ Reward / Metric การปรับให้เหมาะสม:

ฟิลด์ ชนิด ค่าเริ่มต้น คำอธิบาย
accuracy_weight float 0.6 น้ำหนักของความแม่นยำของผลลัพธ์ใน composite reward score
latency_weight float 0.2 น้ำหนักของ latency การอนุมานใน composite reward score
cost_weight float 0.1 น้ำหนักของต้นทุนต่อการเรียกใน composite reward score
efficiency_weight float 0.1 น้ำหนักของประสิทธิภาพ token ใน composite reward score

นโยบาย Router:

นโยบาย คำอธิบาย
heuristic การเลือกแบบใช้กฎ (rule-based) โดยใช้กฎความสำคัญ 6 ข้อ พิจารณาความพร้อมใช้งานของโมเดล, จำนวนพารามิเตอร์, ความยาวบริบท และลักษณะของคำถาม ค่าเริ่มต้น
learned นโยบายที่ขับเคลื่อนด้วย trace เรียนรู้จากผลลัพธ์การโต้ตอบในอดีตที่เก็บไว้ในระบบ trace
sft นโยบาย supervised fine-tuning ที่เรียนรู้การ routing จากข้อมูล trace ที่มี label
grpo Group Relative Policy Optimization stub สำหรับ RL-based routing ในอนาคต

นโยบายเอเจนต์:

นโยบาย คำอธิบาย
agent_advisor แนะนำกลยุทธ์เอเจนต์ (ชุด tool, จำนวนรอบสูงสุด) จากรูปแบบใน trace
icl_updater ตัวอัปเดต in-context learning — ค้นหาตัวอย่าง ICL และลำดับ skill แบบหลาย tool ที่นำกลับมาใช้ได้จาก trace

คุณสามารถ override นโยบาย router ต่อคำถามผ่าน CLI ได้ด้วย:

jarvis ask --router heuristic "Hello"

ความเข้ากันได้ย้อนหลัง

ชื่อฟิลด์แบบเรียบเดิม default_policy, intelligence_policy, agent_policy และสตริง reward_weights แบบคั่นด้วยคอมมา ยังคงใช้งานได้ในฐานะ property ที่เข้ากันได้ย้อนหลัง config ใหม่ควรใช้รูปแบบหมวดย่อยแบบซ้อน ฟิลด์ tools_policy ถูกลบออกแล้ว ใช้ learning.agent.policy = "icl_updater" แทน


[tools.storage] — Storage Backend

ควบคุม storage backend ที่ใช้สำหรับ memory ของเอกสารและการแทรกบริบท ฟิลด์ context_injection ย้ายไปที่ agent.context_from_memory แล้ว

[tools.storage]
default_backend = "sqlite"
db_path = "~/.openjarvis/memory.db"
context_top_k = 5
context_min_score = 0.1
context_max_tokens = 2048
chunk_size = 512
chunk_overlap = 64
ฟิลด์ ชนิด ค่าเริ่มต้น คำอธิบาย
default_backend string "sqlite" Storage backend มีให้เลือก: sqlite (FTS5), faiss, colbert, bm25, hybrid
db_path string ~/.openjarvis/memory.db Path ไปยังฐานข้อมูล memory แบบ SQLite ใช้โดย backend sqlite
context_top_k int 5 จำนวนผลลัพธ์จาก memory อันดับต้นๆ ที่จะแทรกเป็นบริบท
context_min_score float 0.1 คะแนนความเกี่ยวข้องขั้นต่ำที่ผลลัพธ์จาก memory ต้องมีจึงจะถูกรวมในบริบท
context_max_tokens int 2048 จำนวน token สูงสุดที่ใช้สำหรับบริบทที่แทรกเข้าไป
chunk_size int 512 ขนาดของ chunk เอกสาร (หน่วยเป็น token) ตอน index เอกสาร
chunk_overlap int 64 ส่วนที่ทับซ้อนระหว่าง chunk ที่อยู่ติดกัน (หน่วยเป็น token) ตอน index

Memory Backend:

Backend Extra ที่ต้องมี คำอธิบาย
sqlite ไม่มี SQLite พร้อม full-text search แบบ FTS5 ไม่มี dependency เพิ่มเติม ค่าเริ่มต้น
faiss memory-faiss Facebook AI Similarity Search พร้อม sentence-transformer embedding
colbert memory-colbert ColBERTv2 late-interaction retrieval ต้องมี PyTorch
bm25 memory-bm25 BM25 sparse retrieval ผ่าน rank-bm25
hybrid ขึ้นอยู่กับ sub-backend Reciprocal Rank Fusion รวมหลาย backend เข้าด้วยกัน

ความเข้ากันได้ย้อนหลัง

หมวด TOML [memory] ยังคงรองรับอยู่ และ map ไปยัง [tools.storage] config ใหม่ควรใช้ [tools.storage] ฟิลด์ context_injection ใต้ [memory] หรือ [tools.storage] จะถูกย้ายไปยัง agent.context_from_memory โดยอัตโนมัติตอนโหลด


[tools.mcp] — MCP (Model Context Protocol)

ควบคุมเซิร์ฟเวอร์ MCP และการเชื่อมต่อกับ external MCP tool provider MCP adapter รองรับ protocol เวอร์ชัน 2025-11-25

[tools.mcp]
enabled = true
# servers = ""  # JSON list of external MCP server configs
ฟิลด์ ชนิด ค่าเริ่มต้น คำอธิบาย
enabled bool true เปิดใช้งาน MCP adapter สำหรับ expose และใช้งาน tool ผ่าน MCP หรือไม่
servers string "" รายการ configuration ของ external MCP server แบบ JSON

[server] — เซิร์ฟเวอร์ API

ควบคุมเซิร์ฟเวอร์ API ที่เข้ากันได้กับ OpenAI ซึ่งเริ่มโดย jarvis serve

[server]
host = "0.0.0.0"
port = 8000
agent = "orchestrator"
model = ""
workers = 1
ฟิลด์ ชนิด ค่าเริ่มต้น คำอธิบาย
host string "0.0.0.0" Bind address ของเซิร์ฟเวอร์ ใช้ "127.0.0.1" เพื่อจำกัดแค่ localhost
port int 8000 หมายเลข port ของเซิร์ฟเวอร์
agent string "orchestrator" เอเจนต์ที่ใช้สำหรับคำขอ chat completion
model string "" โมเดลเริ่มต้นของเซิร์ฟเวอร์ เมื่อว่าง จะใช้ intelligence.default_model หรือโมเดลแรกที่มี
workers int 1 จำนวน worker process ของ uvicorn

ตัวเลือกจาก CLI จะ override ค่าใน config:

jarvis serve --host 127.0.0.1 --port 9000 --model qwen3:8b --agent simple

[telemetry] — การเก็บ Telemetry

ควบคุมว่าจะบันทึกเทเลเมทรีของการอนุมานหรือไม่ และเก็บไว้ที่ไหน

[telemetry]
enabled = true
db_path = "~/.openjarvis/telemetry.db"
ฟิลด์ ชนิด ค่าเริ่มต้น คำอธิบาย
enabled bool true บันทึกเทเลเมทรีสำหรับการเรียก inference แต่ละครั้งหรือไม่ บันทึกเวลา, จำนวน token, โมเดล, engine และต้นทุน
db_path string ~/.openjarvis/telemetry.db Path ไปยังฐานข้อมูลเทเลเมทรีแบบ SQLite

Telemetry เก็บในเครื่องเท่านั้น

ข้อมูลเทเลเมทรีทั้งหมดถูกเก็บไว้ในเครื่องบนฐานข้อมูล SQLite ไม่มีการส่งข้อมูลใดๆ ไปยังบริการภายนอกเลย


[traces] — การบันทึก Trace

ควบคุมระบบ trace ที่บันทึกลำดับการโต้ตอบแบบเต็มสำหรับระบบการเรียนรู้

[traces]
enabled = false
db_path = "~/.openjarvis/traces.db"
ฟิลด์ ชนิด ค่าเริ่มต้น คำอธิบาย
enabled bool false บันทึก trace สำหรับการโต้ตอบของเอเจนต์แต่ละครั้งหรือไม่
db_path string ~/.openjarvis/traces.db Path ไปยังฐานข้อมูล trace แบบ SQLite

[skills] — ระบบ Skills

ควบคุมระบบ skills — ชุดการประกอบ tool และคำสั่งเอเจนต์ที่นำกลับมาใช้ซ้ำได้ Skills สอนให้เอเจนต์ใช้ tool ได้ดีขึ้นและปรับปรุงการให้เหตุผล ดู คู่มือผู้ใช้ Skills สำหรับเอกสารฉบับเต็ม

[skills]
enabled = true
skills_dir = "~/.openjarvis/skills/"
active = "*"
auto_discover = true
auto_sync = false
max_depth = 5
sandbox_dangerous = true
ฟิลด์ ชนิด ค่าเริ่มต้น คำอธิบาย
enabled bool true เปิดใช้งานระบบ skills หรือไม่ เมื่อปิด จะไม่มี skill ใดถูกโหลดหรือ expose ให้เอเจนต์เลย
skills_dir string ~/.openjarvis/skills/ ไดเรกทอรีที่ติดตั้ง skill
active string "*" รายชื่อ skill ที่จะเปิดใช้งาน คั่นด้วยคอมมา หรือ "*" สำหรับ skill ที่ค้นพบทั้งหมด
auto_discover bool true สแกน skills_dir หา skill ตอนเริ่มระบบหรือไม่
auto_sync bool false ดึงข้อมูลจากแหล่งที่ตั้งค่าไว้ตอนเริ่ม session หรือไม่ (ตรวจความใหม่ทุก 24 ชม.)
max_depth int 5 ความลึกสูงสุดของการซ้อน sub-skill สำหรับ skill ที่ประกอบขึ้น
sandbox_dangerous bool true เตือนเกี่ยวกับ skill ที่มีความสามารถอันตราย (shell:execute, network:listen, filesystem:write) หรือไม่

[[skills.sources]] — แหล่งนำเข้า Skill

ตั้งค่าแหล่ง skill หนึ่งแหล่งหรือมากกว่าสำหรับการนำเข้าอัตโนมัติ แต่ละรายการ [[skills.sources]] กำหนดแหล่งที่จะดึงข้อมูลมา

[[skills.sources]]
source = "hermes"
filter = { category = ["research", "coding", "productivity"] }
auto_update = true

[[skills.sources]]
source = "openclaw"
filter = { search = "web3|crypto" }

[[skills.sources]]
source = "github"
url = "https://github.com/myorg/internal-skills"
auto_update = true
ฟิลด์ ชนิด ค่าเริ่มต้น คำอธิบาย
source string "" ประเภทแหล่งข้อมูล: "hermes", "openclaw" หรือ "github"
url string "" URL ของ repository จำเป็นเมื่อ source = "github"
filter table {} เงื่อนไขการกรอง คีย์ที่รองรับ: category (list ของ string), search (สตริง regex)
auto_update bool false ดึง commit ล่าสุดตอน sync แหล่งนี้หรือไม่

[learning.skills] — Learning Loop ของ Skills

ควบคุมการปรับปรุงคำอธิบาย skill และตัวอย่าง few-shot จากข้อมูล trace โดยอัตโนมัติ ต้องมี [traces] enabled = true เพื่อเก็บ trace ที่ optimizer จะนำไปวิเคราะห์

[learning.skills]
auto_optimize = false
optimizer = "dspy"
min_traces_per_skill = 20
optimization_interval_seconds = 86400
overlay_dir = "~/.openjarvis/learning/skills/"
ฟิลด์ ชนิด ค่าเริ่มต้น คำอธิบาย
auto_optimize bool false รันการปรับปรุง skill อัตโนมัติหลังจากแต่ละรอบการเรียนรู้หรือไม่
optimizer string "dspy" นโยบายการปรับปรุง: "dspy" (bootstrap few-shot) หรือ "gepa" (evolutionary)
min_traces_per_skill int 20 จำนวน trace ขั้นต่ำที่ skill ต้องมีจึงจะมีสิทธิ์ถูกปรับปรุง
optimization_interval_seconds int 86400 รันการปรับปรุงได้อย่างมากหนึ่งครั้งต่อช่วงเวลานี้ (ค่าเริ่มต้น: วันละครั้ง)
overlay_dir string ~/.openjarvis/learning/skills/ ตำแหน่งที่เก็บ skill overlay ที่ปรับปรุงแล้ว

[channel] — Channel Messaging

ควบคุม channel messaging bridge สำหรับการสื่อสารข้ามหลายแพลตฟอร์ม แต่ละแพลตฟอร์มที่รองรับมีหมวดย่อยแบบซ้อนของตัวเอง

[channel]
enabled = false
default_channel = ""
default_agent = "simple"

# [channel.telegram]
# bot_token = ""

# [channel.discord]
# bot_token = ""

# [channel.slack]
# bot_token = ""
# app_token = ""

# [channel.webhook]
# url = ""
# secret = ""
# method = "POST"
ฟิลด์ ชนิด ค่าเริ่มต้น คำอธิบาย
enabled bool false เปิดใช้งาน channel messaging หรือไม่
default_channel string "" Channel เริ่มต้นเมื่อไม่ได้ระบุ
default_agent string "simple" เอเจนต์เริ่มต้นสำหรับจัดการข้อความจาก channel

[security] — Security Guardrails

ควบคุม pipeline การสแกนความปลอดภัยสำหรับเนื้อหา input/output

[security]
enabled = true
mode = "warn"
scan_input = true
scan_output = true
secret_scanner = true
pii_scanner = true
enforce_tool_confirmation = true
ฟิลด์ ชนิด ค่าเริ่มต้น คำอธิบาย
enabled bool true เปิดใช้งาน security guardrails หรือไม่
mode string "warn" การกระทำเมื่อพบสิ่งผิดปกติ: "warn" (บันทึก log อย่างเดียว), "redact" (แทนที่เนื้อหาที่ sensitive), หรือ "block" (สร้าง error)
scan_input bool true สแกนข้อความ input ของผู้ใช้หรือไม่
scan_output bool true สแกนผลลัพธ์ของโมเดลหรือไม่
secret_scanner bool true เปิดใช้งานการตรวจจับ secret (API key, token, password)
pii_scanner bool true เปิดใช้งานการตรวจจับ PII (อีเมล, เลขประกันสังคม, บัตรเครดิต)
enforce_tool_confirmation bool true ยอมรับค่านี้ได้แต่ ยังไม่บังคับใช้จริงในตอนนี้ คุณจะได้รับ prompt หรือไม่ขึ้นอยู่กับ entry point ดู System Access

เลือกโหมด Security

ใช้ "warn" ระหว่างพัฒนาเพื่อดูว่าอะไรจะถูกตั้งค่าสถานะโดยไม่รบกวนผลลัพธ์ ใช้ "redact" ในโปรดักชันเพื่อทำความสะอาดเนื้อหา sensitive โดยอัตโนมัติ ใช้ "block" สำหรับสภาพแวดล้อมที่เข้มงวด ซึ่งข้อมูล sensitive ใดๆ ควรหยุดการ generate ทันที


การตรวจจับฮาร์ดแวร์อัตโนมัติ

เมื่อคุณรัน jarvis init OpenJarvis จะตรวจสอบระบบของคุณเพื่อตรวจจับฮาร์ดแวร์ที่มีอยู่ การตรวจจับทำงานตามลำดับนี้:

การตรวจจับ GPU

  1. GPU NVIDIA — ตรวจสอบ nvidia-smi บน $PATH หากพบ จะ query ชื่อ GPU, VRAM (หน่วย MB) และจำนวน GPU ผ่าน:

    nvidia-smi --query-gpu=name,memory.total,count --format=csv,noheader,nounits
    
  2. GPU AMD — ตรวจสอบ rocm-smi บน $PATH หากพบ จะ query ชื่อผลิตภัณฑ์ผ่าน:

    rocm-smi --showproductname
    
  3. Apple Silicon — เฉพาะบน macOS เท่านั้น รัน system_profiler SPDisplaysDataType และมองหาคำว่า "Apple" ในบรรทัดรุ่นชิปเซ็ต

หากไม่พบ GPU จากทั้งสามวิธีนี้ ระบบจะถูกจัดว่าเป็น CPU-only

การตรวจจับ CPU และ RAM

  • ยี่ห้อ CPU: อ่านจาก sysctl -n machdep.cpu.brand_string บน macOS หรือ parse model name จาก /proc/cpuinfo บน Linux
  • จำนวน CPU: ใช้ os.cpu_count() ของ Python
  • RAM: อ่านจาก sysctl -n hw.memsize บน macOS หรือ parse MemTotal จาก /proc/meminfo บน Linux

Dataclass ของฮาร์ดแวร์ที่ตรวจจับได้

ผลการตรวจจับถูกเก็บไว้ในรูปแบบ dataclass HardwareInfo:

@dataclass
class HardwareInfo:
    platform: str      # "linux", "darwin", "windows"
    cpu_brand: str     # e.g., "AMD EPYC 7763"
    cpu_count: int     # e.g., 128
    ram_gb: float      # e.g., 512.0
    gpu: GpuInfo | None

@dataclass
class GpuInfo:
    vendor: str             # "nvidia", "amd", "apple"
    name: str               # e.g., "NVIDIA A100-SXM4-80GB"
    vram_gb: float          # e.g., 80.0
    compute_capability: str # (NVIDIA only)
    count: int              # e.g., 8

ตรรกะการแนะนำ Engine

จากฮาร์ดแวร์ที่ตรวจจับได้ recommend_engine() จะเลือก engine เริ่มต้นที่เหมาะสมที่สุด:

graph TD
    A[detect_hardware] --> B{GPU detected?}
    B -->|No| C[llamacpp]
    B -->|Yes| D{GPU vendor?}
    D -->|Apple| E[ollama]
    D -->|NVIDIA| F{Datacenter GPU?}
    D -->|AMD| G[vllm]
    F -->|Yes: A100, H100, H200, L40, A10, A30| H[vllm]
    F -->|No: consumer GPU| I[ollama]
ฮาร์ดแวร์ Engine ที่แนะนำ เหตุผล
ไม่มี GPU llamacpp การอนุมานบน CPU อย่างมีประสิทธิภาพด้วยโมเดล GGUF แบบ quantized
Apple Silicon ollama เร่งความเร็วด้วย Metal แบบเนทีฟ จัดการโมเดลได้ง่าย
GPU NVIDIA ระดับผู้ใช้ทั่วไป (RTX 3090, 4090 ฯลฯ) ollama ตั้งค่าง่าย ประสิทธิภาพดีสำหรับผู้ใช้คนเดียว
GPU NVIDIA ระดับ datacenter (A100, H100, H200, L40, A10, A30) vllm ให้บริการแบบ batch throughput สูง, continuous batching
GPU AMD vllm รองรับ ROCm ผ่าน vLLM

ตัวอย่าง Configuration

Mac ที่ใช้ Apple Silicon

# ~/.openjarvis/config.toml
# Apple Silicon MacBook Pro (M3 Max, 128 GB unified memory)

[engine]
default = "ollama"

[engine.ollama]
host = "http://localhost:11434"

[intelligence]
default_model = "qwen3:8b"
fallback_model = "llama3.2:3b"
temperature = 0.7
max_tokens = 1024

[agent]
default_agent = "simple"
max_turns = 10
context_from_memory = true

[tools.storage]
default_backend = "sqlite"

[server]
host = "127.0.0.1"
port = 8000
agent = "orchestrator"

[learning]
enabled = false

[learning.routing]
policy = "heuristic"

[telemetry]
enabled = true

GPU ระดับ Datacenter ของ NVIDIA (หลาย GPU)

# ~/.openjarvis/config.toml
# 8x NVIDIA A100 80GB server

[engine]
default = "vllm"

[engine.vllm]
host = "http://localhost:8000"

[engine.ollama]
host = "http://localhost:11434"

[intelligence]
default_model = "Qwen/Qwen2.5-72B-Instruct"
fallback_model = "Qwen/Qwen2.5-7B-Instruct"
temperature = 0.5
max_tokens = 4096

[agent]
default_agent = "orchestrator"
max_turns = 15
tools = "calculator,think,retrieval"
context_from_memory = true

[tools.storage]
default_backend = "faiss"
context_top_k = 10
context_min_score = 0.05
context_max_tokens = 4096
chunk_size = 1024
chunk_overlap = 128

[server]
host = "0.0.0.0"
port = 8000
agent = "orchestrator"
model = "Qwen/Qwen2.5-72B-Instruct"
workers = 1

[learning]
enabled = false

[learning.routing]
policy = "heuristic"

[telemetry]
enabled = true

ใช้ CPU เท่านั้น (ไม่มี GPU)

# ~/.openjarvis/config.toml
# CPU-only machine

[engine]
default = "llamacpp"

[engine.llamacpp]
host = "http://localhost:8080"

[intelligence]
default_model = ""
fallback_model = ""
temperature = 0.7
max_tokens = 512

[agent]
default_agent = "simple"
max_turns = 5
context_from_memory = true

[tools.storage]
default_backend = "sqlite"
context_top_k = 3
context_max_tokens = 1024
chunk_size = 256
chunk_overlap = 32

[server]
host = "127.0.0.1"
port = 8000

[learning]
enabled = false

[learning.routing]
policy = "heuristic"

[telemetry]
enabled = true

เปิดใช้งาน Trace-Driven Learning

# ~/.openjarvis/config.toml
# Research setup with trace-driven learning active

[engine]
default = "ollama"

[engine.ollama]
host = "http://localhost:11434"

[intelligence]
default_model = "qwen3:8b"
temperature = 0.7
max_tokens = 1024

[agent]
default_agent = "orchestrator"
max_turns = 10
context_from_memory = true

[tools.storage]
default_backend = "sqlite"

[learning]
enabled = true
update_interval = 50
auto_update = true

[learning.routing]
policy = "learned"
min_samples = 10

[learning.intelligence]
policy = "sft"

[learning.agent]
policy = "agent_advisor"
advisor_confidence_threshold = 0.8

[learning.metrics]
accuracy_weight = 0.6
latency_weight = 0.2
cost_weight = 0.1
efficiency_weight = 0.1

[traces]
enabled = true

[telemetry]
enabled = true

คู่มือการย้ายเวอร์ชัน (Migration Guide)

หากคุณมี ~/.openjarvis/config.toml เดิมจากเวอร์ชันก่อนหน้า นี่คือสิ่งที่เปลี่ยนไปและวิธีอัปเดต

Engine: หมวดย่อยแบบซ้อน

[engine]
default = "ollama"
ollama_host = "http://localhost:11434"
vllm_host = "http://localhost:8000"
llamacpp_path = "/usr/local/bin/llama-server"
[engine]
default = "ollama"

[engine.ollama]
host = "http://localhost:11434"

[engine.vllm]
host = "http://localhost:8000"

[engine.llamacpp]
binary_path = "/usr/local/bin/llama-server"

Note

ชื่อฟิลด์แบบเรียบเดิมยังคงใช้งานได้ในฐานะ property ที่เข้ากันได้ย้อนหลัง คุณจำเป็นต้องอัปเดต config เฉพาะเมื่อต้องการใช้ฟิลด์ใหม่ (เช่น binary_path)

Intelligence: พารามิเตอร์การ Generate

[agent]
temperature = 0.7
max_tokens = 1024
[intelligence]
temperature = 0.7
max_tokens = 1024

Note

config เก่าที่มี temperature หรือ max_tokens อยู่ใต้ [agent] จะถูกย้ายไปยัง [intelligence] โดยอัตโนมัติตอนโหลด ไม่จำเป็นต้องอัปเดตด้วยตนเอง แต่แนะนำให้อัปเดตเพื่อความชัดเจน

Agent: ฟิลด์ที่เปลี่ยนชื่อและเพิ่มใหม่

[agent]
default_tools = "calculator,think"
[agent]
tools = "calculator,think"

ชื่อ default_tools เดิมยังคงใช้งานได้ผ่าน property ที่เข้ากันได้ย้อนหลัง

Memory: การแทรกบริบทย้ายที่แล้ว

[memory]
context_injection = true
default_backend = "sqlite"
[agent]
context_from_memory = true

[tools.storage]
default_backend = "sqlite"

Note

context_injection ใต้ [memory] หรือ [tools.storage] จะถูกย้ายไปยัง agent.context_from_memory โดยอัตโนมัติตอนโหลด

Learning: หมวดย่อยแบบซ้อน

[learning]
default_policy = "heuristic"
intelligence_policy = "sft"
agent_policy = "agent_advisor"
tools_policy = "icl_updater"
reward_weights = "accuracy=0.6,latency=0.2,cost=0.1,efficiency=0.1"
update_interval = 100
[learning]
enabled = true
update_interval = 100

[learning.routing]
policy = "heuristic"

[learning.intelligence]
policy = "sft"

[learning.agent]
policy = "agent_advisor"

[learning.metrics]
accuracy_weight = 0.6
latency_weight = 0.2
cost_weight = 0.1
efficiency_weight = 0.1

Note

ชื่อฟิลด์แบบเรียบเดิม default_policy, intelligence_policy, agent_policy และ reward_weights ยังคงใช้งานได้ในฐานะ property ที่เข้ากันได้ย้อนหลัง ฟิลด์ tools_policy ถูกลบออกแล้ว ใช้ learning.agent.policy = "icl_updater" แทน


Configuration แบบเชิงโปรแกรม

คุณสามารถตั้งค่า OpenJarvis ทั้งหมดจาก Python ได้โดยไม่ต้องใช้ไฟล์ TOML:

from openjarvis import Jarvis
from openjarvis.core.config import (
    AgentConfig,
    EngineConfig,
    IntelligenceConfig,
    JarvisConfig,
    LearningConfig,
    OllamaEngineConfig,
    StorageConfig,
    ToolsConfig,
)

config = JarvisConfig(
    engine=EngineConfig(
        default="ollama",
        ollama=OllamaEngineConfig(host="http://my-server:11434"),
    ),
    intelligence=IntelligenceConfig(
        default_model="qwen3:8b",
        temperature=0.7,
        max_tokens=2048,
    ),
    agent=AgentConfig(
        default_agent="orchestrator",
        max_turns=15,
        context_from_memory=True,
    ),
    tools=ToolsConfig(
        storage=StorageConfig(
            default_backend="sqlite",
            context_top_k=10,
        ),
    ),
)

j = Jarvis(config=config)
response = j.ask("Hello")
j.close()

หรือโหลดจาก path ที่กำหนดเอง:

j = Jarvis(config_path="/path/to/my-config.toml")

Environment Variables

OpenJarvis จะอ่าน environment variable ต่อไปนี้:

ตัวแปร คำอธิบาย
OPENAI_API_KEY API key สำหรับการอนุมานผ่าน cloud ของ OpenAI จำเป็นสำหรับ engine cloud กับโมเดล OpenAI
ANTHROPIC_API_KEY API key สำหรับการอนุมานผ่าน cloud ของ Anthropic จำเป็นสำหรับ engine cloud กับโมเดล Claude
GOOGLE_API_KEY API key สำหรับการอนุมานของ Google Gemini จำเป็นสำหรับ engine google
MINIMAX_API_KEY API key สำหรับการอนุมานผ่าน cloud ของ MiniMax จำเป็นสำหรับ engine cloud กับโมเดล MiniMax (MiniMax-M2.7, MiniMax-M2.7-highspeed, MiniMax-M2.5, MiniMax-M2.5-highspeed)
TAVILY_API_KEY API key สำหรับ tool ค้นหาเว็บของ Tavily จำเป็นสำหรับ tool web_search

ขั้นตอนถัดไป

  • Quick Start — รันคำถามแรกของคุณ
  • CLI Reference — เอกสารอ้างอิงฉบับเต็มสำหรับคำสั่ง CLI ทั้งหมด
  • Architecture Overview — ทำความเข้าใจว่าแต่ละส่วนประกอบกันอย่างไร
  • Intelligence Primitive — ตัวตนของโมเดลและค่าเริ่มต้นการ generate
  • Learning & Traces — นโยบาย router และ feedback loop ที่ขับเคลื่อนด้วย trace

LLM-guided spec search ใช้โมเดล frontier เพื่อปรับปรุงการตั้งค่าเอเจนต์ในเครื่องของคุณโดยอัตโนมัติ ดู คู่มือผู้ใช้ สำหรับคำอธิบายแบบครบถ้วน

คีย์ ชนิด ค่าเริ่มต้น คำอธิบาย
enabled bool true เปิด/ปิดระบบย่อย spec-search ทั้งหมด
autonomy_mode string "tiered" auto, tiered หรือ manual
teacher_model string "claude-opus-4-6" โมเดล frontier สำหรับการวินิจฉัยและวางแผน
max_cost_per_session_usd float 5.0 งบประมาณ teacher API ต่อ session
max_tool_calls_per_diagnosis int 30 จำนวนการเรียก tool ของ teacher สูงสุดในขั้นตอนวินิจฉัย

[learning.spec_search.triggers]

คีย์ ชนิด ค่าเริ่มต้น คำอธิบาย
scheduled_enabled bool true เปิดใช้งาน session ตามตารางเวลารายวัน
scheduled_cron string "0 3 * * *" นิพจน์ cron สำหรับ trigger ตามตารางเวลา
scheduled_min_new_traces int 20 จำนวน trace ใหม่ขั้นต่ำที่จะ trigger
cluster_enabled bool true เปิดใช้งาน trigger จากกลุ่มความล้มเหลว (failure cluster)
cluster_check_interval_minutes int 60 ความถี่ในการตรวจสอบหากลุ่ม
cluster_min_size int 5 จำนวน trace ขั้นต่ำในหนึ่งกลุ่ม
cluster_failure_threshold float 0.3 Feedback ที่ <= ค่านี้ นับเป็นความล้มเหลว

[learning.spec_search.gate]

คีย์ ชนิด ค่าเริ่มต้น คำอธิบาย
min_improvement float 0.0 คะแนนที่ดีขึ้นขั้นต่ำโดยรวมที่จะยอมรับ
max_regression float 0.05 คะแนนที่แย่ลงสูงสุดต่อกลุ่ม ก่อนจะถูกปฏิเสธ
benchmark_subsample_size int 50 จำนวนงานต่อการรัน gate หนึ่งครั้ง
full_benchmark bool false ปิดการ subsampling (ช้ากว่า แต่แม่นยำกว่า)

[learning.spec_search.benchmark]

คีย์ ชนิด ค่าเริ่มต้น คำอธิบาย
synthesis_feedback_threshold float 0.7 Feedback ขั้นต่ำสำหรับ trace ที่จะใช้ทำ benchmark
max_benchmark_size int 200 จำนวนงานสูงสุดใน benchmark
auto_refresh bool true ขุดหา trace ที่มี feedback สูงใหม่ๆ โดยอัตโนมัติ
max_synthesis_cost_usd_per_refresh float 2.0 เพดานต้นทุนต่อการ refresh benchmark หนึ่งครั้ง

[learning.spec_search.tier_overrides]

Override ระดับความเสี่ยงเริ่มต้นสำหรับ operation ใดๆ คีย์คือชื่อ operation ค่าคือสตริงระดับ (auto, review, manual)

[learning.spec_search.tier_overrides]
# patch_system_prompt = "auto"     # promote to auto after trust
# replace_system_prompt = "auto"