Loading...
Loading...
Personal AI assistant framework supporting multiple chat channels (DingTalk, Feishu, QQ, Discord, etc.) with extensible skills, local/cloud deployment, and cron scheduling.
npx skill4agent add aradotso/trending-skills copaw-ai-assistantSkill by ara.so — Daily 2026 Skills collection.
http://127.0.0.1:8088/pip install copaw
copaw init --defaults # non-interactive setup with sensible defaults
copaw app # starts the web Console + backendcurl -fsSL https://copaw.agentscope.io/install.sh | bash
# With Ollama support:
curl -fsSL https://copaw.agentscope.io/install.sh | bash -s -- --extras ollama
# Multiple extras:
curl -fsSL https://copaw.agentscope.io/install.sh | bash -s -- --extras ollama,llamacppcurl -fsSL https://copaw.agentscope.io/install.bat -o install.bat && install.batirm https://copaw.agentscope.io/install.ps1 | iexcopaw init --defaults
copaw appgit clone https://github.com/agentscope-ai/CoPaw.git
cd CoPaw
pip install -e ".[dev]"
copaw init --defaults
copaw appcopaw init # interactive workspace setup
copaw init --defaults # non-interactive setup
copaw app # start the Console (http://127.0.0.1:8088/)
copaw app --port 8090 # use a custom port
copaw --help # list all commandscopaw init~/.copaw/workspace/~/.copaw/workspace/
├── config.yaml # agent, provider, channel configuration
├── skills/ # custom skill files (auto-loaded)
│ └── my_skill.py
├── memory/ # conversation memory storage
└── logs/ # runtime logsconfig.yamlcopaw initproviders:
- id: openai-main
type: openai
api_key: ${OPENAI_API_KEY} # use env var reference
model: gpt-4o
base_url: https://api.openai.com/v1
- id: local-ollama
type: ollama
model: llama3.2
base_url: http://localhost:11434agent:
name: CoPaw
language: en # en, zh, ja, etc.
provider_id: openai-main
context_limit: 8000channels:
- type: dingtalk
app_key: ${DINGTALK_APP_KEY}
app_secret: ${DINGTALK_APP_SECRET}
agent_id: ${DINGTALK_AGENT_ID}
mention_only: true # only respond when @mentioned in groupschannels:
- type: feishu
app_id: ${FEISHU_APP_ID}
app_secret: ${FEISHU_APP_SECRET}
mention_only: falsechannels:
- type: discord
token: ${DISCORD_BOT_TOKEN}
mention_only: truechannels:
- type: telegram
token: ${TELEGRAM_BOT_TOKEN}channels:
- type: qq
uin: ${QQ_UIN}
password: ${QQ_PASSWORD}channels:
- type: mattermost
url: ${MATTERMOST_URL}
token: ${MATTERMOST_TOKEN}
team: my-teamchannels:
- type: matrix
homeserver: ${MATRIX_HOMESERVER}
user_id: ${MATRIX_USER_ID}
access_token: ${MATRIX_ACCESS_TOKEN}~/.copaw/workspace/skills/# ~/.copaw/workspace/skills/weather.py
SKILL_NAME = "get_weather"
SKILL_DESCRIPTION = "Get current weather for a city"
# Tool schema (OpenAI function-calling format)
SKILL_SCHEMA = {
"type": "function",
"function": {
"name": SKILL_NAME,
"description": SKILL_DESCRIPTION,
"parameters": {
"type": "object",
"properties": {
"city": {
"type": "string",
"description": "City name, e.g. 'Tokyo'"
}
},
"required": ["city"]
}
}
}
def get_weather(city: str) -> str:
"""Fetch weather data for the given city."""
import os
import requests
api_key = os.environ["OPENWEATHER_API_KEY"]
url = f"https://api.openweathermap.org/data/2.5/weather"
resp = requests.get(url, params={"q": city, "appid": api_key, "units": "metric"})
resp.raise_for_status()
data = resp.json()
temp = data["main"]["temp"]
desc = data["weather"][0]["description"]
return f"{city}: {temp}°C, {desc}"# ~/.copaw/workspace/skills/summarize_url.py
SKILL_NAME = "summarize_url"
SKILL_DESCRIPTION = "Fetch and summarize the content of a URL"
SKILL_SCHEMA = {
"type": "function",
"function": {
"name": SKILL_NAME,
"description": SKILL_DESCRIPTION,
"parameters": {
"type": "object",
"properties": {
"url": {"type": "string", "description": "The URL to summarize"}
},
"required": ["url"]
}
}
}
async def summarize_url(url: str) -> str:
import httpx
async with httpx.AsyncClient(timeout=15) as client:
resp = await client.get(url)
text = resp.text[:4000] # truncate for context limit
return f"Content preview from {url}:\n{text}"# ~/.copaw/workspace/skills/list_files.py
import os
import json
SKILL_NAME = "list_files"
SKILL_DESCRIPTION = "List files in a directory"
SKILL_SCHEMA = {
"type": "function",
"function": {
"name": SKILL_NAME,
"description": SKILL_DESCRIPTION,
"parameters": {
"type": "object",
"properties": {
"path": {
"type": "string",
"description": "Absolute or relative directory path"
},
"extension": {
"type": "string",
"description": "Filter by extension, e.g. '.py'. Optional."
}
},
"required": ["path"]
}
}
}
def list_files(path: str, extension: str = "") -> str:
entries = os.listdir(os.path.expanduser(path))
if extension:
entries = [e for e in entries if e.endswith(extension)]
return json.dumps(sorted(entries))config.yamlcron:
- id: daily-digest
schedule: "0 8 * * *" # every day at 08:00
skill: get_weather
skill_args:
city: "Tokyo"
channel_id: dingtalk-main # matches a channel id below
message_template: "Good morning! Today's weather: {result}"
- id: hourly-news
schedule: "0 * * * *"
skill: fetch_tech_news
channel_id: discord-main# Install Ollama: https://ollama.ai
ollama pull llama3.2
ollama serve # starts on http://localhost:11434# config.yaml
providers:
- id: ollama-local
type: ollama
model: llama3.2
base_url: http://localhost:11434providers:
- id: lmstudio-local
type: lmstudio
model: lmstudio-community/Meta-Llama-3-8B-Instruct-GGUF
base_url: http://localhost:1234/v1pip install "copaw[llamacpp]"providers:
- id: llamacpp-local
type: llamacpp
model_path: /path/to/model.ggufconfig.yamlagent:
tool_guard:
enabled: true
risk_patterns:
- "rm -rf"
- "DROP TABLE"
- "os.system"
auto_approve_low_risk: true# In a skill or debug script
from copaw.telemetry import get_usage_summary
summary = get_usage_summary()
print(summary)
# {'total_tokens': 142300, 'prompt_tokens': 98200, 'completion_tokens': 44100, 'by_provider': {...}}copaw appconfig.yaml${VAR_NAME}# LLM providers
export OPENAI_API_KEY=...
export ANTHROPIC_API_KEY=...
# Channels
export DINGTALK_APP_KEY=...
export DINGTALK_APP_SECRET=...
export DINGTALK_AGENT_ID=...
export FEISHU_APP_ID=...
export FEISHU_APP_SECRET=...
export DISCORD_BOT_TOKEN=...
export TELEGRAM_BOT_TOKEN=...
export QQ_UIN=...
export QQ_PASSWORD=...
export MATTERMOST_URL=...
export MATTERMOST_TOKEN=...
export MATRIX_HOMESERVER=...
export MATRIX_USER_ID=...
export MATRIX_ACCESS_TOKEN=...
# Custom skill secrets
export OPENWEATHER_API_KEY=...# config.yaml excerpt
channels:
- id: dingtalk-main
type: dingtalk
app_key: ${DINGTALK_APP_KEY}
app_secret: ${DINGTALK_APP_SECRET}
agent_id: ${DINGTALK_AGENT_ID}
cron:
- id: morning-brief
schedule: "30 7 * * 1-5" # weekdays 07:30
skill: daily_briefing
channel_id: dingtalk-main# skills/daily_briefing.py
SKILL_NAME = "daily_briefing"
SKILL_DESCRIPTION = "Compile a morning briefing with weather and news"
SKILL_SCHEMA = {
"type": "function",
"function": {
"name": SKILL_NAME,
"description": SKILL_DESCRIPTION,
"parameters": {"type": "object", "properties": {}, "required": []}
}
}
def daily_briefing() -> str:
import os, requests, datetime
today = datetime.date.today().strftime("%A, %B %d")
# Add your own data sources here
return f"Good morning! Today is {today}. Have a productive day!"# skills/broadcast.py
SKILL_NAME = "broadcast_message"
SKILL_DESCRIPTION = "Send a message to all configured channels"
SKILL_SCHEMA = {
"type": "function",
"function": {
"name": SKILL_NAME,
"description": SKILL_DESCRIPTION,
"parameters": {
"type": "object",
"properties": {
"message": {"type": "string", "description": "Message to broadcast"}
},
"required": ["message"]
}
}
}
def broadcast_message(message: str) -> str:
# CoPaw handles routing; return the message and let the agent deliver it
return f"[BROADCAST] {message}"# skills/summarize_file.py
SKILL_NAME = "summarize_file"
SKILL_DESCRIPTION = "Read and summarize a local file"
SKILL_SCHEMA = {
"type": "function",
"function": {
"name": SKILL_NAME,
"description": SKILL_DESCRIPTION,
"parameters": {
"type": "object",
"properties": {
"file_path": {"type": "string", "description": "Absolute path to the file"}
},
"required": ["file_path"]
}
}
}
def summarize_file(file_path: str) -> str:
import os
path = os.path.expanduser(file_path)
if not os.path.exists(path):
return f"File not found: {path}"
with open(path, "r", encoding="utf-8", errors="ignore") as f:
content = f.read(8000)
return f"File: {path}\nSize: {os.path.getsize(path)} bytes\nContent preview:\n{content}"# Use a different port
copaw app --port 8090
# Check if another process is using 8088
lsof -i :8088 # macOS/Linux
netstat -ano | findstr :8088 # Windows~/.copaw/workspace/skills/SKILL_NAMESKILL_DESCRIPTIONSKILL_SCHEMA~/.copaw/workspace/logs/copaw appconfig.yamlmention_only: trueSend Messages# Test provider from CLI (Console → Providers → Test Connection)
# Or check logs:
tail -f ~/.copaw/workspace/logs/copaw.logollama servebase_urlbase_url/v1# Set UTF-8 encoding for CMD
chcp 65001export PYTHONIOENCODING=utf-8# Reinitialize workspace (preserves skills/)
copaw init
# Full reset (destructive)
rm -rf ~/.copaw/workspace
copaw init --defaults