How aozorayui/ai-plugin works
AI-Plugin is a Yunzai-Bot AI assistant plugin. Users invoke chat, image-generation, memory, and management commands; chat can plan and execute tools before returning a response. Group chat capture and recall, persistent conversation memory, model routing, and optional integrations extend that flow. Edges are based on the README and SOURCE INDEX references; where implementation excerpts were unavailable, documented capabilities are represented without asserting unverified internal calls.
Main entry points: chat.js Chat commands · AiClient.js Model client · fast_chat.js Group chat · index.js Tool collection
Components 29
User interactions
- Chat commands
apps/chat.js - Group chat
apps/fast_chat.js - Image generation
apps/image.js - Memory commands
apps/memory.js - Plugin management
apps/management.js
Agent and tools
- Tool registry
tools/registry.js - Tool collection
tools/index.js - Task planning
utils/agent_plan.js - Agent runtime
utils/agent_runtime.js - Tool policy
utils/agent_policy.js - Intent parsing
utils/tool_intent.js - Tool results
utils/tool_result.js - Web search
tools/search.js - Web fetch
tools/web_fetch.js - Vision relay
tools/vision_relay.js
Conversation memory
- Conversation history
model/conversation.js - SQLite persistence
utils/database.js - Vector memory
utils/vector_memory.js
Models and platform
- Model client
client/AiClient.js - Plugin configuration
utils/config.js - Shared utilities
utils/common.js - Access control
utils/access.js - Image handling
utils/image.js - Model output
utils/model_output.js - QQ face mapping
utils/qq_face.js
Other components
- User
- Model providers
- Yunzai-Bot
- Web sources
Connections 38
- User → Chat commands: sends command
README.md - User → Group chat: mentions bot
README.md - User → Image generation: requests image
README.md - User → Memory commands: manages memory
README.md - User → Plugin management: manages plugin
README.md - Chat commands → Model client: requests model
apps/chat.js - Chat commands → Conversation history: loads history
apps/chat.js - Chat commands → Access control: checks access
apps/chat.js - Chat commands → Agent runtime: runs tools
README.md - Chat commands → Image handling: handles images
apps/chat.js - Group chat → Model client: requests model
README.md - Group chat → Agent runtime: runs tools
README.md - Group chat → Tool collection: uses tools
apps/fast_chat.js - Group chat → Conversation history: shares memory
README.md - Image generation → Model client: requests image
apps/image.js - Memory commands → Conversation history: reads history
README.md - Memory commands → Model client: requests summaries
README.md - Conversation history → SQLite persistence: reads and writes
model/conversation.js - SQLite persistence → Vector memory: queues indexing
utils/database.js - Agent runtime → Task planning: uses task plans
utils/agent_runtime.js - Agent runtime → Tool registry: dispatches tools
README.md - Tool registry → Intent parsing: filters intent
tools/registry.js - Tool registry → Tool policy: applies policy
tools/registry.js - Tool registry → Tool results: normalizes results
tools/registry.js - Tool collection → Tool registry: exports registry
tools/index.js - Tool collection → Web search: exports search
tools/index.js - Tool collection → Web fetch: exports fetch
tools/index.js - Tool collection → Vision relay: exports relay
tools/index.js - Web search → Web sources: searches sources
README.md - Web fetch → Web sources: fetches pages
README.md - Model client → Model providers: routes requests
README.md - Model client → Plugin configuration: loads settings
client/AiClient.js - Model client → Shared utilities: uses networking
client/AiClient.js - Chat commands → QQ face mapping: uses mappings
apps/chat.js - Chat commands → Model output: formats response
apps/chat.js - Vector memory → SQLite persistence: indexes records
utils/database.js - Plugin management → Plugin configuration: updates settings
apps/management.js - Yunzai-Bot → Chat commands: loads plugin command