AWS Agent Memory: Choose and Test Persistent Storage

AWS offers several memory options for AI agents, from session storage in Bedrock Agents to external databases you manage yourself. This guide explains the options, what survives a session, and how to test persistence before relying on it.

Updated 4 min read

AWS provides several services for building AI agents, each with different memory characteristics. Amazon Bedrock Agents offers built-in session storage that preserves context within a session. For cross-session persistence, you connect the agent to a database or memory store you manage. What survives a session depends on how you configure each layer.

Choosing the wrong memory layer for the wrong purpose leads to state that disappears unexpectedly or grows without bound. Test each layer explicitly before relying on it in production. Tools like fenbs supply a shared record of project decisions that is independent of AWS execution — useful for the design decisions that govern what the agent stores, not for the runtime storage itself.

Memory options in Amazon Bedrock

Amazon Bedrock is AWS's managed AI model service. Bedrock Agents adds orchestration on top: a session ID tracks context within a conversation, and the agent can call action groups (Lambda functions) and knowledge bases (vector search over your documents).

  • Session memory: context within one sessionId. The session ends when you close it or it times out. Nothing persists automatically to the next session.
  • Knowledge bases: a vector search index over documents you provide. Persists across sessions because it lives in your storage, not in the session.
  • Action groups: Lambda functions the agent calls. These can read from and write to any storage you manage in that function.
  • Agent memory feature (check Bedrock docs for current availability): some Bedrock Agent configurations support a memory layer that carries summarized context across sessions.

External storage options on AWS

When session memory is not enough, connect the agent to external storage through an action group. The agent calls a Lambda function that reads from or writes to the store. The store persists independently of any session.

AWS storage options for agent memory
ServiceGood fit forWhat to check
Amazon DynamoDBSession summaries, user preferences, task state. Fast key-value lookups.Partition key design; TTL for expiring old sessions automatically.
Amazon RDS / AuroraStructured relational data, query-heavy workloads.Connection management from Lambda; latency for real-time agent calls.
Amazon S3Documents, large payloads, audit logs.Not suited for frequent small reads; use for append-only logs or document storage.
Amazon OpenSearchSemantic search over a large document corpus.Index management and cost at scale; combined with Bedrock Knowledge Bases.
Amazon ElastiCacheShort-lived session state, fast repeated reads.Data is volatile: plan for cache misses and expiry.

What survives a session

Test this explicitly. Create a session, make a call that should store state, end the session, and start a new session with the same identity. Check whether the expected state is readable. Do not assume persistence works because it was configured — test it.

  1. Create a session and have the agent record a fact (write to the external store).
  2. End the session completely: close the sessionId, wait for any timeout.
  3. Start a new session with the same user or agent identifier.
  4. Ask the agent to recall the fact. Check that it reads from the external store, not from in-session context.
  5. Verify the result matches what was written in the first session.

If the fact is not recalled, check: did the Lambda write succeed? Did the store commit the write? Is the read using the same key or query? Is the new session configured to call the memory-reading action group at startup?

How fenbs helps

Keep the design decisions separate from AWS execution

Add the agent project to fenbs. Write the storage architecture — which layer handles which kind of fact, what the agent can write, what it reads at startup — in Decisions and rules. When you hand the project to another developer, the design is readable before they open the AWS console.

Create a free account

Free for one person · No credit card · Works with Claude, ChatGPT, Cursor and more

Testing memory across layers

Each memory layer has different failure modes. Session memory can expire unexpectedly. DynamoDB writes can fail silently if the Lambda does not handle errors. Knowledge base updates may not be reflected immediately if the index has a sync delay. Test each layer for the failure mode that would hurt most in production.

  • Session memory: test what happens when a session times out mid-task. Does the agent resume or start over?
  • DynamoDB writes: inject a write failure and confirm the agent handles it or retries correctly.
  • Knowledge base: update a document and test how long before the agent reads the new version.
  • Cross-session recall: write a fact, delete the session, and confirm the fact is still readable in a new session.

Deciding what the agent writes vs what people write

Not everything in external storage should be written by the agent. Facts that depend on a person's judgment — a preference, an approval, a decision — should require a person to write them. Facts that are purely mechanical — a count, a timestamp, a status that follows directly from an action — can be written by the agent. Define the boundary before you build it, because retrofitting it later means auditing every write the agent has made.

How to do this with fenbs

  1. Create a free account and add a project for the AWS agent system.
  2. Write the memory architecture decisions in Decisions and rules: which AWS service handles each layer, why, and what the testing plan is.
  3. Record the test results as task notes: what was tested, what the expected result was, and what actually happened.
  4. When a storage layer fails a test, record the lesson and update the architecture decision.
  5. Connect your coding assistant to fenbs from Integrations so it reads the design decisions before each development session.

See how to build agent memory, agent memory vs RAG, and agent memory MCP for related patterns.

Questions people ask.

Does Amazon Bedrock provide persistent agent memory out of the box?

Bedrock Agents provides session-scoped memory within a sessionId. For cross-session persistence, you connect the agent to an external store through an action group. Check the Bedrock documentation for any built-in cross-session memory features, as these capabilities change with service updates.

Which AWS service is best for storing agent session summaries?

Amazon DynamoDB is a common choice for session summaries: fast key-value reads, configurable TTL for expiry, and straightforward integration with Lambda. The right choice depends on the access pattern and the structure of the data.

How do I test that memory persists across sessions?

Write a fact in one session, end the session, start a new session with the same identity, and try to recall the fact. Verify the recall comes from the external store, not from context carried over in the session.

What is the difference between Bedrock Knowledge Bases and agent session memory?

Knowledge Bases are indexed document stores used for retrieval. Session memory holds the conversational context for the current session. Knowledge Bases persist across sessions because they are separate storage; session memory ends when the session ends.

Can I use fenbs as the memory store for a Bedrock agent?

fenbs is a project management tool that keeps the work record — tasks, decisions, where things were left — for humans and AI assistants to maintain together. It is not a runtime memory store for Bedrock agents. For agent runtime storage, use AWS services like DynamoDB or S3.

More in Agent harness (for developers)

All Agent harness (for developers) articles

Start with one thing.

Free for one person · No credit card · Works with Claude, ChatGPT, Cursor and more

There is nothing to set up first. Write one line and you’ve started.