Skip to content

Conversation

@aryanraj2713
Copy link
Contributor

@aryanraj2713 aryanraj2713 commented Oct 1, 2025

Rationale

  • Enable multi-cloud AI provider flexibility without touching agent code.
  • Provide a unified interface to swap AI backends (OpenAI, AWS Bedrock, GCP Model Garden/Vertex).
  • Reduce duplication and improve maintainability by centralizing provider selection and configuration.

Related issue: closes #3

Summary of Changes

  • Core
    • Added src/core/ai.py with get_chat_model() factory supporting:
      • OpenAI (default) via langchain_openai
      • AWS Bedrock via langchain_aws (preferred) or langchain_community fallback
      • GCP Model Garden/Vertex via langchain_google_vertexai
    • Extended AIConfig in src/core/config.py with provider-specific fields:
      • Bedrock: bedrock_region, bedrock_model_id
      • GCP: gcp_project, gcp_location
    • Added validation for provider-specific requirements.
  • Agents
    • Replaced direct ChatOpenAI usage with get_chat_model() in:
      • src/agents/base.py
      • src/agents/feasibility_agent/nodes.py
      • src/agents/engine_agent/nodes.py
      • src/agents/acknowledgment_agent/agent.py
  • No behavioral changes to agent APIs; only the AI backend instantiation is abstracted.

Behavior Change

  • Agents now obtain the chat model via a provider-agnostic factory.
  • Switching providers requires only environment variable changes; no code edits.

Configuration

  • Env vars:
    • Common:
      • AI_PROVIDER = openai | bedrock | garden
      • AI_MODEL, AI_MAX_TOKENS, AI_TEMPERATURE
    • OpenAI:
      • OPENAI_API_KEY
    • AWS Bedrock:
      • BEDROCK_REGION (optional hint)
      • BEDROCK_MODEL_ID (optional; falls back to AI_MODEL)
      • Credentials resolved via AWS env/IMDS
    • GCP Garden/Vertex:
      • GCP_PROJECT_ID (optional, recommended)
      • GCP_LOCATION (optional, recommended)
      • Authentication via ADC or env credentials

Optional dependencies (to be installed by users selecting these providers):

  • Bedrock: langchain-aws (preferred) or langchain-community
  • GCP/Vertex: langchain-google-vertexai

Performance

  • No change to algorithmic complexity.
  • Adheres to performance policy: static → hybrid → LLM. Only instantiation path changed.

Security

  • No secrets are logged.
  • Credentials are read from environment/standard cloud auth mechanisms.
  • No changes to webhook verification or secret handling.

Risk and Rollback

  • Risk: Import errors if optional provider deps are missing and AI_PROVIDER is set accordingly.
    • Mitigation: Clear runtime error messages guide installation.
  • Rollback plan: Set AI_PROVIDER=openai to use the default path; code remains compatible.

CI

  • Types and lint pass locally.
  • No changes to CI workflows required.

PR Checklist (per CONTRIBUTING)

  • Types added/updated; Pydantic at boundaries unchanged
  • Tests green locally (lint/type/tests)
  • Performance order respected (static→hybrid→LLM)
  • Small, focused edits; no unrelated refactors
  • No secrets in logs or prompts
  • Docs updated (can be added to this PR if maintainers prefer)

Branch

  • feat/ai-wrapper-bedrock-garden

…Garden support

Signed-off-by: Dimitris Kargatzis <dkargatzis@gmail.com>
@aryanai-codes
Copy link

@dimeloper any update?

@dkargatzis
Copy link
Member

dkargatzis commented Oct 10, 2025

@dimeloper any update?

Guess you mentioned wrong GitHub user - btw, I've created a PR on top of your with important additions / fixes. Please have a look and let me know. Also, make you use the same GitHub account, I see your last comment left by a different account.

@aryanraj2713
Copy link
Contributor Author

Yeah, 😁looks like I mentioned someone else.

@aryanai-codes
Copy link

@dkargatzis please let me know if you need any help on this? Or any other issue/feature.
Also I installed warestack for my org's repo, will let you know the experience

@dkargatzis
Copy link
Member

Completed the Google application and still awaiting the 20K credits to be topped up in our account. If the credits aren’t in place by tomorrow, I’ll proceed to merge and handle any follow-up PRs as part of the post-merge triage.

Regarding Warestack onboarding - great news! I’m happy to assist you or run a live demo anytime. Your feedback is always welcome as we continue refining the experience.

@dkargatzis
Copy link
Member

Hey @aryanraj2713, would you like to take a deeper look into the repo to align the tests? Happy to help out or handle it if it turns out to be too much.

@aryanraj2713
Copy link
Contributor Author

Sure, do you want to setup a meet?

@dkargatzis
Copy link
Member

Sure, do you want to setup a meet?

Sure @aryanraj2713! Feel to book a slot here

@dkargatzis
Copy link
Member

@aryanraj2713 I noticed that you haven't created the calendar event - do you want me to handle this?

@aryanraj2713
Copy link
Contributor Author

Hey sorry, we had festivals here in India and I got busy, will try to schedule ASAP

@dkargatzis
Copy link
Member

Cool, looking forward to our meet!

@aryanraj2713
Copy link
Contributor Author

Link is dead

@dkargatzis
Copy link
Member

@aryanraj2713 the link says "A meeting has already been scheduled using this link." - we had a call a few days ago but you didn't join. Here is a new one - feel free to book a new meeting!

https://calendly.com/dimitris-kargatzis/new-meeting

@dkargatzis dkargatzis merged commit 4e1e1a3 into warestack:main Nov 10, 2025
0 of 2 checks passed
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.

feat: AI wrapper for AWS Bedrock and GCP Garden integration

3 participants