Agentic AI Data Infrastructure: What AI Agents Need From Your Data
Hosting decides where an agent runs. The data layer decides whether it gives correct answers and stays inside each user's permissions: retrieval, memory, access to live systems, freshness, permissions and audit.
Published November 29, 2026 · HostingX Solutions LLC
Short answer
Agentic data infrastructure is everything between an AI agent and your data: indexes it retrieves context from, memory it keeps per session and per user, tools that reach live systems, pipelines that keep all of it current, permission checks for the end user, and traces of what it read and did.
For retrieval, combine vector and keyword search. Azure AI Search runs both in one request and merges them with Reciprocal Rank Fusion; with pgvector you pair it with Postgres full-text search. Managed options include Amazon Bedrock Knowledge Bases, Google's RAG Engine and Azure AI Search.
Keep short-term memory (the session) separate from long-term memory (facts across sessions), and scope both to a user. AgentCore Memory uses actor and session IDs with namespaces; Google's Memory Bank keeps an isolated collection per scope.
Enforce the end user's permissions at retrieval time, not in the prompt. Bedrock's ACL-aware retrieval and Azure AI Search's document-level access filter results per user, and both depend on your app authenticating that user first.
What Is Agentic Data Infrastructure?
A chatbot answers from what it was trained on plus whatever you paste into the prompt. An agent plans, looks things up, calls tools and changes records, often over many steps. Every one of those steps depends on data: which documents it retrieves, what it remembers about the user, which live systems it can query, and whether the user it acts for is allowed to see the result.
That data layer is separate from the compute that runs the agent loop. Our guide to agentic AI infrastructure covers where agents run (queues, workers, Kubernetes), and the comparison of AI agent runtimes covers managed hosting such as Amazon Bedrock AgentCore Runtime. This article covers the six data layers underneath:
| Layer | What it does for the agent | Typical building blocks |
|---|---|---|
| Context (retrieval) | Finds the documents, records and passages relevant to the current step | Vector and keyword indexes, hybrid search, rerankers, managed knowledge bases |
| Memory | Keeps the current session and what the agent learned about a user across sessions | Session event stores, long-term memory services, a table keyed by user |
| Access to live systems | Reads and changes current data in business systems instead of a copy | MCP servers, internal APIs, SQL with scoped credentials |
| Freshness | Keeps indexes and memory in step with the systems of record | Change data capture, connector syncs, scheduled re-ingestion |
| Permissions | Returns only what the end user is allowed to see | Document-level ACL filtering, row-level security, per-user tokens |
| Audit and observability | Records what was retrieved, which tools ran and what it cost | OpenTelemetry GenAI spans, retrieval traces, logs |
Retrieval: Vector, Keyword and Hybrid Search
Retrieval is the context layer: the agent turns its current step into a query and gets back the passages it should reason over. Vector search finds passages that mean the same thing as the query even without shared words. Keyword (full-text) search finds exact matches. Microsoft's Azure AI Search documentation names the cases where keyword search wins: product codes, specialized jargon, dates and people's names. Agents hit those constantly, because they look up order numbers, ticket IDs and customer names.
Hybrid search runs both and merges the results. In Azure AI Search, a hybrid query is a single request with both search and vectorQueries parameters; the two run in parallel and the results are merged with Reciprocal Rank Fusion (RRF) into one result set, with optional semantic reranking on top.
Hybrid search in Postgres with pgvector
If your data already lives in PostgreSQL, the pgvector extension adds vector columns, exact and approximate nearest-neighbor search, and HNSW and IVFFlat indexes. A few limits matter when you design the schema:
The
vectortype stores up to 16,000 dimensions, but HNSW and IVFFlat indexes cover up to 2,000 dimensions forvectorand 4,000 forhalfvec. Larger embeddings need half-precision indexing, binary quantization or dimensionality reduction.With approximate indexes, filters are applied after the index scan, so a filtered query (for example, one tenant's rows) can return fewer results than you asked for. From version 0.8.0, iterative index scans keep scanning until enough rows match, up to
hnsw.max_scan_tuples(20,000 by default).pgvector's README recommends combining it with Postgres full-text search for hybrid search, and merging the two result lists with Reciprocal Rank Fusion or a cross-encoder.
-- Let filtered HNSW queries keep scanning until enough rows match (pgvector 0.8.0+)
SET hnsw.iterative_scan = relaxed_order;
-- Hybrid search: pgvector similarity + Postgres full-text rank,
-- merged with Reciprocal Rank Fusion. $1 = query embedding,
-- $2 = query text, $3 = tenant. 60 is the RRF smoothing constant; tune it.
WITH semantic AS (
SELECT id, ROW_NUMBER() OVER (ORDER BY embedding <=> $1) AS rank
FROM chunks
WHERE tenant_id = $3
ORDER BY embedding <=> $1
LIMIT 20
),
keyword AS (
SELECT id, ROW_NUMBER() OVER (ORDER BY ts_rank_cd(tsv, q) DESC) AS rank
FROM chunks, plainto_tsquery('english', $2) AS q
WHERE tsv @@ q AND tenant_id = $3
ORDER BY ts_rank_cd(tsv, q) DESC
LIMIT 20
)
SELECT COALESCE(s.id, k.id) AS id,
COALESCE(1.0 / (60 + s.rank), 0) + COALESCE(1.0 / (60 + k.rank), 0) AS score
FROM semantic s
FULL OUTER JOIN keyword k ON s.id = k.id
ORDER BY score DESC
LIMIT 5;Assumes a chunks table with an embedding vector column, a tsv tsvector column and an HNSW index on embedding using cosine distance.
Managed Retrieval Services Compared
The cloud providers now package ingestion, chunking, embedding, indexing and retrieval as one service. The differences that matter for agents are which sources they connect to, whether hybrid search is built in, whether they filter by the end user's permissions, and how an agent calls them.
| Service | Sources | Index and store | Hybrid search | Per-user permissions | Agent integration |
|---|---|---|---|---|---|
| Amazon Bedrock Managed Knowledge Base | Native connectors for Amazon S3, SharePoint, Confluence, Google Drive, OneDrive, Web Crawler and Custom | Auto-scaling datastore managed by Bedrock; managed embedding and reranking models by default | "Agentic and semantic hybrid retrieval", plus agentic retrieval that splits complex queries into sub-queries | ACL-aware filtering on every connector except Web Crawler | Callable as an MCP tool through AgentCore Gateway |
| Amazon Bedrock customer-managed knowledge base | Amazon S3 and Custom | Your vector store, for example OpenSearch Serverless, Amazon Aurora or Amazon Neptune | Your choice of search strategy | Document-level permissions are available only on Managed Knowledge Bases | No native AgentCore Gateway integration |
| Google RAG Engine (Gemini Enterprise Agent Platform) | Local files, Cloud Storage and Google Drive, among others | RagManagedDb (a RAG Engine-managed Spanner instance, the default), Vector Search, Pinecone; Feature Store and Weaviate in preview | Listed only for Weaviate (preview) | Not covered on the overview pages | Gemini Enterprise Agent Platform and the Vertex AI SDK |
| Azure AI Search (now Foundry IQ) | Indexers for SharePoint, ADLS Gen2, Blob Storage and OneLake, plus a push API | Vector fields in the search index, next to text fields | Full-text and vector queries in one request, merged with Reciprocal Rank Fusion; optional semantic ranker | Security filters, ACL and RBAC scopes, SharePoint ACLs; Purview sensitivity labels in preview | Knowledge bases, with a knowledge_base_retrieve MCP tool |
| PostgreSQL with pgvector (self-managed) | Whatever you load | Your Postgres; HNSW and IVFFlat indexes | Combine with Postgres full-text search, then merge with Reciprocal Rank Fusion or a cross-encoder | Your SQL, for example row-level security policies | Your own tool or MCP server |
From each vendor's documentation, November 2026. Microsoft now documents Azure AI Search as “Foundry IQ (Azure AI Search)”. Google documents RAG Engine as a component of Gemini Enterprise Agent Platform.
On AWS, Amazon now recommends the Managed Knowledge Base type, where Bedrock runs the ingestion, datastore and retrieval. The older customer-managed type is for teams that need direct control of their own vector store; AWS notes that third-party connectors, document-level permissions and AgentCore Gateway integration are only available on Managed Knowledge Bases.
Agent Memory: Sessions and Long-Term Memory
Memory comes in two kinds, and they need different storage:
Short-term memory is the session: each turn, tool result and intermediate step, so the agent can follow “what about tomorrow?” or resume after a restart.
Long-term memory is what survives across sessions: preferences, facts and summaries the agent extracted earlier, retrieved when relevant rather than replayed in full.
| Option | Short-term (session) | Long-term | Isolation | Retrieval |
|---|---|---|---|---|
| Amazon Bedrock AgentCore Memory | Events written with CreateEvent, tagged with a sessionId and actorId | Extracted asynchronously by strategies: semantic, user preference, summary and episodic, or your own | Namespaces such as /strategy/{memoryStrategyId}/actor/{actorId}/ | Semantic search with RetrieveMemoryRecords |
| Google Agent Platform Memory Bank | Agent Platform Sessions store the conversation history | Generated by an LLM that extracts facts and consolidates them with existing memories | An isolated collection of memories for each scope | Fetch all memories, or similarity search scoped to one identity; optional TTL |
| Self-built on Postgres | A messages table keyed by session | Facts your own code extracts, stored with their source | A user or tenant column enforced with row-level security | pgvector similarity search plus SQL filters |
Amazon Bedrock AgentCore Memory
Your agent writes each interaction as an event with CreateEvent, tagged with a sessionId and an actorId (usually the end user). Long-term memory is generated asynchronously by the strategies you enable on the memory resource (semantic facts, user preferences, session summaries and episodes), which extract information from events and consolidate it with existing records. If no strategy is configured, no long-term records are extracted. RetrieveMemoryRecords runs a semantic search over the extracted records.
Long-term records are saved under a namespace you define. AWS recommends a leading and trailing slash so one user's prefix can't match another's in a multi-tenant application:
# Most granular: one user's memories from one session
/strategy/{memoryStrategyId}/actor/{actorId}/session/{sessionId}/
# One user's memories across all sessions
/strategy/{memoryStrategyId}/actor/{actorId}/AWS also notes that event metadata (key-value pairs you attach to events for filtering) isn't encrypted with a customer-managed key, so keep sensitive content out of it.
Google Agent Platform Memory Bank
Memory Bank generates long-term memories from conversations stored in Agent Platform Sessions, or from memories you write directly. An LLM extracts the meaningful facts and consolidates them with what is already stored, so memories change as new information arrives. Each scope gets an isolated collection, retrieval can be a similarity search scoped to one identity, and memories can carry a time to live so stale facts are deleted.
Google's documentation also names the main risk of any long-term memory: memory poisoning, when false information is stored and then trusted in later sessions. Its recommendations are inspecting prompts with Model Armor, adversarial testing, and sandboxed execution for actions against external systems. The same applies if you build memory yourself: store where each fact came from, and don't let content from untrusted documents write to memory without review.
Access to Live Systems: MCP and APIs
Indexes are copies. When an agent needs the current order status, the open invoice or the latest ticket comment, it should query the system of record through a tool. The Model Context Protocol (MCP) has become the standard way to expose those tools. Its specification (current revision 2026-07-28) uses JSON-RPC 2.0 messages, and servers offer three kinds of features:
Resources: context and data, for the user or the model to use.
Prompts: templated messages and workflows for users.
Tools: functions for the model to execute.
The specification is direct about the risk: tools represent arbitrary code execution, hosts must obtain explicit user consent before invoking any tool, and tool descriptions should be treated as untrusted unless they come from a trusted server. For servers reached over HTTP, MCP authorization is based on OAuth 2.1. MCP servers must publish OAuth Protected Resource Metadata (RFC 9728), clients must name the server they want a token for with Resource Indicators (RFC 8707), and servers must only accept tokens issued for them. Passing a user's upstream token straight through to another API is ruled out.
In practice that means separate read and write tools, credentials scoped to the user the agent is acting for, and an approval step before tools that change records or spend money. Our guide to running MCP servers in production covers hosting, OAuth and security for these servers. Managed retrieval is moving onto MCP too: a Bedrock Managed Knowledge Base can be exposed to MCP-compatible agents through AgentCore Gateway, and Azure AI Search knowledge bases offer a knowledge_base_retrieve MCP tool.
Freshness: Change Data Capture and Syncs
An index is only as current as its last sync. For documents that change weekly, a scheduled re-ingestion is enough. For operational data, such as orders, accounts and tickets, use change data capture (CDC): stream every insert, update and delete from the database's transaction log, then re-chunk, re-embed and upsert only what changed, and remove deleted records from the index.
Debezium is the common open-source option. It reads the transaction log (the binlog for MySQL, a logical replication stream for PostgreSQL) and runs in three ways: as Kafka Connect source connectors, as Debezium Server, which streams change events to systems such as Amazon Kinesis, Google Cloud Pub/Sub or Apache Pulsar without Kafka, or as an engine embedded in a Java application. Its source connectors include MySQL, MariaDB, PostgreSQL, SQL Server, Oracle, Db2, MongoDB, Cassandra and CockroachDB.
Permissions have a freshness problem of their own. In a Bedrock Managed Knowledge Base, group memberships are only as fresh as the last sync; for connectors such as SharePoint, Google Drive and Confluence, Bedrock also checks access in real time with the source before returning a document. In Azure AI Search, ADLS Gen2 ACLs are indexed snapshots refreshed roughly daily by default, and Microsoft states there is no immediate revocation or corpus-wide freshness guarantee. For data where a revoked permission must take effect at once, have the agent query the source system through a tool instead of an index.
Permissions: Enforce the User's Access at Retrieval Time
The most common design flaw in agent data access is a single service identity that can read everything, with “only answer from documents the user may see” written into the prompt. A prompt is not an access control. Filter results by the end user's permissions before they reach the model:
Amazon Bedrock Managed Knowledge Bases ingest allowed and denied users and groups with each document and filter results by the user context you pass at query time. Deny overrides allow, and errors fail closed. AWS is explicit that this is “ACL-aware filtering, not a security boundary”: your application must authenticate the user and pass a verified identity, matched by email.
Azure AI Search evaluates the delegated user's Microsoft Entra token, sent in the
x-ms-query-source-authorizationheader, against permission metadata from ADLS Gen2, Blob Storage or SharePoint. These native ACL, RBAC-scope and SharePoint options are generally available in REST API version 2026-10-01. For other identity systems, security filters match a user or group string you pass with the query.PostgreSQL row-level security applies a policy to every query once it is enabled on a table, with a default-deny when no policy exists. Table owners, superusers and roles with
BYPASSRLSbypass it, so the agent's database role should be none of those.
-- Each request sets the authenticated user's tenant before running agent queries
ALTER TABLE chunks ENABLE ROW LEVEL SECURITY;
CREATE POLICY tenant_isolation ON chunks
USING (tenant_id = current_setting('app.tenant_id')::uuid);
-- In the request handler, inside a transaction:
SET LOCAL app.tenant_id = '6f1c2d3e-0000-4000-8000-000000000001';Apply the same rule to memory: one actor or scope per end user, never a shared bucket, so one user's remembered facts can't surface in another's session. For keys and credentials the agent's tools use, see secrets management with Vault and AWS SSM.
Audit and Observability
When an agent gives a wrong answer, you need to know what it retrieved, which tools it called, and with what arguments. OpenTelemetry's GenAI semantic conventions, now maintained in their own repository and still in Development status, define spans for this:
invoke_agentspans for agent runs, withgen_ai.conversation.idfor the session andgen_ai.data_source.idfor the grounding data source.A
gen_ai.retrievalspan for retrieval, withgen_ai.retrieval.top_k. Recording the query text and the returned document IDs and scores is opt-in, which is the right default if queries contain personal data.execute_toolspans named after the tool, and token counts ingen_ai.usage.input_tokensandgen_ai.usage.output_tokens.
Bedrock Managed Knowledge Bases also integrate with AgentCore Observability for retrieval traces and per-knowledge-base metrics. Traces answer “what happened”; for checking answer quality over time, see LLMOps and preventing model drift, and for cost per agent run, see GenAI unit economics.
Reference Architecture
Authenticated user (OIDC / Entra ID / Cognito)
|
v
Agent runtime (session = user)
+-----------------------+------------------------+
| | |
v v v
Retrieval API Memory service MCP tool servers
hybrid search, short-term events, read tools, write tools
per-user filters long-term records, with approval, scoped
| scope per user OAuth tokens
v |
Search index / pgvector v
^ Systems of record
| (CRM, ERP, tickets, DBs)
Ingestion: connectors, chunking, |
embedding, ACL metadata <----- change data capture ----+
All components --> OpenTelemetry traces (retrieval, tools, tokens) --> audit logThe pattern keeps three rules. The user's identity travels with every request. Indexes and memory are copies that CDC or syncs keep current. Anything that must be exact or current comes from the system of record through a tool.
Checklist for Agent Data Infrastructure
Hybrid retrieval (vector plus keyword) for any corpus with IDs, codes or names, and a reranker if answer quality needs it.
Chunks stored with source, tenant and permission metadata, so filters work on every chunk, not just the parent document.
Per-user permission filtering at retrieval time, with the user authenticated before the agent runs.
Short-term and long-term memory scoped per user, with a time to live and the source of each stored fact.
CDC or scheduled syncs for each source, including deletes, with the sync lag known and monitored.
MCP or API tools for live data, split into read and write tools, with approval on writes.
Traces for retrieval, tool calls and tokens, tied to the session ID, with query text recorded only where policy allows.
Embeddings sized for your index limits (for example, pgvector indexes up to 2,000 dimensions for
vector).
Frequently Asked Questions
What is agentic data infrastructure?
The systems that supply an AI agent with data and control what it can reach: retrieval indexes, session and long-term memory, tools that read and write live systems, pipelines that keep copies current, permission checks for the end user, and traces. It sits beside the runtime that hosts the agent loop.
Do AI agents need a vector database?
Most need vector search somewhere, but not necessarily a separate database. pgvector adds it to PostgreSQL, and managed services such as Amazon Bedrock Knowledge Bases, Google's RAG Engine and Azure AI Search include the index. Pair vector search with keyword search for exact terms such as IDs and names.
What is the difference between RAG and agent memory?
RAG retrieves from a shared corpus such as documents, policies and tickets. Memory stores what one user said or what the agent learned in earlier sessions, scoped to that user. Both use similarity search, but memory needs per-user isolation and protection against false facts being stored.
How do agents get real-time data?
Through tools that query the system of record directly, usually exposed as MCP servers or internal APIs, and through change data capture that keeps indexes current. Indexes alone always lag the source by the sync interval.
How do you stop an agent from returning data a user shouldn't see?
Authenticate the user, pass that identity with every retrieval and tool call, and filter results in the data layer: document-level ACL filtering in Bedrock or Azure AI Search, row-level security in Postgres, and user-scoped OAuth tokens for MCP tools. Don't rely on instructions in the prompt.
Connecting agents to your data?
We help US businesses build the data layer behind production AI agents: retrieval, memory, MCP tool access, change data capture, permissions and tracing. The first 30-minute consultation is free.
Sources
Related Articles
Agentic AI Infrastructure
Where to run agents: queues, workers, vector databases and monitoring.
AI Agent Runtimes Compared
AgentCore Runtime, Google Agent Runtime, Foundry hosted agents and self-hosting.
Running MCP Servers in Production
Hosting, OAuth and security for the tools your agents call.
LLMOps and Model Drift
Evaluating agent and model quality after launch.
See also: DevOps and automation services · GenAI unit economics · Agent workflows on n8n
Services
Subscribe to our newsletter
Get monthly email updates about improvements.
© 2026 HostingX Solutions LLC. All Rights Reserved.
LLC No. 0008072296 | Est. 2026 | New Mexico, USA
Terms of Service
Privacy Policy
Acceptable Use Policy