docs: mascot before each section heading in tutorial docs

This commit is contained in:
2026-07-17 21:44:15 +08:00
parent 10638f1308
commit 3c441649c9
8 changed files with 108 additions and 16 deletions

View File

@ -1,11 +1,11 @@
**中文** | [English](../zh/ARCHITECTURE.md)
<img src="../../branding/mascot-xiaozhai.webp" width="20" style="border-radius:50%;vertical-align:middle"> :
# HomeAgent Architecture
The kernel performs zero IO; all external interaction comes from plugins.
<img src="../../branding/mascot-xiaozhai.webp" width="20" style="border-radius:50%;vertical-align:middle"> :
## Message Processing Flow
### Full Pipeline
@ -66,6 +66,8 @@ Exit conditions: LLM has no tool calls / all rejected / exceeded limit.
Setting `ctx.Response` at any stage jumps to `after_output`.
<img src="../../branding/mascot-xiaozhai.webp" width="20" style="border-radius:50%;vertical-align:middle"> :
## Three-Layer Memory
### Memory Flow
@ -203,6 +205,8 @@ Heartbeat 30min:
Entity conflict detection heuristic (bigram Jaccard > 0.75), routed through `selfInputCh` internal channel, LLM makes the final merge decision.
<img src="../../branding/mascot-xiaozhai.webp" width="20" style="border-radius:50%;vertical-align:middle"> :
## Knowledge Base
`internal/knowledge/knowledge.go`
@ -210,6 +214,8 @@ Entity conflict detection heuristic (bigram Jaccard > 0.75), routed through `sel
- Independent TF-IDF index, separate from memory system
- `knowledge_search` / `knowledge_create` / `knowledge_list`
<img src="../../branding/mascot-xiaozhai.webp" width="20" style="border-radius:50%;vertical-align:middle"> :
## Provider & Lua Adapter Layer
```
@ -234,6 +240,8 @@ ProviderManager manages multiple sources, fallback in registration order. Lua ad
VM built-ins: `json.encode` / `json.decode` / `log` / `http_get` / `http_post`.
<img src="../../branding/mascot-xiaozhai.webp" width="20" style="border-radius:50%;vertical-align:middle"> :
## Plugin System
### Three Loading Methods
@ -284,6 +292,8 @@ type Plugin interface {
}
```
<img src="../../branding/mascot-xiaozhai.webp" width="20" style="border-radius:50%;vertical-align:middle"> :
## Output Channel System
Each output channel generates two tools:
@ -306,6 +316,8 @@ Capability flags:
System prompt injection: output gate rules, multi-call support, long message splitting.
Child agent permission: `output_send__` prefix tools are allowed.
<img src="../../branding/mascot-xiaozhai.webp" width="20" style="border-radius:50%;vertical-align:middle"> :
## EventAgentLLMChain Event
- Event type `agent_llm_chain` emitted after each LLM turn
@ -313,6 +325,8 @@ Child agent permission: `output_send__` prefix tools are allowed.
- WebUI subscribes to this event via SSE for real-time display
- Plugins can subscribe via EventSubscriber (read-only for external plugins)
<img src="../../branding/mascot-xiaozhai.webp" width="20" style="border-radius:50%;vertical-align:middle"> :
## Restricted External Plugin API
Layered architecture: internal plugins get full PluginSDK, external plugins get restricted SDK.
@ -326,6 +340,8 @@ Extended fields:
- Triple extensions: Confidence, SubjectType, ObjectType
- Relation extension: Confidence
<img src="../../branding/mascot-xiaozhai.webp" width="20" style="border-radius:50%;vertical-align:middle"> :
## Interrupt Mechanism
```
@ -346,6 +362,8 @@ Three delivery paths:
Code: `internal/agent/core/agent.go``interceptLoop` / `drainInterrupt`
<img src="../../branding/mascot-xiaozhai.webp" width="20" style="border-radius:50%;vertical-align:middle"> :
## Configuration System
`internal/config/registry.go` — ConfigRegistry
@ -355,6 +373,8 @@ Code: `internal/agent/core/agent.go` — `interceptLoop` / `drainInterrupt`
- `RegisterDefault` inserts ~80 default keys (seeds for 8 LLM sources)
- WebUI settings page `/api/v1/settings` for read/write
<img src="../../branding/mascot-xiaozhai.webp" width="20" style="border-radius:50%;vertical-align:middle"> :
## Code Structure
```