-
Notifications
You must be signed in to change notification settings - Fork 24
feat: Support AWS Bedrock Embedding Models and LLM Models #94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Hi, I’m Jit, a friendly security platform designed to help developers build secure applications from day zero with an MVS (Minimal viable security) mindset. In case there are security findings, they will be communicated to you as a comment inside the PR. Hope you’ll enjoy using Jit. Questions? Comments? Want to learn more? Get in touch with us. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❌ Jit has detected 1 important finding in this PR that you should review.
The finding is detailed below as a comment.
It’s highly recommended that you fix this security issue before merge.
Repository Risks:
- Internally Accessible: Accessible only within the internal network, reducing exposure to external threats but still requiring proper controls.
- Database Integration: Connects to a database, often involving sensitive data that must be securely managed.
- High Severity Findings: Indicates that the resource has high severity security findings that need attention.
- Production: Critical as it operates in a live production environment, directly impacting users and business operations.
Repository Context:
graph LR
GitHub$Repository_U23_redis/agent_U2D_memory_U2D_server["GitHub Repository<br/>redis/agent-memory-server"]:::GitHub$Repository
Team_U23_applied_U2D_ai["Team<br/>applied-ai"]:::Team
DBIntegration_U23_redis["DBIntegration<br/>redis"]:::DBIntegration
GitHub$Actions_U23_agent_U2D_memory_U2D_client_U2E_yml["GitHub Actions<br/>agent-memory-client.yml"]:::GitHub$Actions
Team_U23_applied_U2D_ai -- "Owns" --> GitHub$Repository_U23_redis/agent_U2D_memory_U2D_server
GitHub$Repository_U23_redis/agent_U2D_memory_U2D_server -- "Is accessible to" --> DBIntegration_U23_redis
GitHub$Repository_U23_redis/agent_U2D_memory_U2D_server -- "Has" --> GitHub$Actions_U23_agent_U2D_memory_U2D_client_U2E_yml
Dockerfile
Outdated
|
|
||
| # Disable auth by default for easier local development. | ||
| # Override with DISABLE_AUTH=false in production. | ||
| ENV DISABLE_AUTH=true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Security control: Docker Scan
Secrets Passed Via Build-Args Or Envs Or Copied Secret Files
Passing secrets via build-args or envs or copying secret files can leak them out
Severity: CRITICAL
Why should you fix this issue?
This Dockerfile introduces a container vulnerability. In a production environment, using insecure container configurations or outdated base images can lead to significant security risks. If an attacker exploits a vulnerability in the container, it could compromise the entire application or lead to unauthorized access.
Jit Bot commands and options (e.g., ignore issue)
You can trigger Jit actions by commenting on this PR review:
#jit_ignore_fpIgnore and mark this specific single instance of finding as “False Positive”#jit_ignore_acceptIgnore and mark this specific single instance of finding as “Accept Risk”#jit_ignore_type_in_fileIgnore any finding of type "Secrets passed viabuild-argsor envs or copied secret files" in Dockerfile; future occurrences will also be ignored.#jit_undo_ignoreUndo ignore command
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#jit_ignore_fp
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds comprehensive AWS Bedrock support to the Redis Agent Memory Server, enabling organizations to use AWS-native AI services for both embedding and LLM generation. The implementation introduces a new model provider type, AWS client factories, model validation utilities, and extensive documentation while maintaining backward compatibility.
Key Changes:
- AWS Bedrock integration for embeddings (Titan, Cohere) and LLM generation (Claude via Converse API)
- New
list_memories()method for filter-only queries without requiring embeddings - Multi-stage Docker builds with separate
standardandawstargets - Comprehensive test mocking to avoid API key requirements
Reviewed changes
Copilot reviewed 44 out of 46 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
agent_memory_server/_aws/ |
New AWS module with client factories and model validation utilities |
agent_memory_server/config.py |
Added AWS_BEDROCK provider, Bedrock model configs, and AWS credential properties |
agent_memory_server/llms.py |
Added BedrockClientWrapper using ChatBedrockConverse for LLM generation |
agent_memory_server/vectorstore_factory.py |
Integrated BedrockEmbeddings with model validation |
agent_memory_server/vectorstore_adapter.py |
Added list_memories() for filter-only queries without embeddings |
agent_memory_server/long_term_memory.py |
Updated to use list_memories() for hash/ID deduplication |
Dockerfile |
Multi-stage builds with standard and AWS targets |
docker-compose.yml |
Added AWS service profiles with environment configuration |
docs/aws-bedrock.md |
Comprehensive AWS Bedrock documentation with setup guides |
pyproject.toml |
Added [aws] extras, removed unused dependencies, added cachetools |
tests/ |
Added AWS unit tests and mocked dependencies for existing tests |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❌ Jit has detected 1 important finding in this PR that you should review.
The finding is detailed as a comment.
It’s highly recommended that you fix this security issue before merge.
Until now, you ignored/fixed 1 finding.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❌ Jit has detected 1 important finding in this PR that you should review.
The finding is detailed as a comment.
It’s highly recommended that you fix this security issue before merge.
Until now, you ignored/fixed 1 finding.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❌ Jit has detected 1 important finding in this PR that you should review.
The finding is detailed as a comment.
It’s highly recommended that you fix this security issue before merge.
Until now, you ignored/fixed 1 finding.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❌ Jit has detected 1 important finding in this PR that you should review.
The finding is detailed as a comment.
It’s highly recommended that you fix this security issue before merge.
Until now, you ignored/fixed 2 findings.
|
|
||
| # Enable authentication by default. | ||
| # You may override with DISABLE_AUTH=true in development. | ||
| ENV DISABLE_AUTH=false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Security control: Docker Scan
Secrets Passed Via Build-Args Or Envs Or Copied Secret Files
Passing secrets via build-args or envs or copying secret files can leak them out
Severity: CRITICAL
Why should you fix this issue?
This Dockerfile introduces a container vulnerability. In a production environment, using insecure container configurations or outdated base images can lead to significant security risks. If an attacker exploits a vulnerability in the container, it could compromise the entire application or lead to unauthorized access.
Jit Bot commands and options (e.g., ignore issue)
You can trigger Jit actions by commenting on this PR review:
#jit_ignore_fpIgnore and mark this specific single instance of finding as “False Positive”#jit_ignore_acceptIgnore and mark this specific single instance of finding as “Accept Risk”#jit_ignore_type_in_fileIgnore any finding of type "Secrets passed viabuild-argsor envs or copied secret files" in Dockerfile; future occurrences will also be ignored.#jit_undo_ignoreUndo ignore command
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#jit_ignore_fp
abrookins
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Truly epic, @f4roukb! 💯
And thanks for diving in with Copilot. That thing can be pedantic, but I agreed with some of its comments.
We won't get a clean test run from this PR because it can't use our credentials properly, so I'm going to merge and will sort out any irregularities that happen in CI on main.
Motivation
Many organizations using AWS want to leverage AWS-native AI services to:
This PR enables the Redis Agent Memory Server to use Amazon Bedrock for both embedding models and LLM generation, making it a first-class citizen in AWS environments while maintaining full backward compatibility with existing OpenAI/Anthropic configurations.
Additionally, the Docker setup was significantly improved to support multi-platform builds, reduce image sizes, and provide better development/production workflows.
Summary of Changes
🆕 Features Introduced
AWS Bedrock Integration
[aws]optional dependency group for clean separationFilter-Only Memory Queries
list_memories()method in vector store adapterComprehensive Documentation
docs/aws-bedrock.mdwith setup guides, IAM policies, and troubleshootingUnit Test Mock Dependencies
🐛 Bugs Fixed
Empty query full-scan issue - Fixed a bug where passing an empty query string to
search_memories()would trigger expensive full-scan operations instead of using filter-only queriesStartup validation - Fixed loose model validation that allowed invalid configurations to pass silently; now fails fast with clear error messages
🐳 Docker & Infrastructure Improvements
Multi-stage Dockerfile
standard(basic image) andaws(with AWS Bedrock support on top)Docker Compose Profiles
standardvsaws)Docker Bake Support
docker-bake.jsonfor multi-platform builds (linux/amd64, linux/arm64)New
.dockerignoreDependency Cleanup
accelerate,numba,sentence-transformers,bertopic)Detailed Changes
New Files
agent_memory_server/_aws/__init__.pyagent_memory_server/_aws/clients.pyagent_memory_server/_aws/utils.pydocs/aws-bedrock.mddocker-bake.json.dockerignoretests/test_aws_clients.pytests/test_aws_config.pytests/test_aws_utils.pyModified Files
agent_memory_server/config.pyModelProvider.AWS_BEDROCK, Bedrock model configs, AWS credential propertiesagent_memory_server/llms.pyBedrockClientWrapperusingChatBedrockConverseagent_memory_server/main.pyagent_memory_server/vectorstore_adapter.pylist_memories()for filter-only queriesagent_memory_server/long_term_memory.pylist_memories()where appropriateDockerfilestandardandawstargetsdocker-compose.ymldocker-compose-task-workers.ymlpyproject.toml[aws]extras, removed unused dependenciesmkdocs.ymlConfiguration
New Environment Variables
Supported Bedrock Models
Embedding:
amazon.titan-embed-text-v2:0(1024 dims)amazon.titan-embed-text-v1(1536 dims)cohere.embed-english-v3(1024 dims)cohere.embed-multilingual-v3(1024 dims)LLM Generation:
anthropic.claude-sonnet-4-5-20250929-v1:0anthropic.claude-haiku-4-5-20251001-v1:0anthropic.claude-opus-4-5-20251101-v1:0Feel free to add more models.
Usage
Installation
Docker
Testing
All existing tests pass. New tests added for AWS functionality:
Breaking Changes
None. All changes are backward compatible. Existing configurations using OpenAI or Anthropic continue to work without modification.
Checklist