Skip to main content
PraisonAI provides two distinct systems for improving agent behavior: Agent Learn (passive) and Agent Train (active). Understanding when to use each is key to building effective agents.

Agent Learn (Passive)

Automatically captures patterns during normal interactions:

Agent Train (Active)

Explicit iterative improvement with feedback:

Quick Comparison

AspectAgent LearnAgent Train
TypePassive / AutomaticActive / Explicit
WhenDuring normal interactionsDedicated training sessions
FeedbackImplicit (auto-detected patterns)Explicit (human/LLM scores)
PurposeRemember preferences & patternsImprove specific behaviors
Storage7 specialized storesScenarios & reports
IterationsContinuousFixed (1-N iterations)
Code Locationpraisonaiagents (core SDK)praisonai (wrapper)

When to Use Each

Use Agent Learn When:

  • Remembering user preferences - Dark mode, language, communication style
  • Capturing domain knowledge - Project-specific terms, codebase patterns
  • Building context over time - Session history, conversation threads
  • Automatic adaptation - No intervention needed
  • Long-term memory - Persistent across sessions

Use Agent Training When:

  • Improving specific responses - Better greetings, more accurate answers
  • Quality assurance - Iterative refinement with scoring
  • Human feedback loops - Expert-in-the-loop improvement
  • Benchmarking behavior - Measurable improvement metrics
  • One-time improvement sessions - Focused training runs

Data Flow Comparison

Key Points:
  • Happens automatically during agent.start()
  • No explicit feedback required
  • Stores in 7 specialized stores
  • Retrieved automatically for future interactions

Storage Comparison

Agent Learn Stores

StorePurposeAuto-Captured
PersonaStoreUser preferences, profile✅ Yes
InsightStoreObservations, learnings✅ Yes
ThreadStoreSession/conversation context✅ Yes
PatternStoreReusable knowledge patternsOptional
DecisionStoreDecision loggingOptional
FeedbackStoreOutcome signalsOptional
ImprovementStoreSelf-improvement proposalsOptional

Agent Training Storage

DataPurposeFormat
TrainingScenarioInput + expected outputJSON
TrainingIterationPer-iteration resultsJSON
TrainingReportSummary with scoresJSON

Code Examples

from praisonaiagents import Agent

# Enable learning with simple shorthand
agent = Agent(
    name="Assistant",
    instructions="You are a helpful assistant",
    learn=True  # Enables AGENTIC mode (auto-learning)
)

# Learnings captured automatically
agent.start("I prefer concise answers")
agent.start("Always use Python examples")

# Later - agent remembers preferences
agent.start("How do I sort a list?")
# Agent gives concise Python answer

Using Both Together

Agent Learn and Agent Training are complementary. Use them together for best results:
from praisonaiagents import Agent
from praisonai.train.agents import AgentTrainer, TrainingScenario

# Create agent with learning enabled
agent = Agent(
    name="Assistant",
    instructions="You are a helpful assistant",
    learn=True  # Passive learning always on
)

# Periodically run training sessions
trainer = AgentTrainer(agent=agent, iterations=3, human_mode=True)
trainer.add_scenario(TrainingScenario(
    id="quality_check",
    input_text="Explain machine learning",
    expected_output="Clear, accurate explanation"
))

# Training improves specific behavior
report = trainer.run()

# Agent continues learning passively
# AND benefits from training improvements

Summary

FeatureAgent LearnAgent Training
Enablelearn=TrueAgentTrainer(agent)
TriggerAutomaticManual
FeedbackNone neededScore + suggestions
Best forPreferences, contextQuality improvement
PersistenceLearn storesTraining reports
CLIpraisonai memory learnpraisonai train agents

Agent Learn

Passive continuous learning

Agent Train

Active iterative training

Memory

Agent memory systems

Train CLI

CLI reference