perf(graphrag): cache exact query embeddings - #326
Conversation
|
Warning Review limit reached
Next review available in: 11 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the 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 configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (9)
📝 WalkthroughWalkthroughThe PR adds a permission-scoped query embedding cache. It supports batching, deduplication, concurrent request coalescing, bounded persistence, telemetry, scheduled cleanup, runtime wiring, and PostgreSQL cache maintenance. ChangesQuery embedding cache
Estimated code review effort: 4 (Complex) | ~60 minutes Sequence Diagram(s)sequenceDiagram
participant LightRagQueryEngine
participant CachingQueryEmbeddingService
participant ModelInvocationCache
participant TextEmbeddingPort
LightRagQueryEngine->>CachingQueryEmbeddingService: Request embeddings
CachingQueryEmbeddingService->>ModelInvocationCache: Read cache entries
CachingQueryEmbeddingService->>TextEmbeddingPort: Embed cache misses
TextEmbeddingPort-->>CachingQueryEmbeddingService: Return vectors
CachingQueryEmbeddingService->>ModelInvocationCache: Store bounded entries
CachingQueryEmbeddingService-->>LightRagQueryEngine: Return ordered vectors
Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 2📝 Generate docstrings 💡
🛠️ Fix failing CI checks 💡
🧪 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. Comment |
TegamiThis repository uses Tegami to manage releases. When your changes affect published packages, add a changelog file under Create a changelog → · Changelog format Release preview
Changelogs in this PR
Run Managed by Tegami. |
There was a problem hiding this comment.
Actionable comments posted: 6
🤖 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/main/java/com/orgmemory/api/knowledge/QueryEmbeddingCacheConfiguration.java`:
- Around line 104-120: Override putBounded in NoOpModelInvocationCache to accept
and discard bounded cache entries without throwing
UnsupportedOperationException, while preserving the existing no-op behavior of
get, put, and invalidate so runtimes without a cache adapter do not emit
CACHE_FAILURE.
In
`@apps/api/src/main/java/com/orgmemory/api/knowledge/SpringAiQueryEmbeddingAdapter.java`:
- Around line 68-76: Update SpringAiQueryEmbeddingAdapter’s embedding flow to
obtain the canonical-query ProjectionNamespace through a new factory method on
KnowledgeProjectionNamespaces instead of constructing it with raw "default" and
"canonical-query" literals. Ensure the factory centralizes the workspace and
collection values, then pass its result to embeddings.embedAll while preserving
the existing organization and profile arguments.
In
`@components/graph-rag-core/src/main/java/com/orgmemory/graphrag/query/CachingQueryEmbeddingService.java`:
- Around line 169-201: Update loadOwnedMisses to catch both RuntimeException and
Error, completing every future in ownedMisses exceptionally before rethrowing.
Preserve the existing finally cleanup and success behavior, matching the leader
path’s Error handling so followers always receive a terminal completion.
In
`@components/graph-rag-core/src/test/java/com/orgmemory/graphrag/query/CachingQueryEmbeddingServiceTests.java`:
- Around line 168-179: Update the PruneFailingModelInvocationCache test double
used by boundedPersistenceFailureDoesNotLeaveCacheRowsBehind so its putBounded
implementation persists the supplied entries and then triggers the existing
pruning failure, rather than relying on the interface default. Preserve the
existing prune override and assertions so the test verifies failed bounding
removes all persisted rows.
In
`@components/graph-rag-testkit/src/main/java/com/orgmemory/graphrag/testkit/InMemoryModelInvocationCache.java`:
- Around line 34-55: Update InMemoryModelInvocationCache.putBounded to validate
namespace, normalized operation, boundedEntries, now, and a strictly positive
maximumEntries before mutating entries; validate every boundedEntries key also
matches the namespace and normalized operation, rejecting invalid input
consistently with the production implementation.
In
`@integrations/graph-rag-postgres/src/test/java/com/orgmemory/graphrag/postgres/PostgresSharedProjectionIntegrationTests.java`:
- Around line 161-174: Extend the assertions after putBounded in
PostgresSharedProjectionIntegrationTests to query the retained input_hash values
from graph_model_invocation_cache using the same namespace and QUERY_EMBEDDING
filters. Assert that pruning retains the hashes corresponding to suffixes 2 and
3, while preserving the existing count assertion.
🪄 Autofix
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: 8309a0ef-2bed-4c14-8602-fac2d44f0a2a
📒 Files selected for processing (21)
apps/api/src/main/java/com/orgmemory/api/assistant/GraphRagRuntimeConfiguration.javaapps/api/src/main/java/com/orgmemory/api/knowledge/MicrometerQueryEmbeddingCacheEventSink.javaapps/api/src/main/java/com/orgmemory/api/knowledge/QueryEmbeddingCacheConfiguration.javaapps/api/src/main/java/com/orgmemory/api/knowledge/QueryEmbeddingCacheJanitor.javaapps/api/src/main/java/com/orgmemory/api/knowledge/QueryEmbeddingCacheProperties.javaapps/api/src/main/java/com/orgmemory/api/knowledge/SpringAiQueryEmbeddingAdapter.javaapps/api/src/main/resources/application.ymlapps/api/src/test/java/com/orgmemory/api/knowledge/QueryEmbeddingCacheWiringTests.javacomponents/graph-rag-core/src/main/java/com/orgmemory/graphrag/cache/ModelInvocationCache.javacomponents/graph-rag-core/src/main/java/com/orgmemory/graphrag/cache/ModelInvocationCacheKeys.javacomponents/graph-rag-core/src/main/java/com/orgmemory/graphrag/query/CachingQueryEmbeddingService.javacomponents/graph-rag-core/src/main/java/com/orgmemory/graphrag/query/LightRagQueryEngine.javacomponents/graph-rag-core/src/main/java/com/orgmemory/graphrag/query/QueryEmbeddingCacheEventSink.javacomponents/graph-rag-core/src/test/java/com/orgmemory/graphrag/query/CachingQueryEmbeddingServiceTests.javacomponents/graph-rag-testkit/src/main/java/com/orgmemory/graphrag/testkit/InMemoryModelInvocationCache.javacomponents/graph-rag-testkit/src/test/java/com/orgmemory/graphrag/testkit/LightRagQueryRuntimeConformanceTests.javacore/src/main/resources/db/migration/V29__bound_query_embedding_cache_cleanup.sqlintegrations/graph-rag-postgres/src/main/java/com/orgmemory/graphrag/postgres/PostgresGraphRagCacheStore.javaintegrations/graph-rag-postgres/src/main/java/com/orgmemory/graphrag/postgres/PostgresModelInvocationCache.javaintegrations/graph-rag-postgres/src/test/java/com/orgmemory/graphrag/postgres/PostgresGraphRagCacheStoreTests.javaintegrations/graph-rag-postgres/src/test/java/com/orgmemory/graphrag/postgres/PostgresSharedProjectionIntegrationTests.java
📜 Review details
⏰ Context from checks skipped due to timeout. (5)
- GitHub Check: Backend · Java 25
- GitHub Check: PostgreSQL GraphRAG
- GitHub Check: Neo4j adapter
- GitHub Check: OpenSearch adapter
- GitHub Check: Web · Node 24
🧰 Additional context used
📓 Path-based instructions (4)
**/*
📄 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.
Readdocs/guidelines/agent-safety.mdbefore retrieval, AI, MCP, permission, upload, graph, or export work; never commit secrets or customer data.
Keepddl-auto=validateand pair every persisted-model change with a Flyway migration.
Use the testing harness; a terminating clean test is the JVM context gate, andbootRunis not verification.
Files:
core/src/main/resources/db/migration/V29__bound_query_embedding_cache_cleanup.sqlapps/api/src/main/java/com/orgmemory/api/knowledge/MicrometerQueryEmbeddingCacheEventSink.javaapps/api/src/main/java/com/orgmemory/api/knowledge/QueryEmbeddingCacheProperties.javacomponents/graph-rag-core/src/main/java/com/orgmemory/graphrag/query/QueryEmbeddingCacheEventSink.javacomponents/graph-rag-testkit/src/main/java/com/orgmemory/graphrag/testkit/InMemoryModelInvocationCache.javaapps/api/src/main/resources/application.ymlapps/api/src/main/java/com/orgmemory/api/knowledge/QueryEmbeddingCacheJanitor.javacomponents/graph-rag-core/src/main/java/com/orgmemory/graphrag/cache/ModelInvocationCacheKeys.javaintegrations/graph-rag-postgres/src/test/java/com/orgmemory/graphrag/postgres/PostgresSharedProjectionIntegrationTests.javacomponents/graph-rag-core/src/main/java/com/orgmemory/graphrag/cache/ModelInvocationCache.javacomponents/graph-rag-testkit/src/test/java/com/orgmemory/graphrag/testkit/LightRagQueryRuntimeConformanceTests.javaapps/api/src/main/java/com/orgmemory/api/knowledge/SpringAiQueryEmbeddingAdapter.javaapps/api/src/main/java/com/orgmemory/api/knowledge/QueryEmbeddingCacheConfiguration.javaapps/api/src/main/java/com/orgmemory/api/assistant/GraphRagRuntimeConfiguration.javaapps/api/src/test/java/com/orgmemory/api/knowledge/QueryEmbeddingCacheWiringTests.javaintegrations/graph-rag-postgres/src/main/java/com/orgmemory/graphrag/postgres/PostgresModelInvocationCache.javacomponents/graph-rag-core/src/test/java/com/orgmemory/graphrag/query/CachingQueryEmbeddingServiceTests.javaintegrations/graph-rag-postgres/src/main/java/com/orgmemory/graphrag/postgres/PostgresGraphRagCacheStore.javacomponents/graph-rag-core/src/main/java/com/orgmemory/graphrag/query/LightRagQueryEngine.javaintegrations/graph-rag-postgres/src/test/java/com/orgmemory/graphrag/postgres/PostgresGraphRagCacheStoreTests.javacomponents/graph-rag-core/src/main/java/com/orgmemory/graphrag/query/CachingQueryEmbeddingService.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/V29__bound_query_embedding_cache_cleanup.sql
**/*.java
📄 CodeRabbit inference engine (AGENTS.md)
Apply IDE inspection only to edited backend Java files.
Files:
apps/api/src/main/java/com/orgmemory/api/knowledge/MicrometerQueryEmbeddingCacheEventSink.javaapps/api/src/main/java/com/orgmemory/api/knowledge/QueryEmbeddingCacheProperties.javacomponents/graph-rag-core/src/main/java/com/orgmemory/graphrag/query/QueryEmbeddingCacheEventSink.javacomponents/graph-rag-testkit/src/main/java/com/orgmemory/graphrag/testkit/InMemoryModelInvocationCache.javaapps/api/src/main/java/com/orgmemory/api/knowledge/QueryEmbeddingCacheJanitor.javacomponents/graph-rag-core/src/main/java/com/orgmemory/graphrag/cache/ModelInvocationCacheKeys.javaintegrations/graph-rag-postgres/src/test/java/com/orgmemory/graphrag/postgres/PostgresSharedProjectionIntegrationTests.javacomponents/graph-rag-core/src/main/java/com/orgmemory/graphrag/cache/ModelInvocationCache.javacomponents/graph-rag-testkit/src/test/java/com/orgmemory/graphrag/testkit/LightRagQueryRuntimeConformanceTests.javaapps/api/src/main/java/com/orgmemory/api/knowledge/SpringAiQueryEmbeddingAdapter.javaapps/api/src/main/java/com/orgmemory/api/knowledge/QueryEmbeddingCacheConfiguration.javaapps/api/src/main/java/com/orgmemory/api/assistant/GraphRagRuntimeConfiguration.javaapps/api/src/test/java/com/orgmemory/api/knowledge/QueryEmbeddingCacheWiringTests.javaintegrations/graph-rag-postgres/src/main/java/com/orgmemory/graphrag/postgres/PostgresModelInvocationCache.javacomponents/graph-rag-core/src/test/java/com/orgmemory/graphrag/query/CachingQueryEmbeddingServiceTests.javaintegrations/graph-rag-postgres/src/main/java/com/orgmemory/graphrag/postgres/PostgresGraphRagCacheStore.javacomponents/graph-rag-core/src/main/java/com/orgmemory/graphrag/query/LightRagQueryEngine.javaintegrations/graph-rag-postgres/src/test/java/com/orgmemory/graphrag/postgres/PostgresGraphRagCacheStoreTests.javacomponents/graph-rag-core/src/main/java/com/orgmemory/graphrag/query/CachingQueryEmbeddingService.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/knowledge/MicrometerQueryEmbeddingCacheEventSink.javaapps/api/src/main/java/com/orgmemory/api/knowledge/QueryEmbeddingCacheProperties.javaapps/api/src/main/java/com/orgmemory/api/knowledge/QueryEmbeddingCacheJanitor.javaapps/api/src/main/java/com/orgmemory/api/knowledge/SpringAiQueryEmbeddingAdapter.javaapps/api/src/main/java/com/orgmemory/api/knowledge/QueryEmbeddingCacheConfiguration.javaapps/api/src/main/java/com/orgmemory/api/assistant/GraphRagRuntimeConfiguration.java
🧠 Learnings (4)
📚 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/V29__bound_query_embedding_cache_cleanup.sql
📚 Learning: 2026-07-24T22:53:12.988Z
Learnt from: kl3inIT
Repo: kl3inIT/OrgMemory PR: 40
File: apps/api/src/main/java/com/orgmemory/api/knowledge/CitationContentController.java:0-0
Timestamp: 2026-07-24T22:53:12.988Z
Learning: For OrgMemory knowledge content handling in the API, treat `KnowledgeContentType` as the single closed policy (source of truth) for: canonical storage media type, browser-safe response media type, upload eligibility rules, and inline disposition behavior. Do not duplicate or bypass these decisions in controllers/services; route media-type and disposition logic through `KnowledgeContentType`. Specifically, Markdown should be stored with the canonical media type `text/markdown`, but served as `text/plain` when returning browser-safe citation preview content.
Applied to files:
apps/api/src/main/java/com/orgmemory/api/knowledge/MicrometerQueryEmbeddingCacheEventSink.javaapps/api/src/main/java/com/orgmemory/api/knowledge/QueryEmbeddingCacheProperties.javaapps/api/src/main/java/com/orgmemory/api/knowledge/QueryEmbeddingCacheJanitor.javaapps/api/src/main/java/com/orgmemory/api/knowledge/SpringAiQueryEmbeddingAdapter.javaapps/api/src/main/java/com/orgmemory/api/knowledge/QueryEmbeddingCacheConfiguration.java
📚 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/knowledge/MicrometerQueryEmbeddingCacheEventSink.javaapps/api/src/main/java/com/orgmemory/api/knowledge/QueryEmbeddingCacheProperties.javaapps/api/src/main/java/com/orgmemory/api/knowledge/QueryEmbeddingCacheJanitor.javaapps/api/src/main/java/com/orgmemory/api/knowledge/SpringAiQueryEmbeddingAdapter.javaapps/api/src/main/java/com/orgmemory/api/knowledge/QueryEmbeddingCacheConfiguration.javaapps/api/src/main/java/com/orgmemory/api/assistant/GraphRagRuntimeConfiguration.java
📚 Learning: 2026-08-05T04:37:30.530Z
Learnt from: kl3inIT
Repo: kl3inIT/OrgMemory PR: 296
File: integrations/graph-rag-postgres/src/test/java/com/orgmemory/graphrag/postgres/AuthorizedMultiSnapshotQueryIntegrationTests.java:34-52
Timestamp: 2026-08-05T04:37:30.530Z
Learning: In the integrations/graph-rag-postgres module, treat org.testcontainers.postgresql.PostgreSQLContainer as a non-generic type. Do not add type arguments such as <?> to PostgreSQLContainer declarations, because the resolved dependency type does not take parameters and compilation will fail.
Applied to files:
integrations/graph-rag-postgres/src/test/java/com/orgmemory/graphrag/postgres/PostgresSharedProjectionIntegrationTests.javaintegrations/graph-rag-postgres/src/main/java/com/orgmemory/graphrag/postgres/PostgresModelInvocationCache.javaintegrations/graph-rag-postgres/src/main/java/com/orgmemory/graphrag/postgres/PostgresGraphRagCacheStore.javaintegrations/graph-rag-postgres/src/test/java/com/orgmemory/graphrag/postgres/PostgresGraphRagCacheStoreTests.java
🪛 PMD (7.26.0)
components/graph-rag-core/src/test/java/com/orgmemory/graphrag/query/CachingQueryEmbeddingServiceTests.java
[Medium] 514-514: PreserveStackTrace (Best Practices): Thrown exception does not preserve the stack trace of exception 'interrupted' on all code paths
(PreserveStackTrace (Best Practices))
components/graph-rag-core/src/main/java/com/orgmemory/graphrag/query/CachingQueryEmbeddingService.java
[Medium] 280-280: PreserveStackTrace (Best Practices): Thrown exception does not preserve the stack trace of exception 'interrupted' on all code paths
(PreserveStackTrace (Best Practices))
[Medium] 284-284: PreserveStackTrace (Best Practices): Thrown exception does not preserve the stack trace of exception 'failure' on all code paths
(PreserveStackTrace (Best Practices))
[Medium] 286-286: PreserveStackTrace (Best Practices): Thrown exception does not preserve the stack trace of exception 'failure' on all code paths
(PreserveStackTrace (Best Practices))
🪛 SQLFluff (4.2.2)
core/src/main/resources/db/migration/V29__bound_query_embedding_cache_cleanup.sql
[error] 1-8: CREATE INDEX should use CONCURRENTLY to avoid locking the table during the build.
(PG01)
[error] 10-11: CREATE INDEX should use CONCURRENTLY to avoid locking the table during the build.
(PG01)
🪛 Squawk (2.61.0)
core/src/main/resources/db/migration/V29__bound_query_embedding_cache_cleanup.sql
[warning] 1-8: During normal index creation, table updates are blocked, but reads are still allowed. Use concurrently to avoid blocking writes.
(require-concurrent-index-creation)
[warning] 10-11: During normal index creation, table updates are blocked, but reads are still allowed. Use concurrently to avoid blocking writes.
(require-concurrent-index-creation)
🔇 Additional comments (20)
core/src/main/resources/db/migration/V29__bound_query_embedding_cache_cleanup.sql (1)
1-8: LGTM!Also applies to: 10-11
integrations/graph-rag-postgres/src/main/java/com/orgmemory/graphrag/postgres/PostgresGraphRagCacheStore.java (1)
15-15: LGTM!Also applies to: 153-203, 216-295
integrations/graph-rag-postgres/src/main/java/com/orgmemory/graphrag/postgres/PostgresModelInvocationCache.java (1)
6-6: LGTM!Also applies to: 39-66
integrations/graph-rag-postgres/src/test/java/com/orgmemory/graphrag/postgres/PostgresGraphRagCacheStoreTests.java (1)
4-4: LGTM!Also applies to: 33-55
integrations/graph-rag-postgres/src/test/java/com/orgmemory/graphrag/postgres/PostgresSharedProjectionIntegrationTests.java (1)
11-11: LGTM!Also applies to: 38-38, 128-160, 176-215
components/graph-rag-core/src/main/java/com/orgmemory/graphrag/cache/ModelInvocationCache.java (1)
5-5: LGTM!Also applies to: 22-75
components/graph-rag-core/src/main/java/com/orgmemory/graphrag/cache/ModelInvocationCacheKeys.java (1)
11-12: LGTM!Also applies to: 52-75, 119-126
components/graph-rag-core/src/main/java/com/orgmemory/graphrag/query/CachingQueryEmbeddingService.java (1)
297-322: LGTM!components/graph-rag-core/src/test/java/com/orgmemory/graphrag/query/CachingQueryEmbeddingServiceTests.java (1)
260-290: LGTM!Also applies to: 315-345
apps/api/src/main/java/com/orgmemory/api/knowledge/QueryEmbeddingCacheProperties.java (1)
6-56: LGTM!apps/api/src/main/java/com/orgmemory/api/knowledge/SpringAiQueryEmbeddingAdapter.java (1)
12-40: LGTM!components/graph-rag-core/src/main/java/com/orgmemory/graphrag/query/LightRagQueryEngine.java (1)
43-43: LGTM!Also applies to: 56-94, 311-317
apps/api/src/main/java/com/orgmemory/api/knowledge/QueryEmbeddingCacheConfiguration.java (1)
43-49: 🩺 Stability & AvailabilityNo change needed.
PostgresGraphRagAutoConfigurationregisters only oneModelInvocationCachebean (postgresqlModelInvocationCache), soObjectProvider#getIfAvailable(NoOpModelInvocationCache::new)does not create an ambiguity.components/graph-rag-core/src/main/java/com/orgmemory/graphrag/query/QueryEmbeddingCacheEventSink.java (1)
1-34: LGTM!apps/api/src/main/java/com/orgmemory/api/assistant/GraphRagRuntimeConfiguration.java (1)
8-8: LGTM!Also applies to: 55-55
apps/api/src/main/java/com/orgmemory/api/knowledge/MicrometerQueryEmbeddingCacheEventSink.java (1)
1-38: LGTM!apps/api/src/main/java/com/orgmemory/api/knowledge/QueryEmbeddingCacheJanitor.java (1)
1-57: LGTM!apps/api/src/main/resources/application.yml (1)
122-127: LGTM!apps/api/src/test/java/com/orgmemory/api/knowledge/QueryEmbeddingCacheWiringTests.java (1)
1-256: LGTM!components/graph-rag-testkit/src/test/java/com/orgmemory/graphrag/testkit/LightRagQueryRuntimeConformanceTests.java (1)
23-23: LGTM!Also applies to: 41-42, 162-193
Summary
ModelInvocationCacheCorrectness and safety
Verification
Errorcompletes coalesced followers instead of leaving them blockedErrorreleases every earlier flight owned by the same multi-input call./gradlew clean checkDocumentation impact
Scope
This is Phase 1 exact query text-to-vector caching only. It does not add semantic answer caching or retrieval-result caching, and it is not active in production until this PR is merged and deployed.