Quickstart (AWS)
Wire memledger to Aurora PostgreSQL + Bedrock — the canonical AWS production path. You'll use Aurora for vector storage and Bedrock Titan for embeddings.
For getting started without AWS credentials, use the OSS quickstart (in-cluster Postgres + local fastembed) and graduate here later.
0. Prerequisites
- An AWS account with Bedrock model access for
amazon.titan-embed-text-v2:0(request access in the Bedrock console — typically minutes). - An Aurora PostgreSQL cluster (≥ 14) with the
vectorextension enabled. RDS Postgres also works. - AWS credentials available to your shell (
AWS_PROFILEorAWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY).
1. Install
pip install "memledger[aws]"
The [aws] extra includes Aurora-via-pgvector storage and Bedrock embeddings. Add [aws,opensearch] to opt into OpenSearch k-NN as the vector store.
2. Enable pgvector on Aurora
Run once against your Aurora cluster:
CREATE EXTENSION IF NOT EXISTS vector;
For Aurora IAM database authentication, set iam_auth: true in backend_config and memledger will mint short-lived tokens via boto3 at connection time:
ml = await Memledger.create(
backend_name="pgvector",
backend_config={
"host": "<your-aurora-cluster-endpoint>",
"port": 5432,
"database": "memledger",
"user": "memledger",
"iam_auth": True,
"region": "<your-region>",
},
embedding_config=EmbeddingConfig(
provider="bedrock",
model="amazon.titan-embed-text-v2:0",
dimensions=1024,
),
)
The agent's IAM principal needs rds-db:connect on the cluster's resource ID + master user ARN. See Aurora PostgreSQL for the full IAM setup.
3. Write and search a memory
import asyncio
import os
from memledger import Memledger
from memledger.models import EmbeddingConfig
AURORA_DSN = os.environ["MEMLEDGER_AURORA_DSN"]
# postgresql://USER:PASS@<your-aurora-cluster-endpoint>:5432/memledger
async def main():
ml = await Memledger.create(
backend_name="pgvector",
connection_string=AURORA_DSN,
embedding_config=EmbeddingConfig(
provider="bedrock",
model="amazon.titan-embed-text-v2:0",
dimensions=1024,
),
)
await ml.add(
content="EKS node group rotation: drain at 5% capacity, not 0%, to avoid pod eviction storms",
namespace="/ops/eks/runbooks",
confidence=0.9,
created_by="sre-agent",
)
results = await ml.search(
query="how to drain EKS nodes safely",
namespace="/ops/eks/runbooks",
)
for r in results.records:
print(r.confidence, r.created_by, "::", r.content)
await ml.close()
asyncio.run(main())
The same chain demo from Quickstart (OSS) works unchanged here — only the backend config differs.
4. Optional: alternative AWS backends
pip install "memledger[aws,opensearch]" # OpenSearch k-NN as the vector store
See the AWS backend pages for setup details:
Where next
- kagent on EKS — production agentic deployment with three validated agents
- Concepts — memory record, provenance, effective confidence, MQS
- Governance — Confidence gating
- Evaluation — MAI