Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

For most production AI agents, use PostgreSQL as the durable source of truth for workflow state, checkpoints, messages, tool results, idempotency keys, and audit metadata. Add a vector-capable store when the agent must recall semantically related information, Redis when low-latency or expiring working memory matters, and Neo4j when answers depend on traversing relationships across entities and events. A robust design usually combines these roles instead of forcing one database to do everything.

The short answer: match the database to the memory job

“Agent memory” is not one workload. A paused workflow must resume from an exact checkpoint; a conversation may need semantic recall; a lock or queue may expire in seconds; and a relationship question may require several hops across people, documents, events, and causes. Those jobs have different consistency, query, and retention requirements.

Database or layer Best role Why it fits Main limitation
PostgreSQL Canonical workflow state and durable records Transactions, constraints, familiar backup and recovery, flexible relational queries, and a durable operational model Semantic and graph retrieval usually require additional indexes, extensions, or a separate projection
Redis Hot session context, expiring working memory, queues, locks, caches, and fast vector retrieval Low-latency access, expiration controls, structured metadata, and vector search in one memory-oriented layer It should not replace canonical transactional records unless your durability and recovery design explicitly supports that choice
Vector-capable layer Semantic recall of chunks, facts, summaries, and prior conversations Nearest-neighbor search finds related meaning rather than exact keywords Similarity alone does not enforce permissions, freshness, retention, or workflow correctness
Neo4j Relationship-heavy memory and multi-hop questions Graph traversal models entities, events, dependencies, and causes directly; native vector indexes can complement graph queries More modeling and operational complexity than a relational source of truth for simple state

LangChain documents PostgreSQL as a persistence layer for user, run, and memory data, while LangGraph separates short-term thread checkpoints from long-term stores that survive across threads. See LangSmith data plane documentation and LangGraph persistence documentation for those persistence concepts.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Separate workflow checkpoints from long-term memory

Workflow and thread state

Workflow state is the exact data needed to continue a run safely: the current step, inputs, outputs, pending tool calls, retry count, timestamps, leases, and status. A checkpoint must be durable and recoverable. If a worker crashes after a tool call, the system needs to know whether the call completed, whether its result was recorded, and whether repeating it is safe.

#1 Best Overall
Sale
Compressed Air Duster,130000RPM Super Power Cordless Air Duster,Rechargeable Brushless Blower,3 Gear Adjustable Blower with LED Light,Dust Remover for Computer/House/Outdoor/Car
  • Powerful Turbo Fan:CAGIWIRU Electric Air Duster have reached speed up to 130000RPM,Can efficient remove dust and debris.With LED light and Three Adjustable Speed to meet with different cleaning tasks.
  • With Attached USB C Fasting Charging cable.Charing 3 hours,Enjoy up to 240 minutes of use on the lowest setting, For third speed can use for 25mins.with four charging options to meet with your needs.
  • Wide Application: attached 5 different nozzles,making it suitable for a variety of scenes, such as car,pet, pc, keyboards, and other electronic devices. It also serves for office and home clean duster.
  • Handy Design & Portable:Cordless air duster electric nozzle is Light weight and small size, design and comfortable to hold and space saving, convenient to carry around. You can put it in your room or inside the car without taking up space.
  • Economical &Reusable: Built durable materials with a long-lasting battery,our CAGIWIRU air duster it's a sustainable alternative to disposable air cans.

Store this state transactionally. Include a run or thread identifier, a monotonically increasing checkpoint or version, serialized state, status, and update time. Record idempotency keys for external side effects so a replay cannot create duplicate payments, messages, or tickets. Keep tool results and error details alongside the checkpoint or in a referenced table.

Long-term memory

Long-term memory persists information beyond one thread: a user preference, an approved policy, an episodic event, or a durable fact extracted from a conversation. It needs its own identity, provenance, confidence, visibility, and deletion policy. A memory record should say who or what it concerns, when it was observed, where it came from, and which tenant or permissions apply.

Do not treat a vector similarity result as the canonical fact. Keep the source record and its status in a transactional store, then attach an embedding for retrieval. This lets you revoke, correct, or expire a memory without relying on an approximate-nearest-neighbor index to behave like an authority.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Why PostgreSQL is the default production foundation

What belongs in PostgreSQL

  • Workflow runs, thread identifiers, checkpoints, and state versions
  • User, tenant, agent, and tool metadata
  • Messages and tool-call records, including replay and idempotency information
  • Audit events, policy decisions, retention markers, and deletion requests
  • References to large prompts, files, traces, or tool payloads stored in object storage

Transactions let you commit a state transition and its audit record together. Constraints can prevent duplicate event identifiers, invalid statuses, or cross-tenant references. Point-in-time recovery, replicas, and familiar SQL tooling make the operational model understandable to teams that already run relational systems.

Where PostgreSQL needs help

Relational filtering is excellent for exact conditions such as tenant, user, timestamp, source, or permission. Semantic recall requires an embedding index or another vector-capable service, and relationship traversal across many hops can become awkward when represented only as joins. Those are reasons to add specialized projections, not reasons to abandon the durable record.

Rank #2
EVEO® Screen Cleaner Spray Kit (Streak-Free) TV Screen Cleaner for Smart TV, Lcd, LEd, Oled | Computer Screen Cleaner Spray and Wipe Microfiber Cloth - TV, Monitor, Laptop, iPad, Car - 6.7oz 1 Pack
  • Screen Cleaner is Your Screen’s New Bestfriend! - EVEO is proud to present a screen cleaner that’s perfectly suited for your TV. Meet your new screen cleaner, computer screen cleaner, laptop cleaner, iPad cleaner, Macbook,tv cleaner or any other electronic device. Our screen cleaner spray and wipe along with the included plush microfiber cloth, easily removes dust, fingerprints & other smudges on the screen’s surface. Clean effectively for a streak-free screen
  • Gentle on your Screens - Our screen cleaner spray and wipes is compatible to be used even for the most sensitive LCD, LED, CRT, and OLED screens in proper use. Be at ease knowing that this product is compatible with all the major brands: LG, SONY, Samsung, Sharp, iPad, iPhone, Android screens, Kindle, PC monitors - we’ve got you covered! Can be used as LCD screen cleaner, tv cleaner, smart tv screen cleaner, and more
  • Premium Super Soft Plush Microfiber Cloth - Included in this efficient screen cleaning kit. This screen cleaner spray and wipe has our signature plush microfiber cloth specially designed to comply with screens and monitors and leave them streak-free. Has been shown to effectively absorbs stubborn stains, zero streaks, and no fiber shedding. Always use this together with our screen cleaner for the best results
  • Easy-to-Use Screen Cleaner Kit + microfiber cleaning cloth - The EVEO Screen Cleaning Kit will easily be your new favorite tool when it comes to taking care of the things you love most, quick and easy solution for a streak-free screen. Simply screw on the sprayer gun on the screen cleaner bottle. Spray the cleaning liquid onto the microfiber cloth, then wipe the screen until desired cleanliness & shine is achieved.
  • Quality Screen Care Kit Worth Purchasing - Enjoy a convenient Screen Cleaner anytime, anywhere you need it. Your satisfaction is our top priority. We stand behind the quality of our products and that’s why, you shouldn’t be worrying at all. We manufacture the Best Screen Cleaner. and can be used for laptop cleaning kit, laptop screen cleaner, tv screen cleaner for smart tv. MacBook screen cleaner, monitor cleaner or screen cleaner spray for electronic devices with microfiber cleaning cloth

Checkpoint design that survives retries

  1. Write an immutable event or version. Capture the input, step name, tool request, and resulting status.
  2. Apply the state transition in one transaction. Update the current-run pointer only after the new version and relevant audit record are durable.
  3. Use an idempotency key. Derive or assign a stable key for every externally visible tool operation.
  4. Resume from the latest committed version. A worker that restarts should replay only work whose completion is not recorded.
  5. Keep history long enough to diagnose and replay. Apply a documented retention schedule rather than deleting records opportunistically.

When Redis is the right memory layer

Redis is suited to information that must be read or written quickly and may have a bounded lifetime: the active conversation window, a lease, a lock, a rate-limit counter, a queue item, or a cached retrieval result. Its documentation describes vector embeddings combined with structured metadata for semantic search, real-time retrieval, and agent memory in Redis for AI and search. Its memory-layer guidance covers working state, durable semantic recall, audit trails, vector indexes, and metadata filters in Redis as a memory layer.

Good Redis workloads

  • Expiring thread context that is rebuilt from durable history when needed
  • Hot summaries or retrieved passages used repeatedly during a run
  • Distributed locks and short leases around workers
  • Queues and streams for asynchronous tool work
  • Vector search over embeddings when low-latency retrieval is a priority

Expiration is a policy, not a backup plan

Set explicit time-to-live values for ephemeral keys and document what happens when they disappear. A missing cache entry should trigger a rebuild; a missing canonical checkpoint should be treated as a recovery incident. If Redis is used for durable semantic recall, define persistence, replication, backup, and restore procedures that match the value of that memory. The required durability and recovery targets are application-specific; no universal latency, capacity, or price figure is established here.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use vector retrieval for meaning, not authority

Embedding search is useful when a user’s wording differs from the wording in stored material. An agent can retrieve similar conversation passages, product facts, procedures, or prior decisions even when exact keywords do not match. Store each vector with metadata such as tenant, user, source, creation time, expiration time, content type, and permission scope.

A safe semantic-memory record

  • Canonical identifier: points to the authoritative message, document, or fact.
  • Embedding: represents the text or structured content for similarity search.
  • Scope metadata: tenant, user, workspace, role, and permission boundary.
  • Provenance: source, extractor or tool, observation time, and model version where relevant.
  • Lifecycle fields: confidence, superseded-by reference, retention deadline, and deletion status.

Apply metadata filters before or during retrieval so one tenant cannot receive another tenant’s memories. Re-check authorization after retrieval and before putting content into a prompt. Similarity scores are ranking signals; they do not prove that a statement is current, true, or permitted.

Choosing where embeddings live

If your relational database already holds the canonical records and retrieval volume is moderate, adding a vector-capable index there can reduce synchronization work. Redis is attractive when the same data must support very fast reads, expiration, and operational metadata. A separate vector service can be justified at larger retrieval scale or when its indexing and filtering features are a first-class requirement. In every case, retain the authoritative record outside the approximate index and make re-indexing repeatable.

Rank #3
Sale
BladeHawks RGB Gaming Mouse Pad Extra Large Extended 31.5x12 Inch-Black | LED mouse pad with 14 lighting modes, covers keyboard & mouse, anti-slip rubber base, waterproof surface, USB powered
  • 【Large size】:Measuring 800 x 300 mm/ 31. 5×12 inches, which is wider and taller than others. Large mouse pad can perfectly fit your keyboard and mouse of any size, and there is also ample space for peripherals such as phones, tablets, etc.
  • 【LED backlight mouse pad】:Blade Hawks RGB mouse pad provides 7 static modes and 7 dynamic modes will give you the options you are looking for. Power-off memory function remembers the last lighting mode you selected. The super glow fiber Chroma will give you a colorful gaming setup that you want.
  • 【Anti-slip rubber base】:Made from Natural rubber, this gaming mousepad will firmly grip your desktop, allowing you to enjoy the ultimate precision in the games you are most passionate about. It also comes with a texture that enhances this ability even further.
  • 【Smooth and waterproof surface】: Micro-textured cloth surface, for extremely precise mouse control and a smooth movement. When liquid splashes on the gaming mouse pad, it forms water droplets and slides down. Will not delay your work or gameplay.
  • 【Plug and play】: This mouse and keyboard pad is powered by USB, plug and play, no driver required. One button control light modes. Press one time to change the lighting mode, press twice to change the brightness, press and hold about 3 seconds turn ON/OFF.

Choose Neo4j when relationships are the query

A graph database earns its place when the agent must answer questions such as “Which systems depend on this service?”, “What events led to this decision?”, or “Who approved the policy that affected this customer?” These are multi-hop questions over entities, events, causes, and dependencies, not just “find text that sounds similar.”

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Neo4j describes its Agent Memory Service as a persistent graph-native memory layer backed by Aura with native vector indexes in its Agent Memory Service overview. A graph projection can therefore combine relationship traversal with semantic candidate retrieval.

Model graph memory deliberately

  • Nodes: users, organizations, documents, services, tools, policies, and events.
  • Relationships: owns, depends on, caused, approved, mentioned, superseded, or follows.
  • Properties: timestamps, confidence, source identifiers, tenant scope, and validity intervals.
  • Provenance edges: connect an extracted fact to the message, tool result, or document that supports it.

Do not create a graph merely because “memory” sounds like a graph problem. If the agent only needs exact state transitions and filtered records, PostgreSQL is simpler. Add graph storage when traversal itself is a frequent, user-visible requirement.

A practical architecture for production agents

The following split keeps each persistence job explicit:

  1. PostgreSQL holds the source of truth. Store runs, checkpoints, messages, tool results, idempotency keys, audit metadata, memory records, and references to external blobs.
  2. Object storage holds large payloads. Put oversized files, raw tool responses, and trace artifacts there; retain stable object references, hashes, size, and content type in PostgreSQL.
  3. Vector indexes serve semantic recall. Embed approved messages, facts, and documents. Keep tenant, user, time, source, and permission metadata with every vector.
  4. Redis accelerates the hot path. Cache active context, maintain short-lived locks and queues, and optionally serve vector retrieval when its latency and filtering model fit the workload.
  5. A graph projection is optional. Publish relationship events from the canonical records and rebuild the projection when relationship traversal becomes a first-class feature.

Use an outbox or change-event pattern so secondary indexes receive durable updates after the source transaction commits. Consumers should be idempotent: processing the same event twice must not create duplicate memories or edges. Mark projections with a version or lag timestamp so the agent can avoid treating stale results as current.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #4
Sale
Vaydeer Wrist Rest for Keyboard and Mouse, Computer Ergonomic Wrist Support Pad, Soft Memory Foam Arm Cushion for Desk, Palm Hand Office Laptop Typing
  • 【Softer and More Comfortable】Vaydeer wrist rest has unique diamond pattern, which is the combination of softness and aesthetics. The materials of wrist rest are improved into higher quality memory foam and covered with silky smooth lycra. The computer wrist rest makes you as comfortable and cushiony as like rest your wrists on clouds.
  • 【Ergonomic Wrist Saver】The wrist rests for keyboard and mouse comes with a 17.32×3.15×0.83 inch keyboard wrist pad and a 5.94×3.15×0.83 inch mouse wrist support. Based on ergonomic design, the unique concave shape is the perfect fit for your wrist joints. The wrist rest pad fits most computer keyboards and laptops, improve hand and wrist posture, release your wrist and arm stress.
  • 【Non-Slip Rubber Bottom】Featuring an anti-skid silicone base on the bottom, this wrist keyboard support stays firmly in place on your desk, preventing the padding from sliding around, ensuring stable and consistent wrist support during extended computer sessions.
  • 【Better Experience & Pain Relief】Our keyboard arm rest is beneficial to alleviate the soreness caused by direct contact and friction between your arm and a hard desk surface, reducing the risk of wrist fatigue or carpal tunnel. The soft texture of memory foam can evenly distribute the pressure around your wrists and provide good support with just enough give.
  • 【Helpful in Multiple Scenarios】Whether you're working, studying, writing, typing, gaming, this keyboard and mouse rest combo is an essential accessory to add comfort and support to your hands and wrists. It’s also a great gift for men, women, family, friend, coworker, gamer, teacher, etc.

Define memory classes, retention, and deletion before launch

Give each class a named policy rather than applying one global retention period:

Memory class Typical contents Policy decisions
Working or thread memory Current messages, scratch state, pending tool calls Maximum size, expiration, rebuild procedure, and isolation by thread
Episodic memory Completed interactions, outcomes, and notable events Retention duration, provenance, summarization, and user deletion behavior
Semantic facts and preferences Stable preferences, approved facts, and extracted knowledge Confidence, review or supersession, authorization, and correction workflow
Audit history State transitions, tool calls, policy decisions, and access records Immutability, legal or contractual retention, restricted access, and export

Deletion must cover every copy: relational rows, object references, caches, vector entries, graph nodes, backups where applicable, and derived summaries. Record the deletion operation itself in the audit system without retaining the sensitive content that was removed. Tenant isolation should be enforced in database queries and service boundaries, not left to prompt instructions.

Decision framework: which combination fits your agent?

Primary requirement Recommended starting point Add or change when
Reliable pause, resume, retry, and audit PostgreSQL Add a vector index for semantic recall or Redis for hot operational data
Short-lived context and very frequent reads Redis plus PostgreSQL for durable records Persist anything that must survive expiration, restart, or regional failure
Semantic search across conversations or documents PostgreSQL records with a vector-capable layer Use Redis when low-latency caching, expiration, and metadata filtering are central
Multi-hop dependency, causality, or entity questions PostgreSQL source of truth plus a Neo4j projection Keep graph edges synchronized and provenance-linked to canonical events
Small prototype with one operational team One PostgreSQL deployment with explicit tables and indexes Split services only after measured workload or query requirements justify it

There is no meaningful universal winner on latency, throughput, capacity, or cost. Those values depend on data shape, embedding dimensions, query mix, hardware, replication, region, and retention. Benchmark your own traces instead of transferring a vendor’s performance claim to an architecture it did not test.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Evaluate the design with representative traces

Create a test set that includes normal conversations, long threads, concurrent workers, tool timeouts, duplicate deliveries, permission changes, deletions, and crashes at each checkpoint boundary. Measure:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • Write latency: time to durably commit a state transition and its audit record.
  • Read and retrieval latency: checkpoint load, metadata filtering, vector search, and graph traversal separately.
  • Retrieval precision: whether returned memories are relevant, current, authorized, and supported by provenance.
  • Stale-state rate: how often a worker sees an outdated checkpoint or projection.
  • Crash recovery: whether a restart resumes exactly once or safely repeats only idempotent work.
  • Replay correctness: whether rebuilding a run from recorded events produces the expected state.
  • Tenant isolation: adversarial checks for cross-tenant rows, vectors, cache keys, and graph paths.
  • Deletion correctness: confirmation that requested data disappears from primary and derived stores.

Test failure modes deliberately: a database restart during commit, a queue message delivered twice, an embedding job delayed for hours, a graph projection that lags, and an expired Redis key. The desired result is not that every component remains available; it is that the agent fails safely, reports uncertainty, and can rebuild from durable records.

Best Value
Sale
Under Desk Cable Management Tray No Drill, Metal Mesh Cable Management Under Desk with Clamp Mount, 2 Hole Cable Tray with Wire Management and Cord Organizer for Home Office Standing Desk
  • 【No Drill Mounted】Cable management tray can be assembled in as little as 3 minutes or less-simply. Side clips easily clampe the edge of desk, pass through the holes on the sides, and secure excess cables with baskets. Desk cable management supports inward or outward installation to meet your needs in different scenarios, and provides you with great convenience when collecting and organizing wires.
  • 【Rubber Pad Protects Desk】Wire organizer under desk built-in soft rubber pads on the clamp protect your desk from scratches, so you will not damage your furniture or office.
  • 【Sturdy and Beautiful】Cord management under desk is made of high-quality carbon steel and holds about 15 lbs. The wire basket has 2 holes on each side of the tray to enable your cables to pass freely. Cable baskets are suitable for desk thickness use from 0.4" to 2.4".
  • 【Space Saving & Keep Organized】Desk cable management tray holds all your power cords, outlet strips, USB hubs and computer transformers hidden from your feet, and the data cables will not enter the vacuum cleaner to keep your desk clean and tidy. Desk wire organizer is also suitable for use in the kitchen and outdoors.
  • 【Reduce Safety Risks】Cable tray under desk keeps all plugs away from your kids, no more worry about tripping. Using 2 holes wire tray saves extra space, helps you easily cabling and wire protection. The mesh design is not easy to accumulate dust, but avoids safety accidents caused by messy wires.

Common design mistakes and fixes

Putting the only checkpoint in a cache

Symptom: a worker restart loses the conversation or repeats an external action. Fix: commit checkpoints and idempotency data to PostgreSQL; use Redis only as an acceleration or explicitly durable layer with tested restore procedures.

Treating top-k vector results as facts

Symptom: the agent cites an old, unauthorized, or weakly related memory. Fix: filter by tenant and permissions, validate freshness and provenance, and resolve the canonical record before generation.

Embedding everything forever

Symptom: stale preferences continue to influence responses and deletion requests are difficult to fulfill. Fix: classify memories, set retention and supersession rules, and make vector and graph deletion part of the same lifecycle workflow.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Building a graph without a graph question

Symptom: complex synchronization and modeling work with no better user-visible answer. Fix: start with relational records and add a graph projection only when multi-hop traversal is measured as a core requirement.

Ignoring projection lag

Symptom: semantic or graph retrieval disagrees with the latest workflow state. Fix: attach source versions and lag timestamps, prefer the canonical record for decisions, and provide a rebuild path for every derived index.

Migration path from a prototype

  1. Inventory current state. List every field held in prompts, process memory, files, caches, and ad hoc logs.
  2. Classify it. Mark each item as working state, episodic event, semantic fact, or audit history.
  3. Create durable identifiers. Assign tenant, user, thread, run, event, and source IDs before moving data.
  4. Move checkpoints first. Make pause, retry, and crash recovery reliable before optimizing retrieval.
  5. Add metadata and lifecycle fields. Include provenance, permissions, timestamps, confidence, supersession, and deletion status.
  6. Build derived indexes asynchronously. Populate vectors or graph edges from canonical records and verify counts and versions.
  7. Run dual reads during validation. Compare old and new retrieval, investigate mismatches, then remove the prototype path.
  8. Exercise restore and deletion. A migration is incomplete until backups restore and user or tenant deletion reaches every derived store.

Final recommendation

Start with PostgreSQL for durable workflow state and long-term records. Add semantic indexing only for memories the agent must retrieve by meaning, and attach strict metadata and provenance to every vector. Use Redis for hot, expiring, or coordination-heavy data when its operational guarantees match the workload. Add Neo4j when relationship traversal—not merely text similarity—is the central retrieval problem. This layered approach keeps correctness in one recoverable system while allowing specialized stores to make the agent fast and context-aware.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.