Quick Comparison
| Aspect | Context | Memory | Knowledge | RAG |
|---|---|---|---|---|
| What | Runtime data flow | Persistent storage | Pre-loaded docs | Search technique |
| When | During execution | Across sessions | Before execution | Query time |
| Lifetime | Session only | Permanent | Permanent | N/A |
| Direction | Read-only | Read + Write | Read-only | Read-only |
| Agent Param | context= | memory= | knowledge= | Part of knowledge |
| Dependencies | None | None (file) | chromadb | chromadb |
The Four Concepts Explained
1. Context = Runtime Data Flow
What it is: Data passed between agents during a single workflow execution.Key Point: Context is ephemeral - lost when the session ends. Use for workflow data flow.
2. Memory = Persistent Learning
What it is: Information stored and recalled across sessions. The agent “remembers”.Key Point: Memory persists across sessions. Use for user preferences, learning, conversation history.
3. Knowledge = Pre-loaded Documents
What it is: Reference documents loaded before the agent runs. Static information.Key Point: Knowledge is read-only reference data. Use for manuals, FAQs, documentation.
4. RAG = Retrieval Augmented Generation
What it is: A technique (not a separate system) that powers Knowledge search.Key Point: RAG is HOW knowledge search works, not a separate system. It’s the retrieval technique.
Decision Tree: Which to Use?
When to Use What
Context
Use for: Agent-to-agent data flow, tool results, single-session workflowsDon’t use for: Anything that needs to persist
Memory
Use for: User preferences, conversation history, learning over timeDon’t use for: Large document collections
Knowledge
Use for: Reference docs, manuals, FAQs, static informationDon’t use for: Dynamic data that changes frequently
RAG
Use for: Semantic search over large documentsNote: This is a technique, not a separate param
Agent Parameters Summary
Parameter Quick Reference
| Parameter | Type | Description |
|---|---|---|
context=True | bool | Enable context management |
context=ManagerConfig(...) | ManagerConfig | Custom context settings |
memory=True | bool | Enable file-based memory |
memory={"session_id": "..."} | dict | Memory with session |
memory=MemoryConfig(...) | MemoryConfig | Full memory config |
knowledge=["file.pdf"] | list | Simple knowledge sources |
knowledge=KnowledgeConfig(...) | KnowledgeConfig | Full knowledge config |
Using All Together
The most powerful pattern combines all three:Performance Comparison
| System | Setup Time | Query Time | Dependencies | Storage |
|---|---|---|---|---|
| Context | 0ms | 0ms | None | Memory only |
| Memory (file) | 0ms | 1-5ms | None | JSON files |
| Memory (sqlite) | 0ms | 5-10ms | Built-in | SQLite DB |
| Knowledge | 1-5s/doc | 50-200ms | chromadb | Vector DB |
Summary
| Concept | One-liner |
|---|---|
| Context | Runtime data flow between agents (lost after session) |
| Memory | Persistent storage for learning and recall |
| Knowledge | Pre-loaded reference documents |
| RAG | Semantic search technique powering Knowledge |

