{"record":{"id":"adb81f25adfc8c6f","repo":"ruvnet/ruflo","slug":"prime-radiant-rag-coherence-warning-coherence","errorCode":null,"errorMessage":"[Prime Radiant] RAG coherence warning: ${coherence.violations.join(', ')}","messagePattern":"\\[Prime Radiant\\] RAG coherence warning: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"v3/plugins/prime-radiant/src/plugin.ts","lineNumber":1247,"sourceCode":"  private createPreRagRetrievalHook(): PluginHook {\n    return {\n      name: 'pr/pre-rag-retrieval',\n      event: 'pre-rag-retrieval',\n      priority: 100 as HookPriority,\n      description: 'Checks retrieved context coherence to prevent hallucinations',\n      handler: async (_context: PluginContext, payload: unknown) => {\n        const retrieval = payload as {\n          retrievedDocs: Array<{ embedding: number[] }>;\n        };\n\n        const vectors = retrieval.retrievedDocs.map((d) => new Float32Array(d.embedding));\n\n        if (vectors.length < 2) return payload;\n\n        const coherence = await this.bridge.checkCoherence(vectors);\n\n        if (coherence.energy > 0.5) {\n          console.warn(\n            `[Prime Radiant] RAG coherence warning: ${coherence.violations.join(', ')}`\n          );\n\n          return {\n            ...retrieval,\n            retrievedDocs: retrieval.retrievedDocs.slice(\n              0,\n              Math.ceil(retrieval.retrievedDocs.length / 2)\n            ),\n            coherenceFiltered: true,\n            originalCoherenceEnergy: coherence.energy,\n          };\n        }\n\n        return payload;\n      },\n    };\n  }","sourceCodeStart":1229,"sourceCodeEnd":1265,"githubUrl":"https://github.com/ruvnet/ruflo/blob/fa13ee4ad60ac2090b1480656eb233521790d640/v3/plugins/prime-radiant/src/plugin.ts#L1229-L1265","documentation":"Warning branch of the pre-rag-retrieval hook in PrimeRadiantPlugin: retrieved context vectors failed the coherence check with listed violations. The retrieval proceeds, but the context may induce hallucinations and is surfaced as a warning.","triggerScenarios":"RAG retrieval/insertion violates one or more coherence constraints (contradictory or low-coherence context); violations are joined into the warning for inspection.","commonSituations":"See trigger scenarios.","solutions":["Inspect the listed coherence violations and revise or remove the offending RAG documents/chunks.","Re-embed documents with the current embedding model if they were embedded with an older one.","Adjust coherence thresholds if the violations are false positives."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"fa13ee4ad60ac2090b1480656eb233521790d640","analyzedAt":"2026-08-18T21:34:22.708Z","contentChangedAt":"2026-08-18T21:34:22.708Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}