Building Agents
Intelligence & Learning

Intelligence & Learning

The Intelligence tab is located in the agent detail view. It manages the agent's learned knowledge and behavioral rules -- the memories that shape how the agent responds during conversations.

Memory Taxonomy

Every memory is classified along four dimensions: category, source, strength, and status.

Categories

CategoryPurpose
factFactual information the agent should know
preferenceBehavioral preferences that guide tone or approach
correctionError corrections from past mistakes
instructionExplicit rules the agent must follow

Sources

SourceMeaning
manualCreated directly by an operator
suggestedProposed by the AI from observed patterns
derivedAutomatically extracted from data

Strengths

Strength determines how aggressively a memory is injected into the agent's runtime context, and how much of the character budget it can consume.

StrengthLabelRuntime behaviorCharacter budget
hard_ruleRuleAlways applied to every conversation1500 characters
preferencePreferenceApplied when relevant1000 characters
heuristicPatternApplied when scope matches500 characters
context_noteNoteAvailable but not auto-applied0 characters

Rules (hard_rule) are always injected regardless of scope. Preferences and patterns are injected when the runtime determines they are relevant to the current conversation. Notes are stored for reference but never automatically included in the prompt.

Statuses

StatusMeaning
draftNot yet active -- will not be injected at runtime
activeInjected at runtime according to its strength tier
staleNeeds review -- may be outdated
archivedPreserved for history but inactive
supersededReplaced by a newer memory

Only memories with active status are injected into conversations.

Learning Configuration

Learning settings are stored in the Agent.learningConfig JSON field. They control how the agent acquires new memories over time.

Settings

SettingDescriptionOptions
Learn from approved actionsExtract patterns when an operator approves a proposed actionOn / Off (default: on)
Learn from rejected recommendationsLearn what to avoid when an operator rejects a recommendationOn / Off (default: on)
Evaluate outcomes afterHours to wait before auto-evaluating action outcomes24 hours, 48 hours (default), 72 hours, 7 days
Learning windowIgnore feedback and data older than this thresholdAll time (default), 30 days, 90 days, 180 days, 365 days
Recency biasWeight newer patterns more heavilyNone, Moderate (default), Strong

The evaluation delay (maturity window) gives actions time to produce measurable outcomes before the system judges whether they succeeded. The learning window controls how far back the system looks when analyzing patterns -- setting it to 90 days, for example, means older data is ignored entirely.

Runtime Injection

At conversation time, active memories are injected into the AI prompt using a budget system that prevents the context from growing too large.

Budget Allocation

BudgetCharacters
Total combined budget8000
Reserved for policy context800
Reserved for knowledge base context700
Minimum for brand intelligence1000
Remaining (for memories)Allocated by strength tier

The system fills the memory budget in priority order: hard rules first, then preferences, then heuristics. Each tier is capped at its per-tier character budget. Context notes (0-char budget) are never injected automatically.

After memory and reserved budgets are subtracted from the 8000-character total, the remainder goes to brand intelligence summaries, with a guaranteed floor of 1000 characters.

Feedback Loop

Feedback from operators is the primary signal that drives memory suggestions.

  • Conversations (knowledge agents) have a feedbackRating field (1 for positive, -1 for negative), an optional feedbackComment, and a feedbackAt timestamp.
  • Agent runs (action agents) carry the same feedback fields.

When feedback accumulates, the system can propose new memories as suggested entries. An operator reviews these suggestions and either activates them (making them part of the agent's runtime context) or dismisses them.

Creating Memories

To add a memory manually:

  1. Open the Intelligence tab in the agent detail view.
  2. Click Add Memory.
  3. Select a category (fact, preference, correction, or instruction).
  4. Choose a strength (Rule, Preference, Pattern, or Note).
  5. Set the status (typically start with draft, then activate after review).
  6. Write the memory content -- what the agent should know or do.
  7. Optionally set an applicability scope to narrow when the memory applies:
    • Provider -- limit to a specific ad platform (e.g., meta_ads, google_ads, tiktok_ads, dv360).
    • Campaign IDs -- limit to specific campaigns.
    • Tags -- add labels for organization and future filtering.

Memories with narrow scopes are only injected when the conversation or action matches the specified provider and campaigns. Unscoped memories apply universally.