# Bedrock Knowledge Base Idle

> Bedrock knowledge bases showing zero RetrieveInvocations and RetrieveAndGenerateInvocations across a 30-day lookback are idle, yet their dedicated OpenSearch Serverless vector store keeps billing. ZopNight requires at least one metric to carry real datapoints before proving idleness, then recommends deletion with savings equal to the joined vector-store monthly cost.

Source: https://zop.dev/integrations/aws/recommendations/bedrock-knowledge-base-idle
Updated: 2026-08-19

---

## Telling an empty retrieval series from a real zero

- resource.Type: bedrock-kb
- MetricsAware: at least one of RetrieveInvocations / RetrieveAndGenerateInvocations, [the retrieval counters named in Bedrock's monitoring reference](https://docs.aws.amazon.com/bedrock/latest/userguide/monitoring.html), present. AUTHORITATIVE-IDLENESS guard (bedrockKBHasRealSeries): these signals are published to CloudWatch Logs (not a CW metric series), so on real data the series is present-but-empty; the rule requires at least one present metric to carry real data (a finite datapoint or non-zero scalar) before proving idleness; otherwise it abstains (firing on the phantom-zero shape would flag every KB, fail-open). Then abstains if either present metric shows activity.
- pricing: the linked vector store's monthly cost (joined onto the KB UID by the aggregator; see PRODUCER below).

## The 30-day retrieval lookback

```text
bedrockKBLookbackDays=30
```

## How the vector store cost is joined onto the KB

concrete-or-abstain (Category orphan: deleting an idle KB plus its underlying vector store recovers the full standing vector-store cost, a concrete cleanup lever). savings = cost, optimized = 0. PRODUCER (wired end-to-end, 2026-06-30):
1. Discoverer (bedrock_agent.go enrichKBs) stamps metadata.vectorStoreUID = the bare collection id from the KB's storageConfiguration.OpensearchServerlessConfiguration.CollectionArn (no extra SDK call, since GetKnowledgeBase already fetched). It equals the opensearch-serverless resource's UID (see discoverer LIVE.md).
2. Aggregator (cost.JoinBedrockKBVectorStoreCost, called by ComputeResourceCosts) joins the dedicated collection's MonthlyCost onto the otherwise-free KB, and only when exactly one KB references that collection (no double-count; the collection keeps its own row). See aggregator COST.md (opensearch-serverless).
3. Recommender (this rule) reads the joined cost via SetPricing[kbUID] and fires concretely with savings = cost when it is positive, abstains when it is $0/absent.

## Deleting the KB and its vector store

1. Confirm no application or agent depends on this KB
2. Export source documents from S3 if needed
3. Delete the KB and its associated OpenSearch Serverless / Pinecone collection
4. Verify the underlying vector store no longer accrues charges

## The two retrieval invocation counters

RetrieveInvocations, RetrieveAndGenerateInvocations (30-day lookback)
