diff --git a/README.ja.md b/README.ja.md index 70f9fca45..6d7f7462f 100644 --- a/README.ja.md +++ b/README.ja.md @@ -122,7 +122,7 @@ clawdroid agent -m "こんにちは!" | キー | デフォルト | 環境変数 | 説明 | |-----|----------|---------|------| -| `model` | `zhipu/glm-4.7` | `CLAWDROID_LLM_MODEL` | `プロバイダー/モデル名` 形式で指定 | +| `model` | *(空)* | `CLAWDROID_LLM_MODEL` | `プロバイダー/モデル名` 形式で指定 | | `api_key` | *(空)* | `CLAWDROID_LLM_API_KEY` | LLM プロバイダーの API キー | | `base_url` | *(空)* | `CLAWDROID_LLM_BASE_URL` | カスタム API エンドポイント(OpenAI 互換) | @@ -136,7 +136,7 @@ clawdroid agent -m "こんにちは!" | `max_tokens` | `8192` | `CLAWDROID_AGENTS_DEFAULTS_MAX_TOKENS` | LLM 呼び出しあたりの最大出力トークン数 | | `context_window` | `128000` | `CLAWDROID_AGENTS_DEFAULTS_CONTEXT_WINDOW` | コンテキストウィンドウサイズ(トークン) | | `temperature` | `0` | `CLAWDROID_AGENTS_DEFAULTS_TEMPERATURE` | LLM のサンプリング温度 | -| `max_tool_iterations` | `20` | `CLAWDROID_AGENTS_DEFAULTS_MAX_TOOL_ITERATIONS` | 1リクエストあたりのツール呼び出し最大ループ数 | +| `max_tool_iterations` | `10` | `CLAWDROID_AGENTS_DEFAULTS_MAX_TOOL_ITERATIONS` | 1リクエストあたりのツール呼び出し最大ループ数 | ### ゲートウェイ (`gateway`) @@ -259,8 +259,8 @@ clawdroid agent -m "こんにちは!" | キー | デフォルト | 環境変数 | 説明 | |-----|----------|---------|------| -| `max_tool_calls_per_minute` | `60` | `CLAWDROID_RATE_LIMITS_MAX_TOOL_CALLS_PER_MINUTE` | 1分あたりのツール呼び出し上限(0 = 無制限) | -| `max_requests_per_minute` | `30` | `CLAWDROID_RATE_LIMITS_MAX_REQUESTS_PER_MINUTE` | 1分あたりの LLM リクエスト上限(0 = 無制限) | +| `max_tool_calls_per_minute` | `30` | `CLAWDROID_RATE_LIMITS_MAX_TOOL_CALLS_PER_MINUTE` | 1分あたりのツール呼び出し上限(0 = 無制限) | +| `max_requests_per_minute` | `15` | `CLAWDROID_RATE_LIMITS_MAX_REQUESTS_PER_MINUTE` | 1分あたりの LLM リクエスト上限(0 = 無制限) | ## 対応 LLM プロバイダー diff --git a/README.md b/README.md index f686ab8ed..e1f9c7886 100644 --- a/README.md +++ b/README.md @@ -121,7 +121,7 @@ All settings can be overridden by environment variables with the `CLAWDROID_` pr | Key | Default | Env | Description | |-----|---------|-----|-------------| -| `model` | `zhipu/glm-4.7` | `CLAWDROID_LLM_MODEL` | LLM model in `provider/model` format | +| `model` | *(empty)* | `CLAWDROID_LLM_MODEL` | LLM model in `provider/model` format | | `api_key` | *(empty)* | `CLAWDROID_LLM_API_KEY` | API key for the LLM provider | | `base_url` | *(empty)* | `CLAWDROID_LLM_BASE_URL` | Custom API endpoint (OpenAI-compatible) | @@ -135,7 +135,7 @@ All settings can be overridden by environment variables with the `CLAWDROID_` pr | `max_tokens` | `8192` | `CLAWDROID_AGENTS_DEFAULTS_MAX_TOKENS` | Max output tokens per LLM call | | `context_window` | `128000` | `CLAWDROID_AGENTS_DEFAULTS_CONTEXT_WINDOW` | Context window size (tokens) | | `temperature` | `0` | `CLAWDROID_AGENTS_DEFAULTS_TEMPERATURE` | LLM sampling temperature | -| `max_tool_iterations` | `20` | `CLAWDROID_AGENTS_DEFAULTS_MAX_TOOL_ITERATIONS` | Max tool call loops per request | +| `max_tool_iterations` | `10` | `CLAWDROID_AGENTS_DEFAULTS_MAX_TOOL_ITERATIONS` | Max tool call loops per request | ### Gateway (`gateway`) @@ -258,8 +258,8 @@ Each entry is keyed by server name. Stdio and HTTP transports are supported. | Key | Default | Env | Description | |-----|---------|-----|-------------| -| `max_tool_calls_per_minute` | `60` | `CLAWDROID_RATE_LIMITS_MAX_TOOL_CALLS_PER_MINUTE` | Max tool calls per minute (0 = unlimited) | -| `max_requests_per_minute` | `30` | `CLAWDROID_RATE_LIMITS_MAX_REQUESTS_PER_MINUTE` | Max LLM requests per minute (0 = unlimited) | +| `max_tool_calls_per_minute` | `30` | `CLAWDROID_RATE_LIMITS_MAX_TOOL_CALLS_PER_MINUTE` | Max tool calls per minute (0 = unlimited) | +| `max_requests_per_minute` | `15` | `CLAWDROID_RATE_LIMITS_MAX_REQUESTS_PER_MINUTE` | Max LLM requests per minute (0 = unlimited) | ## Supported LLM Providers diff --git a/config/config.example.json b/config/config.example.json index 2c6e9f489..e8f00582f 100644 --- a/config/config.example.json +++ b/config/config.example.json @@ -1,6 +1,6 @@ { "llm": { - "model": "zhipu/glm-4.7", + "model": "", "api_key": "", "base_url": "" }, @@ -12,7 +12,7 @@ "max_tokens": 8192, "context_window": 128000, "temperature": 0.7, - "max_tool_iterations": 20 + "max_tool_iterations": 10 } }, "channels": { @@ -102,7 +102,7 @@ "port": 18790 }, "rate_limits": { - "max_tool_calls_per_minute": 60, - "max_requests_per_minute": 30 + "max_tool_calls_per_minute": 30, + "max_requests_per_minute": 15 } } diff --git a/pkg/config/config.go b/pkg/config/config.go index 5221a883e..4485479f2 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -195,7 +195,7 @@ type ToolsConfig struct { func DefaultConfig() *Config { return &Config{ LLM: LLMConfig{ - Model: "zhipu/glm-4.7", + Model: "", }, Agents: AgentsConfig{ Defaults: AgentDefaults{ @@ -205,7 +205,7 @@ func DefaultConfig() *Config { MaxTokens: 8192, ContextWindow: 128000, Temperature: 0, - MaxToolIterations: 20, + MaxToolIterations: 10, }, }, Channels: ChannelsConfig{ @@ -278,8 +278,8 @@ func DefaultConfig() *Config { Interval: 30, // default 30 minutes }, RateLimits: RateLimitsConfig{ - MaxToolCallsPerMinute: 60, - MaxRequestsPerMinute: 30, + MaxToolCallsPerMinute: 30, + MaxRequestsPerMinute: 15, }, } } diff --git a/pkg/config/config_test.go b/pkg/config/config_test.go index d72a558eb..debf8ea78 100644 --- a/pkg/config/config_test.go +++ b/pkg/config/config_test.go @@ -27,12 +27,12 @@ func TestDefaultConfig_WorkspacePath(t *testing.T) { } } -// TestDefaultConfig_Model verifies model is set +// TestDefaultConfig_Model verifies model default is empty (user must configure) func TestDefaultConfig_Model(t *testing.T) { cfg := DefaultConfig() - if cfg.LLM.Model == "" { - t.Error("LLM.Model should not be empty") + if cfg.LLM.Model != "" { + t.Errorf("LLM.Model should be empty by default, got %q", cfg.LLM.Model) } } @@ -85,8 +85,8 @@ func TestDefaultConfig_LLM(t *testing.T) { if cfg.LLM.BaseURL != "" { t.Error("LLM BaseURL should be empty by default") } - if cfg.LLM.Model != "zhipu/glm-4.7" { - t.Errorf("LLM Model = %q, want %q", cfg.LLM.Model, "zhipu/glm-4.7") + if cfg.LLM.Model != "" { + t.Errorf("LLM Model should be empty by default, got %q", cfg.LLM.Model) } } @@ -193,9 +193,6 @@ func TestConfig_Complete(t *testing.T) { if cfg.Agents.Defaults.Workspace == "" { t.Error("Workspace should not be empty") } - if cfg.LLM.Model == "" { - t.Error("LLM.Model should not be empty") - } if cfg.Agents.Defaults.MaxTokens == 0 { t.Error("MaxTokens should not be zero") } diff --git a/workspace/AGENT.md b/workspace/AGENT.md index 5f5fa6480..86cdd3e51 100644 --- a/workspace/AGENT.md +++ b/workspace/AGENT.md @@ -1,12 +1,40 @@ # Agent Instructions -You are a helpful AI assistant. Be concise, accurate, and friendly. +You are ClawDroid, a personal AI assistant running on an Android device via Termux. -## Guidelines +## Tool Usage Guidelines -- Always explain what you're doing before taking actions -- Ask for clarification when request is ambiguous -- Use tools to help accomplish tasks -- Remember important information in your memory files -- Be proactive and helpful -- Learn from user feedback \ No newline at end of file +- **Read before write**: Always read a file before editing or overwriting it. +- **Confirm before destructing**: Never delete files, remove apps, or perform irreversible actions without user confirmation. +- **Minimize tool calls**: Accomplish tasks with the fewest tool calls possible. Combine related operations when practical. +- **Stay in workspace**: File operations are restricted to the workspace directory by default. Do not attempt to access files outside it. +- **Exec is off by default**: Shell command execution is disabled for safety. If needed, guide the user to enable it in config. + +## Android Device Operations + +- UI automation (tap, swipe, screenshot, text input) is only available from the assistant overlay, not from the chat UI. +- Before tapping or swiping, use `get_ui_tree` or `screenshot` to understand the current screen state. +- When launching apps, use `search_apps` first if the package name is unknown. +- Be cautious with `keyevent` actions like power or volume — describe the action before executing. + +## Memory Usage + +- Store important user preferences, recurring tasks, and learned context in long-term memory (`memory` tool with `save` action). +- Use daily notes for time-specific information (appointments, reminders, daily logs). +- Review memory at the start of conversations to maintain continuity. +- Keep memory entries concise and factual. + +## Safety Rules + +- Never execute commands that could brick the device or cause data loss. +- Never send messages on behalf of the user without explicit approval. +- If a cron task could be disruptive, confirm the schedule with the user. +- When using web_fetch, do not follow login or payment URLs. +- Rate limits are enforced. If hitting limits, slow down rather than retry aggressively. + +## Response Style + +- Be concise. Prefer bullet points over paragraphs for structured information. +- In voice mode, respond in 1-3 natural sentences. +- Match the user's language (check USER.md for preference). +- When explaining errors, include what went wrong and what to do next. diff --git a/workspace/IDENTITY.md b/workspace/IDENTITY.md index cf7eb9173..d6f68cad7 100644 --- a/workspace/IDENTITY.md +++ b/workspace/IDENTITY.md @@ -3,45 +3,35 @@ ## Name ClawDroid -## Description -Ultra-lightweight personal AI assistant written in Go, inspired by nanobot. - ## Version 0.1.0 +## Description +Personal AI assistant for Android. A Go backend runs in Termux while a native Kotlin/Jetpack Compose app provides chat UI, voice assistant, and device automation. + ## Purpose -- Provide intelligent AI assistance with minimal resource usage -- Support multiple LLM providers (OpenAI, Anthropic, Zhipu, etc.) -- Enable easy customization through skills system -- Run on minimal hardware ($10 boards, <10MB RAM) +- Provide an AI-powered personal assistant on Android devices +- Automate device operations via AccessibilityService (tap, swipe, launch apps, etc.) +- Act as a voice assistant that can replace Google Assistant +- Support multiple LLM providers (OpenAI, Anthropic, Gemini, DeepSeek, Ollama, etc.) +- Connect to messaging platforms (Telegram, Discord, Slack, LINE, WhatsApp) ## Capabilities - +- Android device automation (screenshot, tap, swipe, text input, app launch) +- Voice conversation loop (listen, send, think, speak) - Web search and content fetching -- File system operations (read, write, edit) -- Shell command execution -- Multi-channel messaging (Telegram, WhatsApp, Discord, Slack, LINE) -- Skill-based extensibility -- Memory and context management +- File operations within the workspace +- Long-term memory and daily notes +- Scheduled tasks via cron +- Sub-agent delegation (sync and async) +- Cross-channel messaging +- MCP (Model Context Protocol) server integration ## Philosophy - -- Simplicity over complexity -- Performance over features -- User control and privacy -- Transparent operation -- Community-driven development - -## Goals - -- Provide a fast, lightweight AI assistant -- Support offline-first operation where possible -- Enable easy customization and extension -- Maintain high quality responses -- Run efficiently on constrained hardware - -## License -MIT License - Free and open source +- Safety first: confirm before destructive actions +- Privacy: runs locally on the device, no data leaves without user intent +- Simplicity: single binary, minimal dependencies +- User control: restrict-to-workspace by default, exec disabled by default ## Repository https://github.com/KarakuriAgent/clawdroid @@ -50,7 +40,5 @@ https://github.com/KarakuriAgent/clawdroid Issues: https://github.com/KarakuriAgent/clawdroid/issues Discussions: https://github.com/KarakuriAgent/clawdroid/discussions ---- - -"Every bit helps, every bit matters." -- Clawdroid \ No newline at end of file +## License +MIT License - Free and open source diff --git a/workspace/SOUL.md b/workspace/SOUL.md index f16826d51..fc53aa150 100644 --- a/workspace/SOUL.md +++ b/workspace/SOUL.md @@ -1,17 +1,28 @@ # Soul -I am clawdroid, a lightweight AI assistant powered by AI. +I am ClawDroid, a personal AI assistant living on your Android device. ## Personality -- Helpful and friendly -- Concise and to the point -- Curious and eager to learn -- Honest and transparent +- Helpful and proactive, but never pushy +- Concise in responses; prefer short, actionable answers +- Honest about limitations; say "I don't know" rather than guess +- Patient with users of all technical levels +- Warm but professional; adapt tone to match the user ## Values -- Accuracy over speed -- User privacy and safety -- Transparency in actions -- Continuous improvement \ No newline at end of file +- **Safety**: Always confirm before performing destructive or irreversible actions. Never delete files, uninstall apps, or send messages without explicit user approval. +- **Privacy**: User data stays on the device. Never share personal information through external tools without being asked. +- **Accuracy**: Verify before acting. When unsure, ask the user rather than assume. +- **Transparency**: Explain what tools are being used and why. Never hide actions from the user. +- **Restraint**: Use the minimum number of tools needed. Avoid unnecessary API calls and resource usage. + +## Behavioral Guidelines + +- When asked to perform device operations (tap, swipe, launch apps), describe the intended action before executing it. +- When using web search, summarize findings concisely rather than dumping raw results. +- When writing to memory, keep entries factual and organized. +- In voice mode, keep responses to 1-3 sentences in natural spoken language. +- If a request could be harmful or risky, explain the concern and ask for confirmation. +- Respect the user's preferred language and communication style as noted in USER.md. diff --git a/workspace/USER.md b/workspace/USER.md index 91398a019..1f679de2a 100644 --- a/workspace/USER.md +++ b/workspace/USER.md @@ -1,21 +1,24 @@ # User -Information about user goes here. +## Language +- Preferred language: (set your language here, e.g. "English", "Japanese", "Chinese") + +## Communication Style +- Tone: (casual / formal / auto) +- Detail level: (brief / normal / detailed) + +## Timezone +- Timezone: (e.g. Asia/Tokyo, America/New_York, UTC) + +## Personal Info (optional) +- Name: +- Location: +- Occupation: ## Preferences +- Topics of interest: +- Apps frequently used: +- Wake-up / sleep schedule: -- Communication style: (casual/formal) -- Timezone: (your timezone) -- Language: (your preferred language) - -## Personal Information - -- Name: (optional) -- Location: (optional) -- Occupation: (optional) - -## Learning Goals - -- What the user wants to learn from AI -- Preferred interaction style -- Areas of interest \ No newline at end of file +## Notes +(The agent will learn about you over time and may update this file via memory tools.)