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.

Diagram

Learning — What should I know?

👤 Persona

💡 Insights

🔄 Patterns

⚖️ Decisions

📝 Feedback

🚀 Improvements

Memory — What happened?

⚡ Short-term

💾 Long-term

👤 Entity

📅 Episodic

Key Differences

DimensionMemoryLearning
AnalogyNotebook / filing cabinetAdaptive brain tissue
Question“What happened before?”“What should I know going forward?”
WhenEvery interaction (read/write)Post-interaction analysis
HowDirect storage (key-value, vector, relational)LLM-powered extraction + structured stores
LifetimeSession (STM) or persistent (LTM)Always persistent, grows over time
OutputRaw conversation history, entity recordsUser profiles, behavioral patterns, decision logs
CostLow (no LLM calls for basic ops)Higher (requires LLM extraction step)

When to Use Each


API Comparison

Memory and Learning are peer-level systems — both are top-level Agent parameters:

Memory Only

python
from praisonaiagents import Agent

agent = Agent(
    name="Assistant",
    instructions="You are a helpful assistant",
    memory=True   # STM + LTM + Entity + Episodic
)

Learning Only

python
from praisonaiagents import Agent

agent = Agent(
    name="Assistant",
    instructions="You learn from every interaction",
    learn=True  # Enables AGENTIC mode (auto-learning)
)

Both Together

python
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

python
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

TypeWhat It StoresPersistence
Short-termRecent conversation contextRolling buffer, auto-expires
Long-termImportant facts with importance scoresPermanent
EntityNamed entities (people, places) with attributesPermanent
EpisodicDate-based interaction historyConfigurable retention

Learning Stores

StoreWhat It ExtractsDefault
PersonaUser preferences, communication style✅ On
InsightsObservations and learnings✅ On
ThreadSession context✅ On
PatternsReusable knowledge patterns❌ Off
DecisionsDecision rationale and trade-offs❌ Off
FeedbackOutcome signals and corrections❌ Off
ImprovementsSelf-improvement proposals❌ Off

How They Work Together

Diagram
LearningMemoryAgentUserLearningMemoryAgentUserNext interaction“I prefer Python over JavaScript”Store in STM (raw text)Add Entity (User → prefers: Python)Extract Persona (language preference)Extract Insight (tech stack signal)Response“Help me build an API”Retrieve recent context (STM)Get persona + insightsSystem prompt includes bothPython-specific API guidance

Memory provides the raw recall. Learning provides the adaptive intelligence on top.


Architecture

Both systems are first-class peers on the Agent:

Diagram

auto-creates if needed

post-run hook

Agent

learn= param

memory= param

LearnConfig

LearnMode: AGENTIC / PROPOSE / DISABLED

MemoryConfig

STM / LTM / Entity / RAG

Auto-extract learnings

LearnManager → 7 stores

Learning Modes

ModeBehavior
AGENTICAutomatically extracts learnings after each interaction (default with learn=True)
PROPOSEAgent proposes learnings, human approves
DISABLEDLearning is off

Related