Skip to content

feat(ai): route RAG workloads by model role - #272

Merged
kl3inIT merged 10 commits into
mainfrom
feat/rag-workload-routing-luna
Aug 2, 2026
Merged

kl3inIT merged 10 commits into
mainfrom
feat/rag-workload-routing-luna

Conversation

@kl3inIT

@kl3inIT kl3inIT commented Aug 2, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • resolve Assistant answer and Keyword Planning routes per organization at request time
  • add capability-gated OpenAI reasoning effort to route persistence, Spring AI adapters, and schema-v2 Graph processing profiles while preserving schema-v1 execution
  • expose Answer, Keyword, Graph, and Prompt roles together in Admin > Language Models; Graph stays read-only and no Reindex action is added
  • add a redacted fixed workload benchmark and keep deployment defaults unchanged pending controlled activation

Evaluation

  • Keyword gpt-5.6-luna / none: passed (12/12 valid, recall 0.875 equal to baseline, p95 1423.9 ms vs 2611.9 ms)
  • Graph gpt-5.6-luna / none: rejected (11/12 valid, p95 4124.2 ms vs gpt-5.4-mini 3233.2 ms)
  • activation decision: Keyword candidate approved; Graph remains gpt-5.4-mini; Answer remains gpt-5.6-sol

Verification

  • ./gradlew clean test --no-daemon --max-workers=1
  • ./gradlew :core:test --no-daemon --max-workers=1 after merging current main
  • OpenAPI regeneration + contract test + generated web client drift
  • web lint, typecheck, 60 unit tests, production build
  • Chromium admin-language-models.spec.ts
  • evaluation Ruff + 25 pytest tests
  • independent architecture challenge: accept-with-changes, all required changes incorporated

Summary by CodeRabbit

  • New Features

    • Added configurable OpenAI reasoning-effort levels for assistant responses, keyword planning, and graph extraction.
    • Added organization-specific routing for assistant answers and keyword planning.
    • Added administration controls showing route settings, compatibility, editability, versions, and lifecycle guidance.
    • Added graph-processing profile support for persisted reasoning settings while retaining compatibility with existing profiles.
    • Added a workload-routing evaluation command with redacted performance reports.
  • Documentation

    • Documented workload routing, configuration, and deployment behavior.
  • Tests

    • Expanded coverage for routing, compatibility, profile migration, and evaluation results.

@coderabbitai

coderabbitai Bot commented Aug 2, 2026 •

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@kl3inIT, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 29 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 612c3466-96eb-4572-b163-8a54642ad7e5

📥 Commits

Reviewing files that changed from the base of the PR and between 78ad905 and d0a266a.

⛔ Files ignored due to path filters (3)
  • apps/docs/generated/openapi.public.json is excluded by !**/generated/**
  • docs/specs/domains/secure-graph-rag.md is excluded by !docs/**
  • docs/tests/domains/secure-graph-rag.md is excluded by !docs/**
📒 Files selected for processing (8)
  • .tegami/rag-workload-routing.md
  • ARCHITECTURE.md
  • components/graph-rag-core/src/main/java/com/orgmemory/graphrag/processing/GraphProcessingProfile.java
  • components/graph-rag-core/src/test/java/com/orgmemory/graphrag/processing/GraphProcessingProfileTests.java
  • core/src/main/java/com/orgmemory/core/ai/AiGatewayAdministrationService.java
  • core/src/main/resources/db/migration/V20__rag_workload_route_options.sql
  • evaluation/src/orgmemory_eval/workload_routing_runner.py
  • evaluation/tests/test_workload_routing_runner.py
📝 Walkthrough

Walkthrough

The change adds OpenAI reasoning-effort configuration across AI gateway administration, provider integration, query routing, graph extraction, deployment settings, the administration UI, and workload-routing evaluation.

Changes

AI workload routing

Layer / File(s) Summary
Route contracts and administration
core/src/main/java/com/orgmemory/core/ai/*, apps/api/src/main/java/com/orgmemory/api/admin/*, core/src/main/resources/db/migration/*, infrastructure/deployment/*
Gateway profiles and workload routes now store reasoning-effort support and values. Administration validates compatible gateways and exposes lifecycle metadata.
Gateway resolution and provider wiring
integrations/ai-model-gateways/src/main/java/*, integrations/ai-model-gateways/src/test/*
Gateway resolution validates reasoning support. OpenAI factories pass the wire value. Anthropic factories reject the setting.
Organization-aware query and keyword routing
components/graph-rag-core/src/main/java/com/orgmemory/graphrag/query/*, apps/api/src/main/java/com/orgmemory/api/assistant/*, integrations/graph-rag-spring-ai/*
Keyword planning and assistant answers resolve routes per organization. Keyword route fingerprints now participate in cache identity.
Graph extraction profiles and execution
components/graph-rag-core/src/main/java/com/orgmemory/graphrag/model/*, components/graph-rag-core/src/main/java/com/orgmemory/graphrag/processing/*, apps/worker/src/main/java/*
Graph profiles support optional reasoning effort in schema version 2. Schema version 1 profiles remain restorable and executable.
Administration UI and route presentation
apps/web/src/features/admin/components/*, apps/web/test/e2e/*
The UI adds workload-specific reasoning controls, gateway capability switches, read-only deployment routes, and lifecycle notes.
Workload routing evaluation
evaluation/src/*, evaluation/tests/*, evaluation/fixtures/*, evaluation/README.md
A CLI evaluates keyword and graph routes with strict output validation, repeated measurements, activation criteria, and redacted reports.

Estimated code review effort: 5 (Critical) | ~120 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Admin
  participant RouteController
  participant RouteService
  participant GatewayRegistry
  participant ChatModelFactory
  Admin->>RouteController: submit route and reasoning settings
  RouteController->>RouteService: validate and persist route
  RouteService->>GatewayRegistry: resolve compatible gateway
  GatewayRegistry->>ChatModelFactory: create model with reasoning effort
  ChatModelFactory-->>Admin: execute configured workload route
Loading

Possibly related PRs

  • kl3inIT/OrgMemory#20: Introduced graph profile structures extended here with reasoning effort.
  • kl3inIT/OrgMemory#24: Introduced graph-indexing routing paths extended here with reasoning configuration.
  • kl3inIT/OrgMemory#32: Introduced query-routing components extended here with organization-aware routing.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.71% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the primary change: routing RAG workloads by model role.
Description check ✅ Passed The description covers outcomes, evaluation results, and verification, but omits the required Documentation impact section and checkbox status details.
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 💡 2
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/rag-workload-routing-luna

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Aug 2, 2026 •

Copy link
Copy Markdown
Contributor

Tegami

This repository uses Tegami to manage releases. When your changes affect published packages, add a changelog file under .tegami/ before merging.

Create a changelog → · Changelog format

Release preview

Package Bump Version
orgmemory minor 0.1.1 → 0.2.0

Changelogs in this PR

Changelog Title
rag-workload-routing.md Route RAG workloads by model role
rag-workload-routing.md Improvements

Run pnpm run tegami locally to create a changelog interactively.

Managed by Tegami.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 8

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (4)
apps/web/test/e2e/admin-language-models.spec.ts (1)

192-269: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Test the new route behavior, not only the route text.

The fixture declares supportsOpenAiReasoningEffort: true and GRAPH_EXTRACTION.editable: false, but the test only checks visible copy. Add browser assertions that a supported route can save "NONE" as openAiReasoningEffort, an unsupported gateway omits that field, and the Graph route exposes no editable route controls.

As per coding guidelines, “Preserve the existing browser test suite when changing the web application.”

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/web/test/e2e/admin-language-models.spec.ts` around lines 192 - 269,
Extend the browser assertions in the route test around the mocked
/api/admin/ai/routes data to verify behavior, not just displayed text: save
“NONE” for a route whose gateway supports OpenAI reasoning effort, confirm the
request or persisted route contains that value, verify the unsupported-gateway
flow omits openAiReasoningEffort, and assert the GRAPH_EXTRACTION route with
editable false exposes no editable controls. Preserve the existing browser test
coverage and fixture behavior.

Source: Coding guidelines

components/graph-rag-core/src/main/java/com/orgmemory/graphrag/query/LightRagKeywordPlanner.java (1)

105-158: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Guard cacheKey against a null model-route fingerprint.

cacheKey calls CanonicalCacheKeyHasher.requireSha256(modelRouteFingerprint, "modelRouteFingerprint") without checking for null first. KeywordPlanningModel.modelRouteFingerprint(UUID) defaults to null for implementations that do not override it. PlanningResult's constructor treats null as a valid, non-hashed value, but cacheKey does not apply the same rule.

Today's implementations (SpringAiKeywordPlanningModel, OrganizationAwareKeywordPlanningModel) always override modelRouteFingerprint(UUID), so the gap is not exercised yet. A future KeywordPlanningModel that relies on the interface default and runs with a configured CachePolicy will fail on every call to modelPlan.

Add the same null check used in PlanningResult, or document that any model used with caching must supply a non-null fingerprint and validate that requirement explicitly with a clear error message.

🛡️ Proposed guard in `cacheKey`
     private ModelInvocationCache.Key cacheKey(
             String normalizedQuery,
             UUID organizationId,
             String strategy,
             String modelRouteFingerprint) {
-        if (cachePolicy == null || organizationId == null) {
+        if (cachePolicy == null || organizationId == null || modelRouteFingerprint == null) {
             return null;
         }
         return ModelInvocationCacheKeys.keywords(
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@components/graph-rag-core/src/main/java/com/orgmemory/graphrag/query/LightRagKeywordPlanner.java`
around lines 105 - 158, Update cacheKey to handle a null modelRouteFingerprint
consistently with PlanningResult before calling
CanonicalCacheKeyHasher.requireSha256. Preserve cache-key generation for
non-null fingerprints, and ensure models using the interface default fingerprint
do not fail when caching is enabled.
apps/api/src/main/java/com/orgmemory/api/admin/AdminAiModelController.java (1)

335-344: 📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win

Duplicate the editable-workload rule from a single source.

RouteResponse.deployment() hardcodes the editable set as ASSISTANT_CHAT, PROMPT_EXECUTION, KEYWORD_PLANNING. The core layer expresses the same rule independently through AiGatewayAdministrationService.requireEditableWorkload() (exercised by AiGatewayAdministrationServiceTests, where setRoute/clearRoute reject GRAPH_EXTRACTION). Both lists match today, but a future AiWorkload addition or editability change only needs to update one of the two lists to make the admin UI drift from backend behavior: the UI could offer editing for a workload the backend rejects, or hide a workload the backend would accept.

Extract this rule to one place, for example an AiWorkload.editable() method or a shared constant in the core module, and have both AdminAiModelController and AiGatewayAdministrationService read from it.

Also applies to: 538-556

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/api/src/main/java/com/orgmemory/api/admin/AdminAiModelController.java`
around lines 335 - 344, Centralize the editable-workload rule currently
duplicated between RouteResponse.deployment() and
AiGatewayAdministrationService.requireEditableWorkload(). Add a shared
AiWorkload-level method or core constant, then update both
AdminAiModelController and AiGatewayAdministrationService to use it, preserving
rejection of non-editable workloads such as GRAPH_EXTRACTION.
integrations/ai-model-gateways/src/main/java/com/orgmemory/integrations/ai/gateway/AiGatewayProperties.java (1)

76-80: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Gateway.toString() omits the new capability flag.

Gateway now carries supportsOpenAiReasoningEffort, but toString() still prints only displayName, baseUrl, apiKey, capabilities, and timeout. AiGatewayRegistry.ResolvedGateway and SpringAiChatModelFactory.Request both include the new field in their toString() in this same PR. Add supportsOpenAiReasoningEffort here too, for consistent diagnostics when a gateway rejects a reasoning-effort request.

♻️ Proposed fix
 `@Override`
 public String toString() {
-    return "Gateway[displayName=%s, baseUrl=%s, apiKey=%s, capabilities=%s, timeout=%s]"
-            .formatted(displayName, baseUrl, apiKey.isBlank() ? "" : "***", capabilities, timeout);
+    return "Gateway[displayName=%s, baseUrl=%s, apiKey=%s, capabilities=%s, timeout=%s, supportsOpenAiReasoningEffort=%s]"
+            .formatted(displayName, baseUrl, apiKey.isBlank() ? "" : "***", capabilities, timeout, supportsOpenAiReasoningEffort);
 }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@integrations/ai-model-gateways/src/main/java/com/orgmemory/integrations/ai/gateway/AiGatewayProperties.java`
around lines 76 - 80, Update Gateway.toString() to include the
supportsOpenAiReasoningEffort field alongside the existing gateway properties,
matching the diagnostic output used by AiGatewayRegistry.ResolvedGateway and
SpringAiChatModelFactory.Request.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@apps/api/src/test/java/com/orgmemory/api/assistant/OrganizationAwareKeywordPlanningModelTests.java`:
- Around line 86-106: The RecordingChatModel test double must implement the
required ChatModel stream(Prompt) method in addition to call(Prompt) and
getOptions(). Add a stream implementation that returns the expected ChatResponse
sequence, reusing the same generated response behavior as call(Prompt), without
changing the test’s keyword payload.

In
`@components/graph-rag-core/src/main/java/com/orgmemory/graphrag/processing/GraphProcessingProfile.java`:
- Around line 34-36: The GraphProcessingProfile constructor must reject non-null
extractionProfile.openAiReasoningEffort() when schemaVersion == 1, since that
field is absent from schema-v1 canonical data. Add the validation alongside the
existing schema-version checks and add a test covering this invalid combination.

In
`@core/src/main/java/com/orgmemory/core/ai/AiGatewayAdministrationService.java`:
- Around line 214-233: Move the supportsOpenAiReasoningEffort read from the
non-transactional update overload into the transactional 8-parameter update
path, using the profile fetched there for both validation and persistence.
Update the overloads and their call flow so concurrent changes are not
overwritten by a stale value from the outer update method.

In `@core/src/main/resources/db/migration/V20__rag_workload_route_options.sql`:
- Around line 7-33: Update the migration’s openai_reasoning_effort column to use
text instead of varchar(16), and add NOT VALID to both new CHECK constraints so
existing production rows are not scanned during constraint creation. If the
table is populated in this migration sequence, add separate validation
statements for chk_ai_route_override_workload and
chk_ai_route_override_openai_reasoning after the constraints are created.

In `@evaluation/src/orgmemory_eval/workload_routing_runner.py`:
- Around line 178-195: Update request_json to retry transient transport failures
with a bounded number of attempts and backoff, matching the existing
RAGAS/OpenAI retry behavior where applicable. Retry only HTTP 429, HTTP 5xx, and
socket timeout errors; let all other exceptions propagate immediately. Preserve
the current successful response parsing and latency return behavior, and ensure
the final failed attempt is propagated rather than silently producing an invalid
observation.
- Around line 194-195: The observe flow must tolerate malformed provider
responses without aborting the benchmark: handle empty choices and non-dict
entities alongside existing response-shape failures, while keeping transport
failures distinct. Add the required case-key validation in main before the
request loop so missing fixture keys fail as fixture errors rather than being
recorded as provider failures; update the observe exception handling around body
parsing and entity validation accordingly.
- Around line 266-278: Update aggregate to compute meanRecall and p95LatencyMs
from successful observations only, filtering out failed items before calculating
those quality metrics. Keep samples, validResponses, providerFailures, and
errorCodes based on all observations, and preserve the existing output keys and
rounding behavior.

In `@evaluation/tests/test_workload_routing_runner.py`:
- Around line 49-51: Extend the activation assertions around
activation("keyword", ...) and activation("graph", ...) to also evaluate the
worsened p95LatencyMs input for the Keyword gate. Assert that the Keyword result
remains active while the Graph gate is rejected, proving the two gates operate
independently.

---

Outside diff comments:
In `@apps/api/src/main/java/com/orgmemory/api/admin/AdminAiModelController.java`:
- Around line 335-344: Centralize the editable-workload rule currently
duplicated between RouteResponse.deployment() and
AiGatewayAdministrationService.requireEditableWorkload(). Add a shared
AiWorkload-level method or core constant, then update both
AdminAiModelController and AiGatewayAdministrationService to use it, preserving
rejection of non-editable workloads such as GRAPH_EXTRACTION.

In `@apps/web/test/e2e/admin-language-models.spec.ts`:
- Around line 192-269: Extend the browser assertions in the route test around
the mocked /api/admin/ai/routes data to verify behavior, not just displayed
text: save “NONE” for a route whose gateway supports OpenAI reasoning effort,
confirm the request or persisted route contains that value, verify the
unsupported-gateway flow omits openAiReasoningEffort, and assert the
GRAPH_EXTRACTION route with editable false exposes no editable controls.
Preserve the existing browser test coverage and fixture behavior.

In
`@components/graph-rag-core/src/main/java/com/orgmemory/graphrag/query/LightRagKeywordPlanner.java`:
- Around line 105-158: Update cacheKey to handle a null modelRouteFingerprint
consistently with PlanningResult before calling
CanonicalCacheKeyHasher.requireSha256. Preserve cache-key generation for
non-null fingerprints, and ensure models using the interface default fingerprint
do not fail when caching is enabled.

In
`@integrations/ai-model-gateways/src/main/java/com/orgmemory/integrations/ai/gateway/AiGatewayProperties.java`:
- Around line 76-80: Update Gateway.toString() to include the
supportsOpenAiReasoningEffort field alongside the existing gateway properties,
matching the diagnostic output used by AiGatewayRegistry.ResolvedGateway and
SpringAiChatModelFactory.Request.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 747751bd-5fad-4a50-8ec2-5ba93df58c2f

📥 Commits

Reviewing files that changed from the base of the PR and between be84830 and 78ad905.

⛔ Files ignored due to path filters (13)
  • contracts/openapi.json is excluded by !contracts/openapi.json
  • docs/increments/active/2026-08-02-rag-workload-routing-luna/challenge-brief.md is excluded by !docs/**
  • docs/increments/active/2026-08-02-rag-workload-routing-luna/challenge-verdict.md is excluded by !docs/**
  • docs/increments/active/2026-08-02-rag-workload-routing-luna/design.md is excluded by !docs/**
  • docs/increments/active/2026-08-02-rag-workload-routing-luna/evaluation-result.json is excluded by !docs/**
  • docs/increments/active/2026-08-02-rag-workload-routing-luna/plan.md is excluded by !docs/**
  • docs/roadmap.md is excluded by !docs/**
  • docs/specs/domains/ai-model-control-plane.md is excluded by !docs/**
  • docs/specs/domains/assistant-and-mcp.md is excluded by !docs/**
  • docs/specs/domains/secure-graph-rag.md is excluded by !docs/**
  • docs/tests/domains/ai-model-control-plane.md is excluded by !docs/**
  • docs/tests/domains/assistant-and-mcp.md is excluded by !docs/**
  • docs/tests/domains/secure-graph-rag.md is excluded by !docs/**
📒 Files selected for processing (53)
  • .env.example
  • ARCHITECTURE.md
  • apps/api/src/main/java/com/orgmemory/api/admin/AdminAiModelController.java
  • apps/api/src/main/java/com/orgmemory/api/assistant/GraphRagRuntimeConfiguration.java
  • apps/api/src/main/java/com/orgmemory/api/assistant/OrganizationAwareKeywordPlanningModel.java
  • apps/api/src/main/java/com/orgmemory/api/assistant/OrganizationAwareQueryAnswerModel.java
  • apps/api/src/main/resources/application.yml
  • apps/api/src/test/java/com/orgmemory/api/admin/PermissionsAdminIntegrationTests.java
  • apps/api/src/test/java/com/orgmemory/api/assistant/OrganizationAwareKeywordPlanningModelTests.java
  • apps/api/src/test/java/com/orgmemory/api/assistant/OrganizationAwareQueryAnswerModelTests.java
  • apps/web/src/features/admin/components/admin-language-models-page.tsx
  • apps/web/test/e2e/admin-language-models.spec.ts
  • apps/worker/src/main/java/com/orgmemory/worker/graph/GraphIndexingProcessor.java
  • apps/worker/src/main/resources/application.yml
  • apps/worker/src/test/java/com/orgmemory/worker/ingestion/SourceIngestionPipelineIntegrationTests.java
  • components/graph-rag-core/src/main/java/com/orgmemory/graphrag/model/ExtractionProfile.java
  • components/graph-rag-core/src/main/java/com/orgmemory/graphrag/processing/GraphProcessingProfile.java
  • components/graph-rag-core/src/main/java/com/orgmemory/graphrag/processing/LightRagGraphProcessingProfiles.java
  • components/graph-rag-core/src/main/java/com/orgmemory/graphrag/query/KeywordPlanningModel.java
  • components/graph-rag-core/src/main/java/com/orgmemory/graphrag/query/LightRagKeywordPlanner.java
  • components/graph-rag-core/src/main/java/com/orgmemory/graphrag/query/LightRagQueryEngine.java
  • components/graph-rag-core/src/main/java/com/orgmemory/graphrag/query/QueryAnswerModel.java
  • components/graph-rag-core/src/test/java/com/orgmemory/graphrag/processing/GraphProcessingProfileTests.java
  • components/graph-rag-core/src/test/java/com/orgmemory/graphrag/query/LightRagKeywordPlannerCacheTests.java
  • core/src/main/java/com/orgmemory/core/ai/AiGatewayAdministrationService.java
  • core/src/main/java/com/orgmemory/core/ai/AiGatewayConnection.java
  • core/src/main/java/com/orgmemory/core/ai/AiGatewayProfile.java
  • core/src/main/java/com/orgmemory/core/ai/AiGatewayProfileView.java
  • core/src/main/java/com/orgmemory/core/ai/AiRoute.java
  • core/src/main/java/com/orgmemory/core/ai/AiRouteOverride.java
  • core/src/main/java/com/orgmemory/core/ai/AiRouteOverrideRepository.java
  • core/src/main/java/com/orgmemory/core/ai/AiRouteOverrideView.java
  • core/src/main/java/com/orgmemory/core/ai/OpenAiReasoningEffort.java
  • core/src/main/java/com/orgmemory/core/knowledge/graph/GraphProcessingProfileResolver.java
  • core/src/main/resources/db/migration/V20__rag_workload_route_options.sql
  • core/src/test/java/com/orgmemory/core/ai/AiGatewayAdministrationServiceTests.java
  • core/src/test/java/com/orgmemory/core/ai/AiRouteTests.java
  • evaluation/README.md
  • evaluation/fixtures/workload-routing-v1.json
  • evaluation/pyproject.toml
  • evaluation/src/orgmemory_eval/workload_routing_runner.py
  • evaluation/tests/test_workload_routing_runner.py
  • infrastructure/deployment/compose.production.yaml
  • infrastructure/deployment/production.env.example
  • integrations/ai-model-gateways/src/main/java/com/orgmemory/integrations/ai/gateway/AiGatewayProperties.java
  • integrations/ai-model-gateways/src/main/java/com/orgmemory/integrations/ai/gateway/AiGatewayRegistry.java
  • integrations/ai-model-gateways/src/main/java/com/orgmemory/integrations/ai/gateway/SpringAiChatModelFactory.java
  • integrations/ai-model-gateways/src/main/java/com/orgmemory/integrations/ai/gateway/SpringAiChatModelProvider.java
  • integrations/ai-model-gateways/src/main/java/com/orgmemory/integrations/ai/gateway/anthropic/AnthropicMessagesChatModelFactory.java
  • integrations/ai-model-gateways/src/main/java/com/orgmemory/integrations/ai/gateway/openai/OpenAiCompatibleChatModelFactory.java
  • integrations/ai-model-gateways/src/test/java/com/orgmemory/integrations/ai/gateway/AiGatewayPropertiesTests.java
  • integrations/ai-model-gateways/src/test/java/com/orgmemory/integrations/ai/gateway/openai/OpenAiCompatibleChatModelFactoryTests.java
  • integrations/graph-rag-spring-ai/src/main/java/com/orgmemory/integrations/graphrag/springai/SpringAiKeywordPlanningModel.java
📜 Review details
⏰ Context from checks skipped due to timeout. (4)
  • GitHub Check: OpenSearch adapter
  • GitHub Check: Backend · Java 25
  • GitHub Check: PostgreSQL GraphRAG
  • GitHub Check: Web · Node 24
🧰 Additional context used
📓 Path-based instructions (9)
**/*

📄 CodeRabbit inference engine (AGENTS.md)

**/*: Treat the repository and runtime evidence as the engineering system of record; do not treat chat or Northstar as authoritative.
Before changing a domain, read its specification, test-coverage document, and applicable decision filenames.
Material decisions about domain boundaries, authorization, persistence, publication, concurrency, cache isolation, parity scope, or deployment require an independent architecture challenge and documented alternatives before implementation.
Do not use completed increment documents as the source for current behavior; use them only for history or archaeology.
Before using unfamiliar Spring Boot, Spring Modulith, Spring AI, Gradle, React, Vite, Tailwind, TypeScript, Next.js, or Fumadocs APIs, consult current official documentation, Context7, and the relevant verification skill.
Read docs/guidelines/agent-safety.md before retrieval, AI, MCP, permission, upload, graph, or export work; never commit secrets or customer data.
Keep ddl-auto=validate and pair every persisted-model change with a Flyway migration.
Use the testing harness; a terminating clean test is the JVM context gate, and bootRun is not verification.

Files:

  • infrastructure/deployment/production.env.example
  • apps/api/src/main/resources/application.yml
  • evaluation/fixtures/workload-routing-v1.json
  • apps/api/src/test/java/com/orgmemory/api/assistant/OrganizationAwareKeywordPlanningModelTests.java
  • apps/api/src/main/java/com/orgmemory/api/assistant/OrganizationAwareQueryAnswerModel.java
  • core/src/main/java/com/orgmemory/core/ai/OpenAiReasoningEffort.java
  • integrations/ai-model-gateways/src/test/java/com/orgmemory/integrations/ai/gateway/openai/OpenAiCompatibleChatModelFactoryTests.java
  • core/src/test/java/com/orgmemory/core/ai/AiRouteTests.java
  • core/src/main/java/com/orgmemory/core/ai/AiGatewayProfileView.java
  • evaluation/pyproject.toml
  • apps/worker/src/main/java/com/orgmemory/worker/graph/GraphIndexingProcessor.java
  • core/src/main/resources/db/migration/V20__rag_workload_route_options.sql
  • integrations/ai-model-gateways/src/main/java/com/orgmemory/integrations/ai/gateway/openai/OpenAiCompatibleChatModelFactory.java
  • apps/worker/src/main/resources/application.yml
  • components/graph-rag-core/src/main/java/com/orgmemory/graphrag/processing/LightRagGraphProcessingProfiles.java
  • core/src/main/java/com/orgmemory/core/ai/AiRoute.java
  • integrations/ai-model-gateways/src/main/java/com/orgmemory/integrations/ai/gateway/anthropic/AnthropicMessagesChatModelFactory.java
  • core/src/main/java/com/orgmemory/core/ai/AiRouteOverride.java
  • core/src/main/java/com/orgmemory/core/knowledge/graph/GraphProcessingProfileResolver.java
  • integrations/ai-model-gateways/src/test/java/com/orgmemory/integrations/ai/gateway/AiGatewayPropertiesTests.java
  • integrations/graph-rag-spring-ai/src/main/java/com/orgmemory/integrations/graphrag/springai/SpringAiKeywordPlanningModel.java
  • apps/worker/src/test/java/com/orgmemory/worker/ingestion/SourceIngestionPipelineIntegrationTests.java
  • evaluation/README.md
  • apps/api/src/main/java/com/orgmemory/api/assistant/OrganizationAwareKeywordPlanningModel.java
  • components/graph-rag-core/src/main/java/com/orgmemory/graphrag/processing/GraphProcessingProfile.java
  • integrations/ai-model-gateways/src/main/java/com/orgmemory/integrations/ai/gateway/SpringAiChatModelProvider.java
  • apps/api/src/test/java/com/orgmemory/api/assistant/OrganizationAwareQueryAnswerModelTests.java
  • evaluation/tests/test_workload_routing_runner.py
  • core/src/main/java/com/orgmemory/core/ai/AiGatewayProfile.java
  • components/graph-rag-core/src/main/java/com/orgmemory/graphrag/model/ExtractionProfile.java
  • core/src/main/java/com/orgmemory/core/ai/AiRouteOverrideRepository.java
  • core/src/test/java/com/orgmemory/core/ai/AiGatewayAdministrationServiceTests.java
  • integrations/ai-model-gateways/src/main/java/com/orgmemory/integrations/ai/gateway/AiGatewayRegistry.java
  • core/src/main/java/com/orgmemory/core/ai/AiRouteOverrideView.java
  • apps/api/src/main/java/com/orgmemory/api/assistant/GraphRagRuntimeConfiguration.java
  • integrations/ai-model-gateways/src/main/java/com/orgmemory/integrations/ai/gateway/SpringAiChatModelFactory.java
  • components/graph-rag-core/src/main/java/com/orgmemory/graphrag/query/KeywordPlanningModel.java
  • components/graph-rag-core/src/main/java/com/orgmemory/graphrag/query/LightRagQueryEngine.java
  • infrastructure/deployment/compose.production.yaml
  • core/src/main/java/com/orgmemory/core/ai/AiGatewayConnection.java
  • apps/api/src/test/java/com/orgmemory/api/admin/PermissionsAdminIntegrationTests.java
  • ARCHITECTURE.md
  • components/graph-rag-core/src/test/java/com/orgmemory/graphrag/processing/GraphProcessingProfileTests.java
  • apps/web/test/e2e/admin-language-models.spec.ts
  • components/graph-rag-core/src/main/java/com/orgmemory/graphrag/query/QueryAnswerModel.java
  • components/graph-rag-core/src/test/java/com/orgmemory/graphrag/query/LightRagKeywordPlannerCacheTests.java
  • integrations/ai-model-gateways/src/main/java/com/orgmemory/integrations/ai/gateway/AiGatewayProperties.java
  • components/graph-rag-core/src/main/java/com/orgmemory/graphrag/query/LightRagKeywordPlanner.java
  • apps/api/src/main/java/com/orgmemory/api/admin/AdminAiModelController.java
  • apps/web/src/features/admin/components/admin-language-models-page.tsx
  • evaluation/src/orgmemory_eval/workload_routing_runner.py
  • core/src/main/java/com/orgmemory/core/ai/AiGatewayAdministrationService.java
**/*.java

📄 CodeRabbit inference engine (AGENTS.md)

Apply IDE inspection only to edited backend Java files.

Files:

  • apps/api/src/test/java/com/orgmemory/api/assistant/OrganizationAwareKeywordPlanningModelTests.java
  • apps/api/src/main/java/com/orgmemory/api/assistant/OrganizationAwareQueryAnswerModel.java
  • core/src/main/java/com/orgmemory/core/ai/OpenAiReasoningEffort.java
  • integrations/ai-model-gateways/src/test/java/com/orgmemory/integrations/ai/gateway/openai/OpenAiCompatibleChatModelFactoryTests.java
  • core/src/test/java/com/orgmemory/core/ai/AiRouteTests.java
  • core/src/main/java/com/orgmemory/core/ai/AiGatewayProfileView.java
  • apps/worker/src/main/java/com/orgmemory/worker/graph/GraphIndexingProcessor.java
  • integrations/ai-model-gateways/src/main/java/com/orgmemory/integrations/ai/gateway/openai/OpenAiCompatibleChatModelFactory.java
  • components/graph-rag-core/src/main/java/com/orgmemory/graphrag/processing/LightRagGraphProcessingProfiles.java
  • core/src/main/java/com/orgmemory/core/ai/AiRoute.java
  • integrations/ai-model-gateways/src/main/java/com/orgmemory/integrations/ai/gateway/anthropic/AnthropicMessagesChatModelFactory.java
  • core/src/main/java/com/orgmemory/core/ai/AiRouteOverride.java
  • core/src/main/java/com/orgmemory/core/knowledge/graph/GraphProcessingProfileResolver.java
  • integrations/ai-model-gateways/src/test/java/com/orgmemory/integrations/ai/gateway/AiGatewayPropertiesTests.java
  • integrations/graph-rag-spring-ai/src/main/java/com/orgmemory/integrations/graphrag/springai/SpringAiKeywordPlanningModel.java
  • apps/worker/src/test/java/com/orgmemory/worker/ingestion/SourceIngestionPipelineIntegrationTests.java
  • apps/api/src/main/java/com/orgmemory/api/assistant/OrganizationAwareKeywordPlanningModel.java
  • components/graph-rag-core/src/main/java/com/orgmemory/graphrag/processing/GraphProcessingProfile.java
  • integrations/ai-model-gateways/src/main/java/com/orgmemory/integrations/ai/gateway/SpringAiChatModelProvider.java
  • apps/api/src/test/java/com/orgmemory/api/assistant/OrganizationAwareQueryAnswerModelTests.java
  • core/src/main/java/com/orgmemory/core/ai/AiGatewayProfile.java
  • components/graph-rag-core/src/main/java/com/orgmemory/graphrag/model/ExtractionProfile.java
  • core/src/main/java/com/orgmemory/core/ai/AiRouteOverrideRepository.java
  • core/src/test/java/com/orgmemory/core/ai/AiGatewayAdministrationServiceTests.java
  • integrations/ai-model-gateways/src/main/java/com/orgmemory/integrations/ai/gateway/AiGatewayRegistry.java
  • core/src/main/java/com/orgmemory/core/ai/AiRouteOverrideView.java
  • apps/api/src/main/java/com/orgmemory/api/assistant/GraphRagRuntimeConfiguration.java
  • integrations/ai-model-gateways/src/main/java/com/orgmemory/integrations/ai/gateway/SpringAiChatModelFactory.java
  • components/graph-rag-core/src/main/java/com/orgmemory/graphrag/query/KeywordPlanningModel.java
  • components/graph-rag-core/src/main/java/com/orgmemory/graphrag/query/LightRagQueryEngine.java
  • core/src/main/java/com/orgmemory/core/ai/AiGatewayConnection.java
  • apps/api/src/test/java/com/orgmemory/api/admin/PermissionsAdminIntegrationTests.java
  • components/graph-rag-core/src/test/java/com/orgmemory/graphrag/processing/GraphProcessingProfileTests.java
  • components/graph-rag-core/src/main/java/com/orgmemory/graphrag/query/QueryAnswerModel.java
  • components/graph-rag-core/src/test/java/com/orgmemory/graphrag/query/LightRagKeywordPlannerCacheTests.java
  • integrations/ai-model-gateways/src/main/java/com/orgmemory/integrations/ai/gateway/AiGatewayProperties.java
  • components/graph-rag-core/src/main/java/com/orgmemory/graphrag/query/LightRagKeywordPlanner.java
  • apps/api/src/main/java/com/orgmemory/api/admin/AdminAiModelController.java
  • core/src/main/java/com/orgmemory/core/ai/AiGatewayAdministrationService.java
apps/api/src/main/java/**/*.java

⚙️ CodeRabbit configuration file

apps/api/src/main/java/**/*.java: Enforce the browser-BFF and resource-server boundaries. Authentication
must resolve an active internal actor through the explicit issuer and
subject binding. Reject identity, tenant, roles, or permissions supplied
by request payloads, JWT email, or untrusted JWT role claims.

Files:

  • apps/api/src/main/java/com/orgmemory/api/assistant/OrganizationAwareQueryAnswerModel.java
  • apps/api/src/main/java/com/orgmemory/api/assistant/OrganizationAwareKeywordPlanningModel.java
  • apps/api/src/main/java/com/orgmemory/api/assistant/GraphRagRuntimeConfiguration.java
  • apps/api/src/main/java/com/orgmemory/api/admin/AdminAiModelController.java
core/src/main/resources/db/migration/*.sql

⚙️ CodeRabbit configuration file

core/src/main/resources/db/migration/*.sql: The repository is pre-release: V1 is the intentionally resettable clean
baseline and development data carries no migration cost. Once a release
baseline is frozen, later Flyway migrations are immutable. Check tenant
isolation, foreign keys, uniqueness, indexes, append-only evidence
semantics, safe defaults, and PostgreSQL 18 plus pgvector compatibility.

Files:

  • core/src/main/resources/db/migration/V20__rag_workload_route_options.sql
core/src/main/java/com/orgmemory/core/{authorization,knowledge,permission}/**/*.java

⚙️ CodeRabbit configuration file

core/src/main/java/com/orgmemory/core/{authorization,knowledge,permission}/**/*.java: Treat PostgreSQL ACL evidence as canonical and OpenFGA as the relationship
authorization decision point. Authorization must fail closed. Filtering
must happen before ranking, LIMIT, graph traversal, answer generation,
export, and citation rendering. Flag metadata or timing leak paths.

Files:

  • core/src/main/java/com/orgmemory/core/knowledge/graph/GraphProcessingProfileResolver.java
apps/web/**/*.{ts,tsx}

📄 CodeRabbit inference engine (apps/web/CLAUDE.md)

apps/web/**/*.{ts,tsx}: Extend the established OrgMemory product shell, design tokens, shadcn/Radix primitives, and existing layout patterns; do not introduce a separate visual system in the web application.
Generate ordinary REST clients from contracts/openapi.json using Hey API.
Use TanStack Query for server state, TanStack Router for navigation, and limit Zustand to durable or high-frequency UI state.
Preserve keyboard accessibility, light/dark theme support, loading and error states, and responsive behavior in the web application.

Files:

  • apps/web/test/e2e/admin-language-models.spec.ts
  • apps/web/src/features/admin/components/admin-language-models-page.tsx
apps/web/**/*.{test,spec}.{ts,tsx}

📄 CodeRabbit inference engine (apps/web/CLAUDE.md)

Preserve the existing browser test suite when changing the web application.

Files:

  • apps/web/test/e2e/admin-language-models.spec.ts
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (AGENTS.md)

Frontend changes must pass lint, typecheck, tests, and a production build; perform browser verification when the flow warrants it.

Files:

  • apps/web/test/e2e/admin-language-models.spec.ts
  • apps/web/src/features/admin/components/admin-language-models-page.tsx
apps/web/src/**/*.{ts,tsx}

⚙️ CodeRabbit configuration file

apps/web/src/**/*.{ts,tsx}: OAuth access and refresh tokens must never enter browser JavaScript or
browser storage. Use the HttpOnly BFF session, CSRF-protected mutations,
generated Hey API data clients, accessible states, and both light and
dark themes. Handwritten transport is reserved for documented protocol
flows such as navigation redirects and streaming.

Files:

  • apps/web/src/features/admin/components/admin-language-models-page.tsx
🧠 Learnings (4)
📚 Learning: 2026-07-26T05:46:47.443Z
Learnt from: kl3inIT
Repo: kl3inIT/OrgMemory PR: 61
File: apps/mcp/src/main/java/com/orgmemory/mcp/McpSecurityConfiguration.java:50-52
Timestamp: 2026-07-26T05:46:47.443Z
Learning: In OrgMemory, treat the `apps/mcp` and `apps/api` as independent protocol adapter modules. When adjusting OAuth/wire-level scopes, do not introduce a shared Java constant or create a code dependency from `apps/mcp` to `apps/api` solely to deduplicate scope values. Instead, keep OAuth/scope constants adapter-local (e.g., in the relevant adapter/security configuration classes) and ensure cross-adapter consistency via automated realm/OAuth/authorization tests, rather than via shared wiring-level constants or cross-module references.

Applied to files:

  • apps/api/src/main/java/com/orgmemory/api/assistant/OrganizationAwareQueryAnswerModel.java
  • apps/api/src/main/java/com/orgmemory/api/assistant/OrganizationAwareKeywordPlanningModel.java
  • apps/api/src/main/java/com/orgmemory/api/assistant/GraphRagRuntimeConfiguration.java
  • apps/api/src/main/java/com/orgmemory/api/admin/AdminAiModelController.java
📚 Learning: 2026-07-23T23:30:44.585Z
Learnt from: kl3inIT
Repo: kl3inIT/OrgMemory PR: 30
File: core/src/main/resources/db/migration/V32__evidence_scoped_graph_semantics.sql:0-0
Timestamp: 2026-07-23T23:30:44.585Z
Learning: For OrgMemory PostgreSQL Flyway migrations under core/src/main/resources/db/migration, do not recommend using `CREATE INDEX CONCURRENTLY` or `DROP INDEX CONCURRENTLY` inside application-owned Flyway migration SQL. Flyway’s schema-history connection may hold a transaction that can cause concurrent index operations to wait indefinitely (e.g., on a `virtualxid`), and docs/conventions.md forbids this pattern. If you need large production-table index replacement, pre-stage online index operations via the deployment pipeline (outside Flyway) rather than inside the migration; “ordinary” index replacement is acceptable for unreleased projections before production traffic.

Applied to files:

  • core/src/main/resources/db/migration/V20__rag_workload_route_options.sql
📚 Learning: 2026-08-02T08:30:57.335Z
Learnt from: kl3inIT
Repo: kl3inIT/OrgMemory PR: 270
File: core/src/main/java/com/orgmemory/core/assetregistry/AssetDraftRepository.java:15-23
Timestamp: 2026-08-02T08:30:57.335Z
Learning: For OrgMemory JPA repository methods using `PESSIMISTIC_WRITE`, do not add a finite lock-timeout hint as part of a behavior-preserving refactor. The V1 PostgreSQL configuration uses `lock_timeout = 0`; any finite lock timeout must be established as a platform-wide database and transaction policy rather than configured on an individual method.

Applied to files:

  • core/src/main/java/com/orgmemory/core/ai/AiRouteOverrideRepository.java
📚 Learning: 2026-07-27T14:53:53.633Z
Learnt from: kl3inIT
Repo: kl3inIT/OrgMemory PR: 92
File: infrastructure/deployment/compose.production.yaml:304-310
Timestamp: 2026-07-27T14:53:53.633Z
Learning: For OrgMemory’s Spring Boot SCIM configuration, the `application.yml`/`application-prod.yml` map `orgmemory.security.scim.*` properties via `${ORGMEMORY_SCIM_*}` placeholders. Therefore, in deployment Compose files and related environment/CI templates, set environment variables using the `ORGMEMORY_SCIM_*` names (e.g., `ORGMEMORY_SCIM_VERIFIER_KEY`) rather than “relaxed-binding-derived” names such as `ORGMEMORY_SECURITY_SCIM_*`. This is required to ensure Spring resolves the intended SCIM configuration properties.

Applied to files:

  • infrastructure/deployment/compose.production.yaml
🪛 ast-grep (0.45.0)
evaluation/src/orgmemory_eval/workload_routing_runner.py

[info] 186-186: use jsonify instead of json.dumps for JSON output
Context: json.dumps(payload, ensure_ascii=False)
Note: [CWE-116] Improper Encoding or Escaping of Output.

(use-jsonify)


[info] 357-357: use jsonify instead of json.dumps for JSON output
Context: json.dumps(report, indent=2)
Note: [CWE-116] Improper Encoding or Escaping of Output.

(use-jsonify)


[info] 358-358: use jsonify instead of json.dumps for JSON output
Context: json.dumps(report, indent=2)
Note: [CWE-116] Improper Encoding or Escaping of Output.

(use-jsonify)


[warning] 190-190: Request-controlled URL passed to urlopen; validate against an allowlist to prevent SSRF.
Context: urllib.request.urlopen(request, timeout=timeout_seconds)
Note: [CWE-918] Server-Side Request Forgery (SSRF).

(urlopen-unsanitized-data)

🪛 dotenv-linter (4.0.0)
.env.example

[warning] 13-13: [UnorderedKey] The ORGMEMORY_KEYWORD_OPENAI_REASONING_EFFORT key should go before the ORGMEMORY_OPENAI_BASE_URL key

(UnorderedKey)


[warning] 14-14: [UnorderedKey] The ORGMEMORY_GRAPH_EXTRACTION_OPENAI_REASONING_EFFORT key should go before the ORGMEMORY_KEYWORD_OPENAI_REASONING_EFFORT key

(UnorderedKey)

🪛 Squawk (2.61.0)
core/src/main/resources/db/migration/V20__rag_workload_route_options.sql

[warning] 8-8: Changing the size of a varchar field requires an ACCESS EXCLUSIVE lock, that will prevent all reads and writes to the table. Use a TEXT field with a CHECK constraint.

(prefer-text-field)


[warning] 14-20: By default new constraints require a table scan and block writes to the table while that scan occurs. Use NOT VALID with a later VALIDATE CONSTRAINT call.

(constraint-missing-not-valid)


[warning] 23-33: By default new constraints require a table scan and block writes to the table while that scan occurs. Use NOT VALID with a later VALIDATE CONSTRAINT call.

(constraint-missing-not-valid)

🔇 Additional comments (52)
components/graph-rag-core/src/main/java/com/orgmemory/graphrag/model/ExtractionProfile.java (1)

16-16: LGTM!

Also applies to: 44-45, 69-93, 107-107, 127-127, 150-151, 175-187

components/graph-rag-core/src/main/java/com/orgmemory/graphrag/processing/LightRagGraphProcessingProfiles.java (1)

27-36: LGTM!

core/src/main/java/com/orgmemory/core/knowledge/graph/GraphProcessingProfileResolver.java (1)

31-33: LGTM!

apps/worker/src/main/java/com/orgmemory/worker/graph/GraphIndexingProcessor.java (1)

169-175: LGTM!

Also applies to: 249-249

apps/worker/src/test/java/com/orgmemory/worker/ingestion/SourceIngestionPipelineIntegrationTests.java (1)

255-257: LGTM!

components/graph-rag-core/src/test/java/com/orgmemory/graphrag/processing/GraphProcessingProfileTests.java (1)

4-40: LGTM!

Also applies to: 50-99, 101-124, 196-196

apps/web/src/features/admin/components/admin-language-models-page.tsx (1)

416-444: 📐 Maintainability & Code Quality

Verify the required web quality gates.

This change modifies route state, generated-client request bodies, and disabled control behavior. Run the repository-defined lint, typecheck, test, production-build, and browser verification commands before merge. Cover both a reasoning-capable gateway and the read-only Graph route.

Source: Coding guidelines

components/graph-rag-core/src/main/java/com/orgmemory/graphrag/query/KeywordPlanningModel.java (1)

4-47: LGTM!

components/graph-rag-core/src/main/java/com/orgmemory/graphrag/query/LightRagKeywordPlanner.java (3)

66-103: LGTM!


265-289: LGTM!


291-305: LGTM!

components/graph-rag-core/src/main/java/com/orgmemory/graphrag/query/LightRagQueryEngine.java (1)

80-83: LGTM!

Also applies to: 109-110, 210-215, 645-650

apps/api/src/main/java/com/orgmemory/api/assistant/GraphRagRuntimeConfiguration.java (1)

68-93: LGTM!

components/graph-rag-core/src/test/java/com/orgmemory/graphrag/query/LightRagKeywordPlannerCacheTests.java (1)

28-150: LGTM!

apps/api/src/test/java/com/orgmemory/api/assistant/OrganizationAwareQueryAnswerModelTests.java (1)

1-90: LGTM!

integrations/graph-rag-spring-ai/src/main/java/com/orgmemory/integrations/graphrag/springai/SpringAiKeywordPlanningModel.java (1)

22-43: 🎯 Functional Correctness

No fingerprint change needed for direct construction paths.

No current code constructs SpringAiKeywordPlanningModel outside OrganizationAwareKeywordPlanningModel; the organization-aware path uses its separate route fingerprint, so this narrower v1 fingerprint is not the production cache key.

components/graph-rag-core/src/main/java/com/orgmemory/graphrag/query/QueryAnswerModel.java (1)

16-42: 🎯 Functional Correctness

No action needed. Existing QueryAnswerModel.Request calls go through the 5-arg constructor outside direct Spring-Ai tests, and the organization-aware model is tested with a non-null organizationId.

apps/api/src/main/java/com/orgmemory/api/assistant/OrganizationAwareKeywordPlanningModel.java (1)

31-52: LGTM!

Also applies to: 67-79

apps/api/src/main/java/com/orgmemory/api/assistant/OrganizationAwareQueryAnswerModel.java (1)

32-48: LGTM!

evaluation/README.md (1)

57-83: LGTM!

evaluation/fixtures/workload-routing-v1.json (1)

1-46: LGTM!

evaluation/pyproject.toml (1)

19-19: LGTM!

evaluation/src/orgmemory_eval/workload_routing_runner.py (1)

149-175: LGTM!

Also applies to: 209-218

evaluation/tests/test_workload_routing_runner.py (1)

9-30: LGTM!

core/src/main/java/com/orgmemory/core/ai/OpenAiReasoningEffort.java (1)

5-16: LGTM!

core/src/test/java/com/orgmemory/core/ai/AiRouteTests.java (1)

11-29: LGTM!

ARCHITECTURE.md (1)

363-372: LGTM!

apps/worker/src/main/resources/application.yml (1)

76-88: LGTM!

infrastructure/deployment/compose.production.yaml (1)

67-72: LGTM!

infrastructure/deployment/production.env.example (1)

75-79: LGTM!

integrations/ai-model-gateways/src/main/java/com/orgmemory/integrations/ai/gateway/SpringAiChatModelProvider.java (1)

34-56: LGTM!

integrations/ai-model-gateways/src/main/java/com/orgmemory/integrations/ai/gateway/openai/OpenAiCompatibleChatModelFactory.java (1)

36-46: LGTM!

core/src/main/java/com/orgmemory/core/ai/AiGatewayProfileView.java (1)

13-13: LGTM!

core/src/main/java/com/orgmemory/core/ai/AiRoute.java (1)

3-10: LGTM!

core/src/main/java/com/orgmemory/core/ai/AiGatewayConnection.java (1)

16-51: LGTM!

core/src/main/java/com/orgmemory/core/ai/AiGatewayProfile.java (1)

36-38: LGTM!

Also applies to: 69-69, 78-78, 91-96, 136-139

core/src/main/java/com/orgmemory/core/ai/AiRouteOverrideView.java (1)

12-39: LGTM!

core/src/test/java/com/orgmemory/core/ai/AiGatewayAdministrationServiceTests.java (1)

16-16: LGTM!

Also applies to: 45-46, 68-72, 270-313, 315-344, 346-382

apps/api/src/main/java/com/orgmemory/api/admin/AdminAiModelController.java (2)

500-527: LGTM!


11-11: LGTM!

Also applies to: 156-156, 178-178, 299-299, 385-385, 402-402, 421-455

apps/api/src/main/resources/application.yml (1)

98-110: LGTM!

apps/api/src/test/java/com/orgmemory/api/admin/PermissionsAdminIntegrationTests.java (1)

139-144: LGTM!

.env.example (1)

10-14: LGTM!

core/src/main/java/com/orgmemory/core/ai/AiRouteOverride.java (1)

29-32: LGTM!

Also applies to: 47-89, 103-106

core/src/main/java/com/orgmemory/core/ai/AiRouteOverrideRepository.java (1)

21-24: LGTM!

core/src/main/java/com/orgmemory/core/ai/AiGatewayAdministrationService.java (1)

69-133: LGTM!

Also applies to: 135-158, 160-212, 234-340, 342-356, 397-423, 486-525, 616-636

integrations/ai-model-gateways/src/main/java/com/orgmemory/integrations/ai/gateway/AiGatewayProperties.java (1)

28-34: LGTM!

Also applies to: 36-75, 105-118

integrations/ai-model-gateways/src/main/java/com/orgmemory/integrations/ai/gateway/AiGatewayRegistry.java (1)

89-96: LGTM!

Also applies to: 116-124, 133-149

integrations/ai-model-gateways/src/main/java/com/orgmemory/integrations/ai/gateway/SpringAiChatModelFactory.java (1)

21-44: LGTM!

integrations/ai-model-gateways/src/main/java/com/orgmemory/integrations/ai/gateway/anthropic/AnthropicMessagesChatModelFactory.java (1)

30-51: LGTM!

integrations/ai-model-gateways/src/test/java/com/orgmemory/integrations/ai/gateway/AiGatewayPropertiesTests.java (1)

96-119: LGTM!

integrations/ai-model-gateways/src/test/java/com/orgmemory/integrations/ai/gateway/openai/OpenAiCompatibleChatModelFactoryTests.java (1)

1-45: LGTM!

Comment thread core/src/main/resources/db/migration/V20__rag_workload_route_options.sql Outdated
Comment thread evaluation/src/orgmemory_eval/workload_routing_runner.py
Comment thread evaluation/src/orgmemory_eval/workload_routing_runner.py
Comment thread evaluation/src/orgmemory_eval/workload_routing_runner.py
Comment thread evaluation/tests/test_workload_routing_runner.py Outdated
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