Skip to content

jim60105/AIr-Friends

Repository files navigation

AIr-Friends

preview image

codecov Build Status Release License Container Image

Your AIr friends custom chatbot with integrated shell and skills. Powered by ACP AI agents, it remembers conversations across channels while keeping your data organized in isolated workspaces.

✨ Highlights

  • πŸ€– Multi-Platform: Currently works on Discord and Misskey
  • 🧠 Persistent Memory: Remembers conversations across different channels
  • πŸ—œοΈ Memory Maintenance: Optional scheduled agent task to summarize and compact old memories
  • ⏰ Scheduled Reminders: Users can set one-time reminders via DM, delivered at the specified time
  • πŸ“ Agent Knowledge Base: Personal workspace for long-term knowledge notes and reflections
  • πŸ”’ Privacy First: Isolated workspaces per user with access control
  • πŸ’Ύ Git Backup: Automatic versioned backup of memories and notes to GitHub
  • 🐳 Easy Deploy: One-command container deployment
  • 🎨 Customizable: Template-based personality prompt system
  • πŸ”Œ Extensible: Skill-based architecture with external skill auto-installation

πŸš€ Quick Start

The recommended way to run AIr-Friends is by using containers:

  1. Prepare .env file

    # Download example file
    wget https://raw.githubusercontent.com/jim60105/AIr-Friends/master/.env.example -O .env
    
    # Edit with your credentials
    vim .env
  2. Run with Podman (or Docker)

    podman run -d --rm \
      -v data:/app/data \
      --env-file .env \
      --name air-friends \
      ghcr.io/jim60105/air-friends:latest
  3. Or use Compose

    wget https://raw.githubusercontent.com/jim60105/AIr-Friends/master/compose.yml
    podman compose up -d

That's it! Your bot should now be online.

🎨 Customizing Your Bot

Change the personality of your bot!

Override individual character prompt files β€” only the files you mount will be replaced; others keep their container defaults.

With Compose (recommended β€” see compose.yml):

volumes:
  - data:/app/data:Z
  # Mount only the prompt files you want to override
  - ./prompts/character_name.md:/app/prompts/character_name.md:ro,Z
  - ./prompts/character_info.md:/app/prompts/character_info.md:ro,Z
  - ./prompts/character_personality.md:/app/prompts/character_personality.md:ro,Z
  - ./prompts/character_speaking_style.md:/app/prompts/character_speaking_style.md:ro,Z
  - ./prompts/character_reference_terms.md:/app/prompts/character_reference_terms.md:ro,Z

With Podman/Docker run:

podman run -d --rm \
  -v data:/app/data \
  -v ./prompts/character_name.md:/app/prompts/character_name.md:ro \
  -v ./prompts/character_info.md:/app/prompts/character_info.md:ro \
  --env-file .env \
  --name air-friends \
  ghcr.io/jim60105/air-friends:latest

With Helm (see helm/ chart):

# values.yaml
prompts:
  enabled: true
  files:
    character_name.md: |
      Yuna
    character_info.md: |
      An AI assistant

See Development Guide -- Customizing the Bot section for details.

πŸ” Reply Policy

Control who can interact with your bot using the channels-based reply policy:

replyPolicy: "channels" # Options: all, public, channels
channels:
  - id: "discord/account/123456789012345678"
    enabled: true
    spontaneousPost: false
    channelLurk: false
    rateLimitBypass: true
    yolo: true
  - id: "misskey/account/abcdef1234567890"
    enabled: true
    spontaneousPost: false
    channelLurk: false
    rateLimitBypass: false
    yolo: false
  - id: "discord/channel/873618490202931231"
    enabled: true
    spontaneousPost: true
    channelLurk: true
    yolo: false

See Development Guide -- Access Control & Reply Policy section for details.

πŸ›‘οΈ Rate Limiting

Prevent excessive API usage per user with configurable rate limiting:

rateLimit:
  enabled: false
  maxRequestsPerWindow: 10
  windowMs: 600000    # 10-minute sliding window
  cooldownMs: 600000  # Cooldown after limit exceeded

⏰ Scheduled Reminders

Allow users to set one-time reminders via DM. The bot delivers them at the scheduled time:

reminders:
  enabled: false
  maxRemindersPerUser: 20      # Max active reminders per user
  minIntervalMs: 60000         # Minimum delay from now (1 minute)
  checkIntervalMs: 30000       # How often to check for due reminders
  • DM-only: Reminders can only be set and are delivered in direct messages
  • One-time: Each reminder fires exactly once (no recurring support)
  • Restart-safe: Overdue reminders are picked up automatically after bot restart
  • Skills: set-reminder, cancel-reminder, list-reminders

πŸ”€ Model Routing

Dynamically select LLM models per user or context to control costs and quality:

agent:
  model: "gpt-5-mini"  # default fallback
  modelRouting:
    enabled: true
    rules:
      - match: { channel: "discord/account/12345678901234567" }
        model: "openrouter/deepseek/deepseek-v3.2"
      - match: { sessionType: "spontaneous" }
        model: "openrouter/deepseek/deepseek-v3.2"

Rules are evaluated in order (first-match wins). See Development Guide -- Model Routing for details.

πŸ—οΈ Architecture

AIr-Friends acts as an ACP (Agent Client Protocol) client, delegating AI reasoning to external agents while maintaining persistent memory:

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Platform (Discord/Misskey)             β”‚
β”‚            ↓                            β”‚
β”‚  AIr-Friends (ACP Client)               β”‚
β”‚            ↓                            β”‚
β”‚  External AI Agent                      β”‚
β”‚  (Copilot/Gemini/OpenCode)              β”‚
β”‚            ↓                            β”‚
β”‚  Skills & Memory System                 β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

See Design Document for detailed architecture.

πŸ“¦ Container Details

The official container image includes:

  • Pre-installed AI agent binaries (Copilot CLI, Gemini CLI, OpenCode CLI)
  • Auto-approval mode enabled for isolated execution
  • Health check endpoint on port 8080
  • Default prompts at /app/prompts (can be overridden)

πŸ› οΈ Development

See Development Guide for complete setup instructions.

License

gplv3

GNU GENERAL PUBLIC LICENSE Version 3

Copyright (C) 2026 Jim Chen [email protected].

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see https://www.gnu.org/licenses/.

About

Your AIr friends custom chatbot with integrated shell and skills. Powered by ACP AI agents. (Deno)

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages