# Agent Memory

1\. Three-Tiered Memory Architecture

a. Short-Term Memory (Session or Campaign-level)

* Stores recent user actions (e.g., "clicked last email", "ignored upsell offer").
* Lives for the current session or short lifecycle context (e.g., 7–14 days).
* Enables reactive personalization (e.g., don’t re-offer something just clicked).

Example:\
Churn agent recalls that the user clicked "cancel reasons" → triggers a save offer, not generic re-engagement.

b. Long-Term Memory (User-level + Segment-level)

* Captures patterns across lifecycle stages: onboarding, activation, conversion, churn.
* Includes vectorized summaries of:
* Past interactions
* Channel preferences
* Campaign responses
* Agent actions + outcomes

Stored in a Vector DB (e.g., Weaviate or Pinecone) using user embeddings or segment-level embeddings for fast semantic retrieval.

Example:\
For a mid-funnel B2B user, the agent recalls that whitepapers → demo → closed won is a high-conversion path and prioritizes this path again.

c. Global Memory (Agent + Team-level)

* Shared knowledge across all agents and customers (pseudonymized).
* Stores best-performing prompts, subject lines, CTAs, channel combos.
* Updated with reward signals (e.g., lift in conversions, reduced drop-offs).

This enables self-improvement and cross-agent knowledge sharing (e.g., churn prevention agent learns from upsell agent’s success).

2\. How Memory Is Queried

Agents use memory via:

* Embedding-based retrieval (vector similarity)
* Metadata filtering (e.g., campaign type = “churn save”)
* Time decay logic to prioritize fresh interactions

Often wrapped in a Retriever module inside LangChain / LangGraph agent flows.

3\. What Gets Stored

* User & segment interaction logs
* Campaign variants tried
* Reasoning steps (in CoT, ReAct form)
* Final outcomes (clicks, conversions, revenue delta)
* Feedback from marketers (human-in-the-loop scoring)

4\. Memory Refresh & Pruning

* Low-signal events decay over time
* Abandoned flows are eventually purged
* Only high-relevance, high-reward outcomes are retained long-term

<br>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.questera.ai/questera-ai-platform/ai-agents/agent-memory.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
