Skip to content

Conversation

@aayush3011
Copy link

🚀 Summary

This PR introduces a comprehensive suite of Azure CosmosDB NoSQL tools for CrewAI, enabling advanced memory management, vector search capabilities, and intelligent semantic caching for multi-agent applications.

✨ New Features

🔍 Vector Search Tool

  • Semantic similarity search using vector embeddings
  • Hybrid search combining vector and full-text search with RRF (Reciprocal Rank Fusion)
  • Configurable similarity thresholds and result limits
  • Cross-partition querying for comprehensive search

⚡ Semantic Cache Tool

  • Intelligent LLM response caching using semantic similarity
  • Cost optimization by reducing redundant API calls
  • TTL support for automatic cache expiration
  • OpenAI/Azure OpenAI integration for embedding generation

🧠 Memory Store Tool

  • CRUD operations for agent memory management (conversation history, short/long-term memory)
  • Hierarchical partition key support for multi-agent isolation
  • Flexible memory types with generic content storage
  • Batch operations for efficient data management

🧪 Testing

  • 55+ comprehensive test cases covering all functionality
  • Extensive mocking for Azure CosmosDB and OpenAI APIs
  • Edge case coverage including error handling and validation
  • 100% test coverage for critical paths

📚 Documentation

  • Detailed README files for each tool with usage examples
  • Azure CosmosDB documentation links for relevant features
  • End-to-end CrewAI integration examples
  • Configuration guides and best practices

🔗 Azure CosmosDB Features Utilized

  • Vector Search - Native vector similarity search capabilities
  • Full-Text Search - Enhanced text search with ranking
  • Hierarchical Partition Keys - Multi-level data isolation
  • TTL (Time-to-Live) - Automatic data expiration
  • Indexing Policies - Optimized query performance
  • Batch Operations - Efficient bulk data operations

💡 Use Cases

Vector Search

# Find similar documents
search_tool.run(
    operation="vector_search",
    query_text="machine learning algorithms",
    top_k=5,
    similarity_threshold=0.8
)

Semantic Cache

# Cache LLM responses intelligently
cache_tool.run(
    operation="search",
    prompt="What is machine learning?"
)

Memory Store

# Store agent conversation history
memory_tool.run(
    operation="store_memory",
    agent_id="assistant_agent",
    memory_type="conversation",
    content={"user": "Hello", "assistant": "Hi there!"}
)

🔧 Configuration

All tools support flexible configuration including:

  • Authentication - Azure Key or Token Credential
  • Database/Container settings - Custom names and properties
  • Performance tuning - Throughput, indexing, and caching policies
  • OpenAI integration - Both OpenAI and Azure OpenAI support

🚦 Breaking Changes

None - This is a new feature addition.

📋 Dependencies Added

  • azure-cosmos - Azure CosmosDB SDK
  • azure-core - Azure authentication
  • openai - OpenAI/Azure OpenAI integration

@aayush3011
Copy link
Author

@lucasgomide @thiagomoretto @lorenzejay Can I please get a review on this.

2 similar comments
@aayush3011
Copy link
Author

@lucasgomide @thiagomoretto @lorenzejay Can I please get a review on this.

@aayush3011
Copy link
Author

@lucasgomide @thiagomoretto @lorenzejay Can I please get a review on this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant