The Ten Elements
| Element | Definition | Key Insight |
|---|---|---|
| Context | The complete information available for a single LLM call | Context is ephemeral—reconstructed every call |
| Memory | Persistent storage across calls | Memory stores; context loads |
| Agency | The ability to cause effects beyond text | Agency = causality, not just text generation |
| Reasoning | Structured thinking for complex problems | Split generation and evaluation into separate calls |
| Coordination | Managing work across components | Design handoffs like API contracts |
| Artifacts | Semantic objects with structure and operations | Shared state coordinates implicitly |
| Autonomy | Self-directed operation | Autonomy requires boundaries |
| Evaluation | Measuring whether things work | Run evals continuously, not once |
| Feedback | Signals that drive immediate improvement | Good feedback is specific and actionable |
| Learning | Accumulated improvement over time | Systems improve through use |
Storage Structures
Arrays
- Access: O(1) by index, O(n) search
- Use for: Conversation history, event logs, queues
- Operations: push, slice, filter, map
Maps
- Access: O(1) by key
- Use for: User preferences, entity data, keyed lookup
- Operations: get, set, has, delete
Vector Stores
- Access: O(log n) approximate nearest neighbor
- Use for: Semantic search, knowledge bases, similar item retrieval
- Operations: insert, search, delete
Retrieval Patterns
| Pattern | Implementation | Best For |
|---|---|---|
| By recency | array.slice(-n) | Conversation context |
| By key | map.get(key) | Known identifiers |
| By similarity | vectorStore.search(query, k) | Semantic relevance |
| By query | array.filter(predicate) | Conditional access |
| Hybrid | Combine multiple patterns | Complex context assembly |
Flow Patterns
Sequential
Operations that depend on each other:Parallel
Independent operations that can run simultaneously:Conditional
Branching based on classification or state:Iterative
Loops with termination conditions:Coordination Patterns
Pipeline
Sequential handoffs through stages:Hub and Spoke
Central coordinator delegates to specialists:Swarm
Peers coordinate through shared state:Feedback Signal Types
| Signal Type | Example | Actionability |
|---|---|---|
| Compilation errors | Unexpected token at line 42 | High—specific location |
| Test failures | Expected 5, got 4 | High—expected vs actual |
| Type errors | Type 'string' not assignable to 'number' | High—type mismatch |
| Validation errors | Missing required field 'email' | High—structural |
| Quality scores | Relevance: 0.7 | Medium—direction but not action |
| Human feedback | This doesn't address my question | Medium—requires interpretation |
Autonomy Boundaries
| Boundary Type | Purpose | Implementation |
|---|---|---|
| Iteration limits | Prevent infinite loops | if (iterations > max) break |
| Time limits | Bound execution duration | if (elapsed > timeout) abort() |
| Scope limits | Restrict available actions | Permission levels on tools |
| Progress checks | Detect stuck states | Compare progress across iterations |
| Kill switches | Emergency halt | External control mechanism |
Evaluation Dimensions
| Dimension | Question | Metrics |
|---|---|---|
| Correctness | Is the output right? | Factual accuracy, task completion, format compliance |
| Quality | Is the output good? | Relevance, completeness, clarity |
| Efficiency | What did it cost? | Tokens, latency, API calls, dollars |
| Reliability | Does it work consistently? | Success rate, error rate, variance |
Learning Types
| Type | What’s Learned | Storage | Application |
|---|---|---|---|
| Knowledge | Facts, information | Vector store | Retrieval into context |
| Patterns | What works for what | Pattern library | Strategy selection |
| Preferences | User/context adaptations | User profiles | Personalization |
| Skills | Better approaches | Prompt variants | Generation improvement |