plexus.analysis.s3vectors_client module
S3 Vectors client for Semantic Reinforcement Memory.
Thin adapter around boto3 s3vectors operations with helper methods used by the VectorTopicMemory report block.
- class plexus.analysis.s3vectors_client.TopicMemoryVectorStore(bucket_name: str, index_name: str, region: str, index_arn: str | None = None, client=None)
Bases:
objectS3 Vectors-backed topic memory store.
Supports health check, full rebuild, cluster persistence, and cluster metadata updates used by Semantic Reinforcement Memory.
- __init__(bucket_name: str, index_name: str, region: str, index_arn: str | None = None, client=None)
- build_index(documents: List[Dict[str, Any]], old_index_for_swap: str | None = None) Dict[str, Any]
Rebuild index contents by clearing existing vectors and writing new items.
old_index_for_swap is accepted for API compatibility with the previous vector store adapter and intentionally ignored.
- bulk_update_cluster_weights(clusters: List[Dict[str, Any]], index_name: str | None = None) None
Update memory_weight and memory_tier on existing cluster vectors.
- clear_index(index_name: str | None = None) int
Delete all vectors in the index. Returns number of deleted vectors.
- find_nearest_clusters(embedding: ndarray, k: int = 5, threshold: float | None = None) List[Dict[str, Any]]
Query nearest cluster vectors.
Returns results ordered by descending similarity with compatibility fields. threshold is interpreted as a minimum similarity score, matching prior vector store adapter behavior.
- get_all_clusters() List[Dict[str, Any]]
Retrieve all cluster vectors from the index.
- health_check() bool
Return True if the configured vector index is reachable.
- persist_clusters(clusters: List[Dict[str, Any]], index_name: str | None = None) None
Bulk-persist cluster vectors and metadata.