Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[FEATURE] elasticsearch memory toolΒ #278

@ayanray089

Description

@ayanray089

Problem Statement

Problem Statement / Use Case

Strands agents presently lacks support for Elasticsearch.
Elasticsearch is one of the most popular vector stores with:

  • πŸ“Š 1.45+ billion downloads
  • ⭐ 75,000+ GitHub stars
  • 🏒 Massive enterprise adoption

Users who prefer Elasticsearch (due to familiarity and existing infrastructure) cannot use it with strands limiting memory options and creating inconsistency in the ecosystem.

Proposed Solution

Implement ElasticsearchMemoryToolProvider that provides:

Core Capabilities

  • βœ… Semantic Search: Vector embeddings with k-NN similarity search
  • βœ… Hybrid Search: Combine vector and text search capabilities
  • βœ… Dual Deployment Support: Elasticsearch Cloud + Serverless
  • βœ… Enterprise Ready: Multi-tenant namespaces, error handling
  • βœ… Strands Integration: Follows existing memory tool patterns

Technical Features

  • Connection Flexibility: Support both cloud_id and URL-based connections
  • Full CRUD Operations: record, retrieve, list, get, delete
  • Amazon Bedrock Integration: Titan embeddings (1024-dim vectors)
  • Namespace Isolation: Multi-tenant memory separation
  • Environment Configuration: Flexible setup options

Benefits

For Strands Platform

  • 🎯 Market Expansion: Tap into Elasticsearch's massive user base
  • πŸ”§ Enterprise Appeal: Support existing infrastructure investments
  • πŸ“ˆ Adoption Acceleration: Remove migration barriers

For Users

  • πŸ’° Cost Efficiency: Leverage existing Elasticsearch infrastructure
  • ⚑ Performance: Battle-tested, scalable vector search
  • πŸ› οΈ Operational Simplicity: No new systems to learn/maintain
  • πŸ”’ Enterprise Features: Security, compliance, monitoring built-in

Implementation Status

πŸ”— Pull Request: 277[https://github.com//pull/277] - Complete implementation ready for review

Implementation Highlights:

  • Full ElasticsearchMemoryToolProvider class (674 lines)
  • 19 comprehensive unit tests with mocking
  • Complete documentation with usage examples
  • Environment variable configuration support
  • Follows agent_core_memory.py patterns exactly

Usage Example

# Elasticsearch Cloud
provider = ElasticsearchMemoryToolProvider(
    cloud_id="your-elasticsearch-cloud-id",
    api_key="your-api-key",
    namespace="user_123"
)

# Elasticsearch Serverless
provider = ElasticsearchMemoryToolProvider(
    es_url="https://your-serverless-cluster.es.region.aws.elastic.cloud:443",
    api_key="your-api-key",
    namespace="user_123"
)

agent = Agent(tools=provider.tools)

# Semantic memory operations
agent.tool.elasticsearch_memory(action="record", content="User prefers vegetarian pizza")
agent.tool.elasticsearch_memory(action="retrieve", query="food preferences", max_results=5)

Use Case

This feature enables Elasticsearch users to build agentic AI workflows using strands using Elasticsearch for Agentic AI Memory.

Customer Need: Organizations already using Elasticsearch want to continue leveraging Elasticsearch for memory and interested to use strands as memory.

Alternatives Solutions

No response

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions