From arch-advisor
Use this skill when designing the internal structure of a single agent, when discussing perception layers, decision layers, memory management, reflection loops, state management, or when someone says 'how should the agent be structured internally?', 'how do we handle memory?', 'should state be mutable or immutable?', 'we need the agent to self-improve its output', 'how do we chunk documents?', 'the agent needs to remember past interactions'. Also trigger for topics like LTM, STM, chunking strategy, critic-reviser, context window management.
How this skill is triggered — by the user, by Claude, or both
Slash command
/arch-advisor:agent-internal-architectureThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
A well-structured agent has four separable layers:
A well-structured agent has four separable layers:
[Perception] → loads and normalizes inputs (documents, messages, API data)
[Decision] → classifies, reasons, decides (rules → LLM → heuristics)
[Memory] → stores and retrieves context (STM + LTM)
[Reflection] → validates and improves output (critic → reviser → loop)
Each layer has independent testability and evolvability. Do not collapse them into a single LLM prompt.
Immutable state (recommended for production):
Mutable state:
Criterion: if the system requires audit trails or debugging of past decisions, use immutable state.
Build the decision layer as three passes, in order:
| Strategy | Best for | Avoid when |
|---|---|---|
| Fixed-size | Logs, tabular data, code | Documents with semantic structure |
| Sentence-based | Articles, documentation | Very technical short sentences |
| Semantic | Q&A, advanced RAG | Computational budget is tight |
| Hierarchical | Books, technical specs with sections | Documents without hierarchy |
Add overlap (10–20% of chunk size) for sentence-based and fixed-size to avoid boundary artifacts.
| Type | Scope | Storage | Access | Use for |
|---|---|---|---|---|
| STM | Current session | In-memory | Direct | Context window, recent turns |
| LTM | Persistent | Vector DB | Semantic search | Domain knowledge, past interactions |
| Episodic | Persistent | Relational DB | Query by metadata | Decision history, feedback records |
| Semantic | Persistent | Vector DB | Similarity search | General knowledge base |
For most systems, start with STM (sliding window) + LTM (vector). Add episodic when you need auditable decision history.
Use a reflection loop when output quality is critical and LLM errors are recoverable.
[Generate] → [Critic: score dimensions] → threshold met? → done
↓ no
[Reviser: fix failing dimensions] → [Generate next iteration]
Stop criteria (choose all that apply):
Two-reviser pattern (when relevance is also a dimension):
npx claudepluginhub clenci/arch-advisor --plugin arch-advisorGuides AI agent development using ReAct, plan-and-execute, multi-agent architectures. Designs tools, memory systems, guardrails; orchestrates with LangChain, LlamaIndex, CrewAI, AutoGen.
Designs and builds autonomous AI agents with expertise in tool use, memory systems, planning strategies, and multi-agent orchestration. Covers ReAct loops, hierarchical memory, and supervisor patterns.
Designs autonomous AI agents expert in tool use, memory systems, ReAct/Plan-and-Execute planning, multi-agent orchestration, evaluation, and safety guardrails.