
kevin0x5/langdriver
Productivity workflowこのページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る
A minimalist agent in ~500 lines of Ruby: ReAct loop + macOS Seatbelt sandbox + security approvals + MCP + Skills + persistent memory
概要
LangDriver is a lightweight Agent runtime implemented in under 500 lines of Ruby, with ReAct, context compaction, persistent memory, Skills, MCP, Hooks, sandboxing, and permission approvals. Requires macOS and Ruby 3.0+ (uses Reline shipped with Ruby 3). The default config is already tuned for DeepSeek: - : use deepseek-v4-pro or deepseek-v4-flash. The compatibility names deepseek-chat / deepseek-reasoner will be retired on . - : DeepSeek v4 provides a 1M context window without an extra request field. Other providers may use different limits and field names; follow that provider's API documentation instead of copying DeepSeek values. - : declared via top-level reasoning_effort and thinking fields. LangDriver pipes the entire runtime.extra block into the request body verbatim. - : LangDriver uses the Chat Completions message/tool shape, but provider-specific models, fields, streaming details, and authentication may still require configuration or code changes.
README
以下は原文 README の抜粋です。原文を見る。
LangDriver
LangDriver is a lightweight Agent runtime implemented in under 500 lines of Ruby, with ReAct, context compaction, persistent memory, Skills, MCP, Hooks, sandboxing, and permission approvals.
Install
Requires macOS and Ruby 3.0+ (uses Reline shipped with Ruby 3).
git clone https://github.com/kevin0x5/langdriver && cd langdriver
ruby --version # expect ruby 3.0+
Configure
1. API key
export DEEPSEEK_API_KEY="YOUR_DEEPSEEK_API_KEY"
2. langdriver.yaml
The default config is already tuned for DeepSeek:
runtime:
model: deepseek-v4-pro # or deepseek-v4-flash (cheaper / faster)
compact_model: deepseek-v4-flash # used for async chat compaction; falls back to model
api_base: https://api.deepseek.com # DeepSeek endpoint; other providers may require request-field changes
api_key_env: DEEPSEEK_API_KEY
max_steps: 50
extra: # forwarded verbatim into chat/completions request body
max_tokens: 384000 # DeepSeek v4 single-call max output
reasoning_effort: max # recommended for complex agent tasks
thinking: { type: enabled } # chain-of-thought (DeepSeek-V3.2+ supports tool calls in thinking mode)
Notes:
- Model names: use
deepseek-v4-proordeepseek-v4-flash. The compatibility namesdeepseek-chat/deepseek-reasonerwill be retired on July 24, 2026. - Context limits: DeepSeek v4 provides a 1M context window without an extra request field. Other providers may use different limits and field names; follow that provider’s API documentation instead of copying DeepSeek values.
- Max thinking effort: declared via top-level
reasoning_effortandthinkingfields. LangDriver pipes the entireruntime.extrablock into the request body verbatim. - Switch provider: LangDriver uses the Chat Completions message/tool shape, but provider-specific models, fields, streaming details, and authentication may still require configuration or code changes. Remove unsupported DeepSeek-only fields such as
thinkingwhen appropriate.
3. Other declarative files (project root)
| File | Purpose |
|---|---|
profile.md |
Assistant persona / tone (system prompt) |
prompts.yaml |
Tunable prompt templates (system_suffix, compact) — delete to use built-in defaults |
memory.md |
Long-term project facts; auto-injected into system prompt |
summaries.md |
Auto-appended summaries (one block per 50 turns) |
skills.yaml |
Per-skill enable / trust / priority |
tools.yaml |
Permission ceiling for built-in file tools, external Skills, and the optional shell |
hooks.yaml |
after_user_prompt / after_tool_use reminder text |
mcp.yaml |
MCP server connections |
First run
ruby langdriver.rb
In the REPL:
> read sample.txt and summarize it in one sentence
推奨ツール
別のキーワードを試すか、フィルタを外してください。
インストール
npx skillfish add kevin0x5/langdriver