feat(providers): add Azure OpenAI provider
Summary
Adds support for Azure OpenAI Service as an LLM provider for compression, summarization, and graph extraction.
Changes
-
src/providers/azure-openai.ts(new) —AzureOpenAIProviderclass. Constructs the Azure-style URL (/openai/deployments/{name}/chat/completions?api-version=...), usesapi-keyheader instead ofAuthorization: Bearer, otherwise follows the same OpenAI-compatible request/response shape as the existingOpenRouterProvider. -
src/types.ts— adds"azure-openai"to theProviderTypeunion. -
src/config.ts— detects all three required Azure env vars and returnsprovider: "azure-openai"config; updatesdetectLlmProviderKind()to return"llm"when Azure vars are set; updates the "no key found" error message. -
src/providers/index.ts— wires thecase "azure-openai"branch intocreateBaseProvider. -
src/viewer/index.html— updates the "No LLM provider key set" flag banner to show both Anthropic and Azure setup instructions.
Usage
Add to ~/.agentmemory/.env:
AZURE_OPENAI_API_KEY=<your-azure-api-key>
AZURE_OPENAI_ENDPOINT=https://<resource-name>.openai.azure.com
AZURE_OPENAI_DEPLOYMENT=<deployment-name>
# Optional — defaults to 2024-08-01-preview
AZURE_OPENAI_API_VERSION=2024-08-01-preview
Then restart: npx @agentmemory/agentmemory
Test plan
- [ ] Server starts without error when all three Azure env vars are set
- [ ]
providershows asazure-openaiin health endpoint response - [ ] Compression runs successfully against an Azure-hosted deployment
- [ ] Missing
AZURE_OPENAI_ENDPOINTorAZURE_OPENAI_DEPLOYMENTfalls through to noop (no partial config accepted) - [ ] Viewer flag banner shows Azure setup instructions when provider is noop
Summary by CodeRabbit
-
New Features
- Added Azure OpenAI as a supported LLM provider option
-
Documentation
- Updated configuration guidance to include Azure OpenAI environment variables as a valid setup alternative
Someone is attempting to deploy a commit to the rohitg00's projects Team on Vercel.
A member of the Team first needs to authorize it.
Adds Azure OpenAI provider support to the system. Updates configuration detection to recognize Azure OpenAI environment variables, implements a new 🎯 3 (Moderate) | ⏱️ ~20 minutes 🐰✨ Azure skies now open wide,
A new provider hops inside!
Config detection, API calls flow—
Another LLM's ready to go! 🌈 ✏️ Tip: You can configure your own custom pre-merge checks in the settings.📝 Walkthrough
Walkthrough
AzureOpenAIProvider class for making API calls, integrates the provider into the factory function, extends the ProviderType union, and updates the UI warning banner to mention Azure OpenAI as a configuration option.Changes
Cohort / File(s)
Summary
Type definitions and configuration
src/types.ts, src/config.tsAdded
"azure-openai" to ProviderType union. Updated detectProvider to recognize Azure OpenAI environment variables (AZURE_OPENAI_API_KEY, AZURE_OPENAI_ENDPOINT, AZURE_OPENAI_DEPLOYMENT) and create corresponding provider config. Updated detectLlmProviderKind to identify Azure OpenAI env vars as evidence of an available LLM provider.
Provider implementation
src/providers/azure-openai.ts, src/providers/index.tsAdded new
AzureOpenAIProvider class implementing MemoryProvider, handling Azure OpenAI API authentication and chat completions requests. Updated createBaseProvider to instantiate AzureOpenAIProvider when provider type is "azure-openai".
UI updates
src/viewer/index.htmlUpdated "No LLM provider key set" warning banner to advertise both Anthropic and Azure OpenAI as valid configuration options, including setup instructions for Azure OpenAI environment variables.
Estimated code review effort
Possibly related PRs
src/config.ts and provider setup in src/providers/index.ts.detectProvider logic in src/config.ts to adjust provider configuration resolution patterns.Poem
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name
Status
Explanation
Description Check
✅ Passed
Check skipped - CodeRabbit’s high-level summary is enabled.
Title check
✅ Passed
The title accurately describes the main change: adding Azure OpenAI as a new LLM provider across the codebase.
Docstring Coverage
✅ Passed
No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check
✅ Passed
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
✅ Passed
Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Review rate limit: 6/8 reviews remaining, refill in 11 minutes and 27 seconds.Comment @coderabbitai help to get the list of available commands and usage tips.
Hi, The viewer’s "No LLM provider key set" banner now suggests only Anthropic or Azure keys, but the backend also supports Gemini, OpenRouter, and MiniMax; this can misdirect users configuring those providers.
Severity: informational | Category: maintainability
How to fix: List all supported key options
Agent prompt to fix - you can give this to your LLM of choice:
Issue description
The viewer banner shown when
cfg.provider === 'noop'now labels keys asANTHROPIC_API_KEY / AZURE_OPENAI_API_KEYand only provides enable instructions for Anthropic/Azure. This conflicts with supported providers (Gemini/OpenRouter/MiniMax) and can confuse users.Fix Focus Areas
- src/viewer/index.html[3318-3326]
Suggested direction
Update
keyLabeland theenablesnippet to include Gemini/OpenRouter/MiniMax options (or make the label generic and link to docs).
Found by Qodo code review
Thanks @nagarjunr — Azure as a first-class provider is overdue, and the auto-detect via the three env triplet is the right shape.
Question on consolidation: you opened #220 right after this with the same Azure provider plus AI Foundry (Anthropic) endpoint support and corporate-proxy tunneling. That looks like a strict superset of this PR.
Would you like to:
Option A — close this in favor of #220 (cleanest, single Azure provider PR with all three capabilities).
Option B — keep this scoped to just standard Azure OpenAI (what's here today), and rebase #220 to be a follow-up that adds the AI Foundry + proxy bits on top. Either works, but bundling makes the review and the CHANGELOG entry simpler.
Let me know which and I'll prioritize whichever stays open. Either way the underlying work lands with your attribution.