Memory vs Learning
Understand the difference between Memory (storage) and Learning (adaptive knowledge extraction)
Memory and Learning are different but complementary systems. Memory stores raw data, while Learning extracts actionable knowledge from it.
graph LR
subgraph "Memory — What happened?"
M1[⚡ Short-term]
M2[💾 Long-term]
M3[👤 Entity]
M4[📅 Episodic]
end
subgraph "Learning — What should I know?"
L1[👤 Persona]
L2[💡 Insights]
L3[🔄 Patterns]
L4[⚖️ Decisions]
L5[📝 Feedback]
L6[🚀 Improvements]
end
classDef memory fill:#6366F1,stroke:#7C90A0,color:#fff
classDef learn fill:#F59E0B,stroke:#7C90A0,color:#fff
class M1,M2,M3,M4 memory
class L1,L2,L3,L4,L5,L6 learnKey Differences
| Dimension | Memory | Learning |
|---|---|---|
| Analogy | Notebook / filing cabinet | Adaptive brain tissue |
| Question | “What happened before?” | “What should I know going forward?” |
| When | Every interaction (read/write) | Post-interaction analysis |
| How | Direct storage (key-value, vector, relational) | LLM-powered extraction + structured stores |
| Lifetime | Session (STM) or persistent (LTM) | Always persistent, grows over time |
| Output | Raw conversation history, entity records | User profiles, behavioral patterns, decision logs |
| Cost | Low (no LLM calls for basic ops) | Higher (requires LLM extraction step) |
When to Use Each
Use Memory When
- You need conversation context across sessions
- You want to store/retrieve specific facts
- You need entity tracking (people, places)
- You want lightweight, zero-LLM-cost storage
- Agents should adapt to user preferences over time
- You want pattern recognition across interactions
- You need decision logging and rationale tracking
- You want self-improvement proposals
API Comparison
Memory and Learning are peer-level systems — both are top-level Agent parameters:
Memory Only
from praisonaiagents import Agent
agent = Agent(
name="Assistant",
instructions="You are a helpful assistant",
memory=True # STM + LTM + Entity + Episodic
)Learning Only
from praisonaiagents import Agent
agent = Agent(
name="Assistant",
instructions="You learn from every interaction",
learn=True # Enables AGENTIC mode (auto-learning)
)Both Together
from praisonaiagents import Agent, LearnConfig
agent = Agent(
name="Full Assistant",
instructions="You remember and learn",
memory=True, # Memory system
learn=LearnConfig( # Learning layer
persona=True, # User preferences
insights=True, # Observations
patterns=True, # Reusable knowledge
decisions=True, # Decision logging
)
)Custom Config
from praisonaiagents import Agent, LearnConfig
agent = Agent(
name="Production Agent",
instructions="You learn and adapt",
learn=LearnConfig(
persona=True,
insights=True,
patterns=True,
mode="agentic", # Auto-extract learnings
scope="private", # User-isolated data
)
)What Each System Stores
Memory Types
| Type | What It Stores | Persistence |
|---|---|---|
| Short-term | Recent conversation context | Rolling buffer, auto-expires |
| Long-term | Important facts with importance scores | Permanent |
| Entity | Named entities (people, places) with attributes | Permanent |
| Episodic | Date-based interaction history | Configurable retention |
Learning Stores
| Store | What It Extracts | Default |
|---|---|---|
| Persona | User preferences, communication style | ✅ On |
| Insights | Observations and learnings | ✅ On |
| Thread | Session context | ✅ On |
| Patterns | Reusable knowledge patterns | ❌ Off |
| Decisions | Decision rationale and trade-offs | ❌ Off |
| Feedback | Outcome signals and corrections | ❌ Off |
| Improvements | Self-improvement proposals | ❌ Off |
How They Work Together
sequenceDiagram
participant User
participant Agent
participant Memory
participant Learning
User->>Agent: "I prefer Python over JavaScript"
Agent->>Memory: Store in STM (raw text)
Agent->>Memory: Add Entity (User → prefers: Python)
Agent->>Learning: Extract Persona (language preference)
Agent->>Learning: Extract Insight (tech stack signal)
Agent-->>User: Response
Note over Agent: Next interaction
User->>Agent: "Help me build an API"
Agent->>Memory: Retrieve recent context (STM)
Agent->>Learning: Get persona + insights
Agent->>Agent: System prompt includes both
Agent-->>User: Python-specific API guidanceMemory provides the raw recall. Learning provides the adaptive intelligence on top.
Architecture
Both systems are first-class peers on the Agent:
graph TD
A["Agent"] --> B["learn= param"]
A --> C["memory= param"]
B --> D["LearnConfig"]
D --> E["LearnMode: AGENTIC / PROPOSE / DISABLED"]
B -.->|"auto-creates if needed"| C
C --> F["MemoryConfig"]
F --> G["STM / LTM / Entity / RAG"]
A -->|"post-run hook"| H["Auto-extract learnings"]
H --> I["LearnManager → 7 stores"]Learning Modes
| Mode | Behavior |
|---|---|
| AGENTIC | Automatically extracts learnings after each interaction (default with learn=True) |
| PROPOSE | Agent proposes learnings, human approves |
| DISABLED | Learning is off |