@carlonicora/nestjs-neo4jsonapi 2.14.10 → 2.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agents/contextualiser/contexts/contextualiser.context.d.ts +41 -0
- package/dist/agents/contextualiser/contexts/contextualiser.context.d.ts.map +1 -1
- package/dist/agents/contextualiser/contexts/contextualiser.context.js +17 -0
- package/dist/agents/contextualiser/contexts/contextualiser.context.js.map +1 -1
- package/dist/agents/contextualiser/contexts/notebook.context.d.ts +22 -0
- package/dist/agents/contextualiser/contexts/notebook.context.d.ts.map +1 -1
- package/dist/agents/contextualiser/contexts/notebook.context.js +14 -0
- package/dist/agents/contextualiser/contexts/notebook.context.js.map +1 -1
- package/dist/agents/contextualiser/factories/contextualiser.context.factory.d.ts.map +1 -1
- package/dist/agents/contextualiser/factories/contextualiser.context.factory.js +2 -0
- package/dist/agents/contextualiser/factories/contextualiser.context.factory.js.map +1 -1
- package/dist/agents/contextualiser/nodes/atomicfacts.node.service.d.ts.map +1 -1
- package/dist/agents/contextualiser/nodes/atomicfacts.node.service.js +17 -5
- package/dist/agents/contextualiser/nodes/atomicfacts.node.service.js.map +1 -1
- package/dist/agents/contextualiser/nodes/chunk.node.service.d.ts +1 -14
- package/dist/agents/contextualiser/nodes/chunk.node.service.d.ts.map +1 -1
- package/dist/agents/contextualiser/nodes/chunk.node.service.js +56 -206
- package/dist/agents/contextualiser/nodes/chunk.node.service.js.map +1 -1
- package/dist/agents/contextualiser/nodes/chunk.vector.node.service.d.ts +3 -12
- package/dist/agents/contextualiser/nodes/chunk.vector.node.service.d.ts.map +1 -1
- package/dist/agents/contextualiser/nodes/chunk.vector.node.service.js +44 -133
- package/dist/agents/contextualiser/nodes/chunk.vector.node.service.js.map +1 -1
- package/dist/agents/contextualiser/nodes/keyconcepts.node.service.d.ts +1 -2
- package/dist/agents/contextualiser/nodes/keyconcepts.node.service.d.ts.map +1 -1
- package/dist/agents/contextualiser/nodes/keyconcepts.node.service.js +60 -60
- package/dist/agents/contextualiser/nodes/keyconcepts.node.service.js.map +1 -1
- package/dist/agents/contextualiser/nodes/question.refiner.node.service.d.ts.map +1 -1
- package/dist/agents/contextualiser/nodes/question.refiner.node.service.js +7 -2
- package/dist/agents/contextualiser/nodes/question.refiner.node.service.js.map +1 -1
- package/dist/agents/contextualiser/nodes/rational.node.service.js +2 -1
- package/dist/agents/contextualiser/nodes/rational.node.service.js.map +1 -1
- package/dist/agents/contextualiser/services/contextualiser.service.d.ts.map +1 -1
- package/dist/agents/contextualiser/services/contextualiser.service.js +30 -22
- package/dist/agents/contextualiser/services/contextualiser.service.js.map +1 -1
- package/dist/agents/prompts/index.d.ts +0 -2
- package/dist/agents/prompts/index.d.ts.map +1 -1
- package/dist/agents/prompts/index.js +7 -5
- package/dist/agents/prompts/index.js.map +1 -1
- package/dist/agents/responder/contexts/responder.context.d.ts +96 -0
- package/dist/agents/responder/contexts/responder.context.d.ts.map +1 -1
- package/dist/agents/responder/interfaces/unified.trace.interface.d.ts +9 -0
- package/dist/agents/responder/interfaces/unified.trace.interface.d.ts.map +1 -1
- package/dist/agents/responder/nodes/__tests__/helpers/answer-node.harness.d.ts +38 -0
- package/dist/agents/responder/nodes/__tests__/helpers/answer-node.harness.d.ts.map +1 -0
- package/dist/agents/responder/nodes/__tests__/helpers/answer-node.harness.js +36 -0
- package/dist/agents/responder/nodes/__tests__/helpers/answer-node.harness.js.map +1 -0
- package/dist/agents/responder/nodes/graph.node.service.d.ts.map +1 -1
- package/dist/agents/responder/nodes/graph.node.service.js +18 -3
- package/dist/agents/responder/nodes/graph.node.service.js.map +1 -1
- package/dist/agents/responder/nodes/planner.node.service.d.ts.map +1 -1
- package/dist/agents/responder/nodes/planner.node.service.js +9 -0
- package/dist/agents/responder/nodes/planner.node.service.js.map +1 -1
- package/dist/agents/responder/nodes/responder.answer.node.service.d.ts +26 -1
- package/dist/agents/responder/nodes/responder.answer.node.service.d.ts.map +1 -1
- package/dist/agents/responder/nodes/responder.answer.node.service.js +127 -13
- package/dist/agents/responder/nodes/responder.answer.node.service.js.map +1 -1
- package/dist/agents/responder/services/responder.service.d.ts.map +1 -1
- package/dist/agents/responder/services/responder.service.js +4 -0
- package/dist/agents/responder/services/responder.service.js.map +1 -1
- package/dist/common/utils/settled.d.ts +33 -0
- package/dist/common/utils/settled.d.ts.map +1 -0
- package/dist/common/utils/settled.js +66 -0
- package/dist/common/utils/settled.js.map +1 -0
- package/dist/config/interfaces/config.prompts.interface.d.ts +12 -0
- package/dist/config/interfaces/config.prompts.interface.d.ts.map +1 -1
- package/dist/core/llm/services/model.service.d.ts.map +1 -1
- package/dist/core/llm/services/model.service.js +5 -2
- package/dist/core/llm/services/model.service.js.map +1 -1
- package/dist/core/llm/services/reasoning-content-fetch.d.ts +41 -0
- package/dist/core/llm/services/reasoning-content-fetch.d.ts.map +1 -0
- package/dist/core/llm/services/reasoning-content-fetch.js +143 -0
- package/dist/core/llm/services/reasoning-content-fetch.js.map +1 -0
- package/dist/eval/retrieval/end-to-end-sweep.service.d.ts +52 -0
- package/dist/eval/retrieval/end-to-end-sweep.service.d.ts.map +1 -0
- package/dist/eval/retrieval/end-to-end-sweep.service.js +194 -0
- package/dist/eval/retrieval/end-to-end-sweep.service.js.map +1 -0
- package/dist/eval/retrieval/evidence.matcher.d.ts +23 -0
- package/dist/eval/retrieval/evidence.matcher.d.ts.map +1 -0
- package/dist/eval/retrieval/evidence.matcher.js +38 -0
- package/dist/eval/retrieval/evidence.matcher.js.map +1 -0
- package/dist/eval/retrieval/index.d.ts +10 -0
- package/dist/eval/retrieval/index.d.ts.map +1 -0
- package/dist/eval/retrieval/index.js +35 -0
- package/dist/eval/retrieval/index.js.map +1 -0
- package/dist/eval/retrieval/question-set.loader.d.ts +16 -0
- package/dist/eval/retrieval/question-set.loader.d.ts.map +1 -0
- package/dist/eval/retrieval/question-set.loader.js +73 -0
- package/dist/eval/retrieval/question-set.loader.js.map +1 -0
- package/dist/eval/retrieval/retrieval-eval.module.d.ts +14 -0
- package/dist/eval/retrieval/retrieval-eval.module.d.ts.map +1 -0
- package/dist/eval/retrieval/retrieval-eval.module.js +48 -0
- package/dist/eval/retrieval/retrieval-eval.module.js.map +1 -0
- package/dist/eval/retrieval/retrieval-eval.types.d.ts +84 -0
- package/dist/eval/retrieval/retrieval-eval.types.d.ts.map +1 -0
- package/dist/eval/retrieval/retrieval-eval.types.js +25 -0
- package/dist/eval/retrieval/retrieval-eval.types.js.map +1 -0
- package/dist/eval/retrieval/retrieval-sweep.service.d.ts +35 -0
- package/dist/eval/retrieval/retrieval-sweep.service.d.ts.map +1 -0
- package/dist/eval/retrieval/retrieval-sweep.service.js +93 -0
- package/dist/eval/retrieval/retrieval-sweep.service.js.map +1 -0
- package/dist/eval/retrieval/rubric-judge.service.d.ts +30 -0
- package/dist/eval/retrieval/rubric-judge.service.d.ts.map +1 -0
- package/dist/eval/retrieval/rubric-judge.service.js +138 -0
- package/dist/eval/retrieval/rubric-judge.service.js.map +1 -0
- package/dist/eval/retrieval/sweep-report.d.ts +11 -0
- package/dist/eval/retrieval/sweep-report.d.ts.map +1 -0
- package/dist/eval/retrieval/sweep-report.js +79 -0
- package/dist/eval/retrieval/sweep-report.js.map +1 -0
- package/dist/eval/retrieval/token-accounting.check.d.ts +39 -0
- package/dist/eval/retrieval/token-accounting.check.d.ts.map +1 -0
- package/dist/eval/retrieval/token-accounting.check.js +75 -0
- package/dist/eval/retrieval/token-accounting.check.js.map +1 -0
- package/dist/foundations/atomicfact/repositories/atomicfact.repository.d.ts.map +1 -1
- package/dist/foundations/atomicfact/repositories/atomicfact.repository.js +7 -0
- package/dist/foundations/atomicfact/repositories/atomicfact.repository.js.map +1 -1
- package/dist/foundations/chunk/repositories/chunk.repository.d.ts +87 -1
- package/dist/foundations/chunk/repositories/chunk.repository.d.ts.map +1 -1
- package/dist/foundations/chunk/repositories/chunk.repository.js +239 -50
- package/dist/foundations/chunk/repositories/chunk.repository.js.map +1 -1
- package/dist/foundations/chunk/repositories/retrieval.constants.d.ts +69 -0
- package/dist/foundations/chunk/repositories/retrieval.constants.d.ts.map +1 -0
- package/dist/foundations/chunk/repositories/retrieval.constants.js +72 -0
- package/dist/foundations/chunk/repositories/retrieval.constants.js.map +1 -0
- package/dist/foundations/keyconcept/repositories/keyconcept.repository.d.ts +2 -0
- package/dist/foundations/keyconcept/repositories/keyconcept.repository.d.ts.map +1 -1
- package/dist/foundations/keyconcept/repositories/keyconcept.repository.js +9 -5
- package/dist/foundations/keyconcept/repositories/keyconcept.repository.js.map +1 -1
- package/package.json +1 -1
|
@@ -27,6 +27,7 @@ const neo4j_service_1 = require("../../../core/neo4j/services/neo4j.service");
|
|
|
27
27
|
const security_service_1 = require("../../../core/security/services/security.service");
|
|
28
28
|
const chunk_entity_1 = require("../../chunk/entities/chunk.entity");
|
|
29
29
|
const chunk_meta_1 = require("../entities/chunk.meta");
|
|
30
|
+
const retrieval_constants_1 = require("./retrieval.constants");
|
|
30
31
|
const reciprocal_rank_fusion_1 = require("../services/reciprocal-rank-fusion");
|
|
31
32
|
let ChunkRepository = ChunkRepository_1 = class ChunkRepository {
|
|
32
33
|
constructor(neo4j, modelService, embedderService, clsService, securityService, aiSourceQuery, agentScope) {
|
|
@@ -101,67 +102,163 @@ let ChunkRepository = ChunkRepository_1 = class ChunkRepository {
|
|
|
101
102
|
* lives with the caller (the contextualiser knows which content the run is
|
|
102
103
|
* bound to), which is why it is passed down rather than derived here. Absent,
|
|
103
104
|
* `EmbedderService.persistUsage` records nothing.
|
|
105
|
+
*
|
|
106
|
+
* Each returned chunk carries `score`: the cosine similarity of that chunk against
|
|
107
|
+
* the question embedding. Both retrieval halves have to reach the notebook on ONE
|
|
108
|
+
* scale — the answer node orders entries best-score-first and fills a character
|
|
109
|
+
* budget, so an unscored half sorts last however good it is. The RRF score is NOT
|
|
110
|
+
* usable for that: it is rank-derived (the top hit scores ≈1/61 whether it is a
|
|
111
|
+
* perfect match or noise) and is not comparable with a cosine from the graph half.
|
|
104
112
|
*/
|
|
105
113
|
async findPotentialChunks(params) {
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
114
|
+
// The question is embedded ONCE per turn. When the caller already has the
|
|
115
|
+
// vector (chunk_vector computes it and shares it through the graph state),
|
|
116
|
+
// do not pay for a second identical embedding.
|
|
117
|
+
const queryEmbedding = params.queryEmbedding ??
|
|
118
|
+
(await this.embedderService.vectoriseText({
|
|
119
|
+
text: params.question,
|
|
120
|
+
attribution: params.attribution,
|
|
121
|
+
}));
|
|
110
122
|
// Lucene special-character escape so user questions can't break the fulltext query.
|
|
123
|
+
//
|
|
124
|
+
// NOT `buildFulltextTerm`: that helper tokenises and AND-joins a
|
|
125
|
+
// contains-wildcard per token, which is right for a search BOX (a few
|
|
126
|
+
// words) and wrong for a natural-language question. A 28-token question
|
|
127
|
+
// becomes 28 AND-ed clauses that no chunk can satisfy — measured against
|
|
128
|
+
// the eval corpus, the identical question went from 1,786 fulltext hits to
|
|
129
|
+
// 0, silently collapsing hybrid retrieval to its vector branch alone.
|
|
111
130
|
const term = params.question.replace(/([+\-!(){}\[\]^"~*?:\\\/]|&&|\|\|)/g, "\\$1");
|
|
112
|
-
// The access-scoped id-set both retrieval branches are filtered to.
|
|
113
131
|
const scope = this.aiSourceQuery.build({
|
|
114
132
|
dataLimits: params.dataLimits,
|
|
115
133
|
currentUserId: this.clsService.get("userId"),
|
|
116
134
|
securityService: this.securityService,
|
|
117
135
|
returnsData: true,
|
|
118
136
|
});
|
|
119
|
-
// Both the vector and the lexical branch below are filtered to this id-set,
|
|
120
|
-
// so confining it to the run's scope root confines the whole hybrid search.
|
|
121
137
|
const scopeFilter = this.agentScope.build({ alias: "data", dataLimits: params.dataLimits });
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
138
|
+
// How large is the scoped set? One cheap count decides which shape to use.
|
|
139
|
+
// Scope-first exact cosine has no recall cliff but reads every in-scope
|
|
140
|
+
// embedding; the index is cheaper at volume but can only post-filter a
|
|
141
|
+
// GLOBAL top-K, which is the cliff this task exists to remove.
|
|
142
|
+
const countQuery = this.neo4j.initQuery();
|
|
143
|
+
countQuery.queryParams = { ...countQuery.queryParams, ...scope.params, ...scopeFilter.params };
|
|
144
|
+
countQuery.query += `
|
|
145
|
+
${scope.cypher}
|
|
146
|
+
${scopeFilter.cypher}
|
|
147
|
+
MATCH (chunk:Chunk)<-[:HAS_CHUNK]-(data)
|
|
148
|
+
RETURN count(DISTINCT chunk) AS scopedCount
|
|
149
|
+
`;
|
|
150
|
+
const countResult = await this.neo4j.read(countQuery.query, countQuery.queryParams);
|
|
151
|
+
const scopedCount = Number(countResult.records[0]?.get("scopedCount") ?? 0);
|
|
152
|
+
if (scopedCount === 0)
|
|
133
153
|
return [];
|
|
134
|
-
const
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
RETURN candidateChunk.id AS id
|
|
139
|
-
ORDER BY score DESC
|
|
140
|
-
LIMIT 50
|
|
141
|
-
`, { queryEmbedding, chunkIds });
|
|
142
|
-
const vectorIds = vectorResult.records.map((record) => record.get("id"));
|
|
143
|
-
let lexicalIds = [];
|
|
144
|
-
if (term.trim()) {
|
|
145
|
-
const lexicalResult = await this.neo4j.read(`
|
|
146
|
-
CALL db.index.fulltext.queryNodes('chunk_content_search', $term)
|
|
147
|
-
YIELD node, score
|
|
148
|
-
WHERE node.id IN $chunkIds
|
|
149
|
-
RETURN node.id AS id
|
|
150
|
-
ORDER BY score DESC
|
|
151
|
-
LIMIT 50
|
|
152
|
-
`, { term, chunkIds });
|
|
153
|
-
lexicalIds = lexicalResult.records.map((record) => record.get("id"));
|
|
154
|
-
}
|
|
154
|
+
const vectorIds = scopedCount <= retrieval_constants_1.EXACT_SCAN_MAX_SCOPED_CHUNKS
|
|
155
|
+
? await this.vectorIdsByExactScan({ scope, scopeFilter, queryEmbedding })
|
|
156
|
+
: await this.vectorIdsByIndex({ scope, scopeFilter, queryEmbedding });
|
|
157
|
+
const lexicalIds = term.trim() ? await this.lexicalIdsInScope({ scope, scopeFilter, term }) : [];
|
|
155
158
|
const fusedIds = (0, reciprocal_rank_fusion_1.reciprocalRankFusion)([vectorIds, lexicalIds]).slice(0, 20);
|
|
156
|
-
return this.findChunksByIdsOrdered(fusedIds);
|
|
159
|
+
return this.findChunksByIdsOrdered({ ids: fusedIds, queryEmbedding });
|
|
157
160
|
}
|
|
158
|
-
|
|
159
|
-
|
|
161
|
+
/**
|
|
162
|
+
* Exact cosine over the scoped set. No recall cliff by construction: every
|
|
163
|
+
* in-scope chunk is scored, so a small tenant can never be crowded out of a
|
|
164
|
+
* global top-K by a large one.
|
|
165
|
+
*/
|
|
166
|
+
async vectorIdsByExactScan(params) {
|
|
167
|
+
const query = this.neo4j.initQuery();
|
|
168
|
+
query.queryParams = {
|
|
169
|
+
...query.queryParams,
|
|
170
|
+
...params.scope.params,
|
|
171
|
+
...params.scopeFilter.params,
|
|
172
|
+
queryEmbedding: params.queryEmbedding,
|
|
173
|
+
};
|
|
174
|
+
query.query += `
|
|
175
|
+
${params.scope.cypher}
|
|
176
|
+
${params.scopeFilter.cypher}
|
|
177
|
+
MATCH (chunk:Chunk)<-[:HAS_CHUNK]-(data)
|
|
178
|
+
WHERE chunk.embedding IS NOT NULL
|
|
179
|
+
WITH DISTINCT chunk
|
|
180
|
+
WITH chunk, vector.similarity.cosine(chunk.embedding, $queryEmbedding) AS score
|
|
181
|
+
WHERE score IS NOT NULL
|
|
182
|
+
RETURN chunk.id AS id
|
|
183
|
+
ORDER BY score DESC
|
|
184
|
+
LIMIT 50
|
|
185
|
+
`;
|
|
186
|
+
const result = await this.neo4j.read(query.query, query.queryParams);
|
|
187
|
+
return result.records.map((record) => record.get("id"));
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* Index-backed fallback for scoped sets too large to scan exactly. Still
|
|
191
|
+
* post-filters, so it still has a cliff — the over-fetch is what pushes that
|
|
192
|
+
* cliff out of reach, and it is deliberately far above the previous 1,000.
|
|
193
|
+
*/
|
|
194
|
+
async vectorIdsByIndex(params) {
|
|
195
|
+
const query = this.neo4j.initQuery();
|
|
196
|
+
query.queryParams = {
|
|
197
|
+
...query.queryParams,
|
|
198
|
+
...params.scope.params,
|
|
199
|
+
...params.scopeFilter.params,
|
|
200
|
+
queryEmbedding: params.queryEmbedding,
|
|
201
|
+
overFetch: retrieval_constants_1.CHUNK_VECTOR_OVERFETCH,
|
|
202
|
+
};
|
|
203
|
+
query.query += `
|
|
204
|
+
${params.scope.cypher}
|
|
205
|
+
${params.scopeFilter.cypher}
|
|
206
|
+
MATCH (chunk:Chunk)<-[:HAS_CHUNK]-(data)
|
|
207
|
+
WITH collect(DISTINCT chunk.id) AS scopedChunkIds
|
|
208
|
+
CALL db.index.vector.queryNodes('chunks', toInteger($overFetch), $queryEmbedding)
|
|
209
|
+
YIELD node AS candidateChunk, score
|
|
210
|
+
WITH scopedChunkIds, candidateChunk, score
|
|
211
|
+
WHERE candidateChunk.id IN scopedChunkIds
|
|
212
|
+
RETURN candidateChunk.id AS id
|
|
213
|
+
ORDER BY score DESC
|
|
214
|
+
LIMIT 50
|
|
215
|
+
`;
|
|
216
|
+
const result = await this.neo4j.read(query.query, query.queryParams);
|
|
217
|
+
return result.records.map((record) => record.get("id"));
|
|
218
|
+
}
|
|
219
|
+
/**
|
|
220
|
+
* Lexical branch, scoped the same way. Previously filtered against the
|
|
221
|
+
* client-side id list; now joined in the database like the vector branch.
|
|
222
|
+
*/
|
|
223
|
+
async lexicalIdsInScope(params) {
|
|
224
|
+
const query = this.neo4j.initQuery();
|
|
225
|
+
query.queryParams = {
|
|
226
|
+
...query.queryParams,
|
|
227
|
+
...params.scope.params,
|
|
228
|
+
...params.scopeFilter.params,
|
|
229
|
+
term: params.term,
|
|
230
|
+
};
|
|
231
|
+
query.query += `
|
|
232
|
+
${params.scope.cypher}
|
|
233
|
+
${params.scopeFilter.cypher}
|
|
234
|
+
MATCH (chunk:Chunk)<-[:HAS_CHUNK]-(data)
|
|
235
|
+
WITH collect(DISTINCT chunk.id) AS scopedChunkIds
|
|
236
|
+
CALL db.index.fulltext.queryNodes('chunk_content_search', $term)
|
|
237
|
+
YIELD node, score
|
|
238
|
+
WITH scopedChunkIds, node, score
|
|
239
|
+
WHERE node.id IN scopedChunkIds
|
|
240
|
+
RETURN node.id AS id
|
|
241
|
+
ORDER BY score DESC
|
|
242
|
+
LIMIT 50
|
|
243
|
+
`;
|
|
244
|
+
const result = await this.neo4j.read(query.query, query.queryParams);
|
|
245
|
+
return result.records.map((record) => record.get("id"));
|
|
246
|
+
}
|
|
247
|
+
/**
|
|
248
|
+
* INPUT ORDER IS PART OF THE CONTRACT here too: `WHERE chunk.id IN $ids` yields rows
|
|
249
|
+
* in store order, and the fused RRF order is what the caller means by "best first".
|
|
250
|
+
*
|
|
251
|
+
* `queryEmbedding` attaches the cosine score of each chunk against the question, on
|
|
252
|
+
* the same scale `findChunksByIds` puts on the graph half. No floor and no count cap
|
|
253
|
+
* are applied — the notebook's character budget decides what reaches the answer.
|
|
254
|
+
*/
|
|
255
|
+
async findChunksByIdsOrdered(params) {
|
|
256
|
+
if (params.ids.length === 0)
|
|
160
257
|
return [];
|
|
161
258
|
const query = this.neo4j.initQuery({ serialiser: chunk_entity_1.ChunkDescriptor.model });
|
|
162
259
|
query.queryParams = {
|
|
163
260
|
...query.queryParams,
|
|
164
|
-
ids,
|
|
261
|
+
ids: params.ids,
|
|
165
262
|
};
|
|
166
263
|
query.query += `
|
|
167
264
|
MATCH (chunk:Chunk)
|
|
@@ -169,8 +266,50 @@ let ChunkRepository = ChunkRepository_1 = class ChunkRepository {
|
|
|
169
266
|
RETURN chunk
|
|
170
267
|
`;
|
|
171
268
|
const chunks = await this.neo4j.readMany(query);
|
|
172
|
-
const
|
|
173
|
-
|
|
269
|
+
const scored = await this.attachCosineScores({ chunks, queryEmbedding: params.queryEmbedding });
|
|
270
|
+
const byId = new Map(scored.map((chunk) => [chunk.id, chunk]));
|
|
271
|
+
return params.ids
|
|
272
|
+
.map((id) => byId.get(id))
|
|
273
|
+
.filter((chunk) => chunk !== undefined);
|
|
274
|
+
}
|
|
275
|
+
/**
|
|
276
|
+
* Attaches `vector.similarity.cosine(chunk.embedding, $queryEmbedding)` to already
|
|
277
|
+
* hydrated chunks, by id, in JS.
|
|
278
|
+
*
|
|
279
|
+
* Why a separate read rather than one extra column on the hydration query: the
|
|
280
|
+
* hydration goes through `readMany`, which maps every row with the descriptor's
|
|
281
|
+
* generated mapper, and that mapper only ever reads the descriptor's own fields,
|
|
282
|
+
* computed fields and virtual fields (`define-entity.ts`). A projected column such
|
|
283
|
+
* as `score` is therefore silently DROPPED before the caller ever sees it. Reading
|
|
284
|
+
* the id/score pairs on their own and merging them here keeps entity mapping on
|
|
285
|
+
* `readMany` — this repository never hand-maps raw Neo4j records.
|
|
286
|
+
*
|
|
287
|
+
* SCOPE: this read scores only ids that the caller's own scope-gated query already
|
|
288
|
+
* returned, so it cannot widen the scope by construction.
|
|
289
|
+
*/
|
|
290
|
+
async attachCosineScores(params) {
|
|
291
|
+
if (!params.queryEmbedding || params.chunks.length === 0)
|
|
292
|
+
return params.chunks;
|
|
293
|
+
const query = this.neo4j.initQuery();
|
|
294
|
+
query.queryParams = {
|
|
295
|
+
...query.queryParams,
|
|
296
|
+
ids: params.chunks.map((chunk) => chunk.id),
|
|
297
|
+
queryEmbedding: params.queryEmbedding,
|
|
298
|
+
};
|
|
299
|
+
query.query += `
|
|
300
|
+
MATCH (chunk:Chunk)
|
|
301
|
+
WHERE chunk.id IN $ids AND chunk.embedding IS NOT NULL
|
|
302
|
+
RETURN chunk.id AS id, vector.similarity.cosine(chunk.embedding, $queryEmbedding) AS score
|
|
303
|
+
`;
|
|
304
|
+
const result = await this.neo4j.read(query.query, query.queryParams);
|
|
305
|
+
const scoreById = new Map();
|
|
306
|
+
for (const record of result.records) {
|
|
307
|
+
const id = record.get("id");
|
|
308
|
+
const score = record.get("score");
|
|
309
|
+
if (typeof id === "string" && typeof score === "number")
|
|
310
|
+
scoreById.set(id, score);
|
|
311
|
+
}
|
|
312
|
+
return params.chunks.map((chunk) => ({ ...chunk, score: scoreById.get(chunk.id) }));
|
|
174
313
|
}
|
|
175
314
|
async findParentName(params) {
|
|
176
315
|
const query = this.neo4j.initQuery();
|
|
@@ -229,6 +368,51 @@ let ChunkRepository = ChunkRepository_1 = class ChunkRepository {
|
|
|
229
368
|
`;
|
|
230
369
|
return this.neo4j.readOne(query);
|
|
231
370
|
}
|
|
371
|
+
/**
|
|
372
|
+
* Hydrates many chunks in ONE query, with the same scope gate `findChunkById`
|
|
373
|
+
* applies to one. The caller previously looped with an `await` inside,
|
|
374
|
+
* costing one round trip per queued chunk. Returns only the chunks that
|
|
375
|
+
* exist and are in scope; the caller must not assume a 1:1 mapping with
|
|
376
|
+
* `chunkIds`.
|
|
377
|
+
*
|
|
378
|
+
* ORDER IS PART OF THE CONTRACT. `WHERE chunk.id IN $chunkIds` returns rows in
|
|
379
|
+
* whatever order the store yields them, but the loop this replaced hydrated in
|
|
380
|
+
* queue order, and that order reaches the contextualiser's per-chunk fan-out and
|
|
381
|
+
* the notebook entries it writes. Returning them shuffled changes what the answer
|
|
382
|
+
* node cites. The input order is therefore restored here, exactly as
|
|
383
|
+
* `findChunksByIdsOrdered` does for the retrieval path.
|
|
384
|
+
*
|
|
385
|
+
* `queryEmbedding` is OPTIONAL and, when given, attaches `score`: the cosine
|
|
386
|
+
* similarity of the chunk against the question. These chunks arrive from a fact
|
|
387
|
+
* join with no score of their own, which is precisely why an LLM used to have to
|
|
388
|
+
* judge them; cosine puts this half on the SAME scale as the document half, so the
|
|
389
|
+
* answer node can order both together. When it is absent the scoring clause is not
|
|
390
|
+
* in the Cypher at all. No floor is applied at any point: the notebook's character
|
|
391
|
+
* budget, not a threshold, decides what reaches the answer.
|
|
392
|
+
*/
|
|
393
|
+
async findChunksByIds(params) {
|
|
394
|
+
if (params.chunkIds.length === 0)
|
|
395
|
+
return [];
|
|
396
|
+
const query = this.neo4j.initQuery({ serialiser: chunk_entity_1.ChunkDescriptor.model });
|
|
397
|
+
const scopePredicate = this.agentScope.predicate({ alias: "data", dataLimits: params.dataLimits });
|
|
398
|
+
query.queryParams = {
|
|
399
|
+
...query.queryParams,
|
|
400
|
+
chunkIds: params.chunkIds,
|
|
401
|
+
...(scopePredicate?.params ?? {}),
|
|
402
|
+
};
|
|
403
|
+
query.query += `
|
|
404
|
+
MATCH (chunk:Chunk)
|
|
405
|
+
WHERE chunk.id IN $chunkIds
|
|
406
|
+
${scopePredicate ? `AND EXISTS { MATCH (chunk)<-[:HAS_CHUNK]-(data) WHERE ${scopePredicate.cypher} }` : ""}
|
|
407
|
+
RETURN chunk
|
|
408
|
+
`;
|
|
409
|
+
const chunks = await this.neo4j.readMany(query);
|
|
410
|
+
const scored = await this.attachCosineScores({ chunks, queryEmbedding: params.queryEmbedding });
|
|
411
|
+
const byId = new Map(scored.map((chunk) => [chunk.id, chunk]));
|
|
412
|
+
return params.chunkIds
|
|
413
|
+
.map((id) => byId.get(id))
|
|
414
|
+
.filter((chunk) => chunk !== undefined);
|
|
415
|
+
}
|
|
232
416
|
/**
|
|
233
417
|
* Pipeline hydration of a content node's chunks — deliberately WITHOUT `embedding`.
|
|
234
418
|
*
|
|
@@ -564,16 +748,21 @@ let ChunkRepository = ChunkRepository_1 = class ChunkRepository {
|
|
|
564
748
|
if (params.chunkIds.length === 0)
|
|
565
749
|
return [];
|
|
566
750
|
const query = this.neo4j.initQuery();
|
|
567
|
-
query.queryParams = { ...query.queryParams, chunkIds: params.chunkIds
|
|
751
|
+
query.queryParams = { ...query.queryParams, chunkIds: params.chunkIds };
|
|
752
|
+
// Neo4j will not take a parameter as a variable-length bound, so the window
|
|
753
|
+
// is clamped to a small integer and interpolated. It is never user input —
|
|
754
|
+
// the only caller passes the NEIGHBOR_WINDOW constant — and Number() plus
|
|
755
|
+
// the clamp make injection impossible.
|
|
756
|
+
const window = Math.max(1, Math.min(5, Math.trunc(Number(params.window) || 1)));
|
|
568
757
|
query.query = `
|
|
569
758
|
UNWIND $chunkIds AS cid
|
|
570
759
|
MATCH (c:Chunk {id: cid})
|
|
571
|
-
OPTIONAL MATCH pBefore = (b:Chunk)-[:NEXT*1
|
|
760
|
+
OPTIONAL MATCH pBefore = (b:Chunk)-[:NEXT*1..${window}]->(c)
|
|
572
761
|
WITH cid, c, b, length(pBefore) AS beforeDist ORDER BY beforeDist ASC
|
|
573
|
-
WITH cid, c, [x IN collect(b) WHERE x IS NOT NULL][0..$window] AS befores
|
|
574
|
-
OPTIONAL MATCH pAfter = (c)-[:NEXT*1
|
|
762
|
+
WITH cid, c, [x IN collect(b) WHERE x IS NOT NULL][0..${window}] AS befores
|
|
763
|
+
OPTIONAL MATCH pAfter = (c)-[:NEXT*1..${window}]->(a:Chunk)
|
|
575
764
|
WITH cid, befores, a, length(pAfter) AS afterDist ORDER BY afterDist ASC
|
|
576
|
-
WITH cid, befores, [x IN collect(a) WHERE x IS NOT NULL][0..$window] AS afters
|
|
765
|
+
WITH cid, befores, [x IN collect(a) WHERE x IS NOT NULL][0..${window}] AS afters
|
|
577
766
|
RETURN cid AS chunkId, [x IN befores | x.content] AS before, [x IN afters | x.content] AS after
|
|
578
767
|
`;
|
|
579
768
|
const result = await this.neo4j.read(query.query, query.queryParams);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chunk.repository.js","sourceRoot":"","sources":["../../../../src/foundations/chunk/repositories/chunk.repository.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAkE;AAClE,2CAAwC;AACxC,gFAAoF;AACpF,+DAA2D;AAC3D,uFAAmF;AACnF,wFAA0F;AAC1F,oGAA+G;AAE/G,wCAAqE;AACrE,4EAAwE;AACxE,8EAA0E;AAC1E,uFAAmF;AACnF,oEAA2E;AAC3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CAAC;QAEF,KAAK,CAAC,KAAK,GAAG;oBACE,MAAM,CAAC,IAAI;;KAE1B,CAAC;QAEF,OAAO,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IACpC,CAAC;;AAr5BU,0CAAe;AAC1B;;;;;;GAMG;AACqB,2BAAW,GAAG,EAAE,AAAL,CAAM;0BAR9B,eAAe;IAD3B,IAAA,mBAAU,GAAE;IAiBR,WAAA,IAAA,eAAM,EAAC,0CAAe,CAAC,CAAA;qCALA,4BAAY;QACL,4BAAY;QACT,sBAAe;QACpB,uBAAU;QACL,kCAAe,UAEpB,4CAAuB;GAjB3C,eAAe,CAs5B3B"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Above this many in-scope chunks, exact cosine over the scoped set stops being
|
|
3
|
+
* the cheaper option and the vector index is used with an over-fetch instead.
|
|
4
|
+
* Starting value; Phase 1's harness is what validates it.
|
|
5
|
+
*/
|
|
6
|
+
export declare const EXACT_SCAN_MAX_SCOPED_CHUNKS = 5000;
|
|
7
|
+
/** Candidates pulled from the vector index before scope filtering, in the fallback path. */
|
|
8
|
+
export declare const CHUNK_VECTOR_OVERFETCH = 2000;
|
|
9
|
+
/** Same, for the key-concept index. */
|
|
10
|
+
export declare const KEYCONCEPT_VECTOR_OVERFETCH = 2000;
|
|
11
|
+
/**
|
|
12
|
+
* Atomic facts one contextualiser run may pull from the key-concept join.
|
|
13
|
+
* Spec §5.4. Replaces NO limit at all: ten key concepts returned 161 facts on
|
|
14
|
+
* one measured turn, which batched into four scoring calls and queued 45 chunks.
|
|
15
|
+
*
|
|
16
|
+
* The facts are NOT ordered before the cut. Atomic facts carry no embedding
|
|
17
|
+
* (spec §2.4), so there is no relevance signal to order by — this is a spend
|
|
18
|
+
* bound, not a ranking.
|
|
19
|
+
*/
|
|
20
|
+
export declare const MAX_ATOMIC_FACTS = 150;
|
|
21
|
+
/**
|
|
22
|
+
* Hard backstop on provider calls in one contextualiser run. Replaces
|
|
23
|
+
* `maxHops = 20`, which counted NODES — and three of them advanced the counter
|
|
24
|
+
* by two, so twenty was really about ten nodes and the `hops >= 15` brakes fired
|
|
25
|
+
* after seven. It was never a spend bound.
|
|
26
|
+
*
|
|
27
|
+
* Spec §5.4's value, restored now that Block 3c has landed. The post-3c worst
|
|
28
|
+
* case is SIX provider calls per run — question refiner, rational plan, concept
|
|
29
|
+
* reranking, and at most three atomic-fact batches — because both per-chunk
|
|
30
|
+
* fan-outs are gone. Twelve is therefore double the worst case: a backstop
|
|
31
|
+
* against a routing bug, not a bound anyone should reach.
|
|
32
|
+
*
|
|
33
|
+
* It was deliberately 100 through Blocks 3a and 3b, when `chunk_vector` still
|
|
34
|
+
* reported one call per chunk read (median 25, measured maximum 34) and a budget
|
|
35
|
+
* of 12 would have been spent by that node's own return, routing every question
|
|
36
|
+
* straight to the answer and skipping the whole graph walk.
|
|
37
|
+
*/
|
|
38
|
+
export declare const MAX_LLM_CALLS_PER_RUN = 12;
|
|
39
|
+
/**
|
|
40
|
+
* Key concepts the reranker may hand to the graph walk. Spec §5.4 — the value
|
|
41
|
+
* is UNCHANGED behaviour, replacing a bare literal `10` at the end of the
|
|
42
|
+
* selection in `keyconcepts.node.service.ts` so the number is named and tunable
|
|
43
|
+
* with the rest.
|
|
44
|
+
*/
|
|
45
|
+
export declare const MAX_KEY_CONCEPTS = 10;
|
|
46
|
+
/**
|
|
47
|
+
* Characters of notebook the answer node may receive. NEVER applies to seed
|
|
48
|
+
* contexts (C3) — the budget lives inside `buildNotebookSection`, which cannot
|
|
49
|
+
* reach `buildSeedSection`.
|
|
50
|
+
*
|
|
51
|
+
* This is the ONLY thing bounding what the contextualiser sends downstream once
|
|
52
|
+
* Block 3c deletes the per-chunk LLM calls. Owner decision, 2026-08-22: no
|
|
53
|
+
* relevance threshold and no chunk-count cap — entries are sorted best-score
|
|
54
|
+
* first and the weakest are dropped when the budget fills. Measured reason: on
|
|
55
|
+
* this corpus the spec's relative bar admits every candidate (scores bunch into
|
|
56
|
+
* 0.69–0.86) and a count cap of 8 loses required evidence on 4 of 20 questions.
|
|
57
|
+
* A character budget adapts to how large the chunks actually are, which a count
|
|
58
|
+
* cap cannot. See docs/eval/retrieval/calibration-3a.md.
|
|
59
|
+
*
|
|
60
|
+
* 40,000 → 80,000, owner decision 2026-08-22 (shed-widening gate fallback,
|
|
61
|
+
* docs/superpowers/specs/2026-08-22-notebook-budget-shed-widening-design.md §4):
|
|
62
|
+
* at 40k the trim discarded required evidence even after shedding — med-04 kept
|
|
63
|
+
* 4 of 24 entries and the model never read the 55% invalidity figure it was
|
|
64
|
+
* asked about. ~80k chars ≈ ~20k tokens of notebook; measured median input
|
|
65
|
+
* moves from ~20.7k toward the high-20ks, still far below the 104k pre-3c
|
|
66
|
+
* baseline.
|
|
67
|
+
*/
|
|
68
|
+
export declare const NOTEBOOK_BUDGET_CHARS = 80000;
|
|
69
|
+
//# sourceMappingURL=retrieval.constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"retrieval.constants.d.ts","sourceRoot":"","sources":["../../../../src/foundations/chunk/repositories/retrieval.constants.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,eAAO,MAAM,4BAA4B,OAAO,CAAC;AAEjD,4FAA4F;AAC5F,eAAO,MAAM,sBAAsB,OAAO,CAAC;AAE3C,uCAAuC;AACvC,eAAO,MAAM,2BAA2B,OAAO,CAAC;AAEhD;;;;;;;;GAQG;AACH,eAAO,MAAM,gBAAgB,MAAM,CAAC;AAEpC;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,qBAAqB,KAAK,CAAC;AAExC;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,KAAK,CAAC;AAEnC;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,qBAAqB,QAAS,CAAC"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NOTEBOOK_BUDGET_CHARS = exports.MAX_KEY_CONCEPTS = exports.MAX_LLM_CALLS_PER_RUN = exports.MAX_ATOMIC_FACTS = exports.KEYCONCEPT_VECTOR_OVERFETCH = exports.CHUNK_VECTOR_OVERFETCH = exports.EXACT_SCAN_MAX_SCOPED_CHUNKS = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Above this many in-scope chunks, exact cosine over the scoped set stops being
|
|
6
|
+
* the cheaper option and the vector index is used with an over-fetch instead.
|
|
7
|
+
* Starting value; Phase 1's harness is what validates it.
|
|
8
|
+
*/
|
|
9
|
+
exports.EXACT_SCAN_MAX_SCOPED_CHUNKS = 5000;
|
|
10
|
+
/** Candidates pulled from the vector index before scope filtering, in the fallback path. */
|
|
11
|
+
exports.CHUNK_VECTOR_OVERFETCH = 2000;
|
|
12
|
+
/** Same, for the key-concept index. */
|
|
13
|
+
exports.KEYCONCEPT_VECTOR_OVERFETCH = 2000;
|
|
14
|
+
/**
|
|
15
|
+
* Atomic facts one contextualiser run may pull from the key-concept join.
|
|
16
|
+
* Spec §5.4. Replaces NO limit at all: ten key concepts returned 161 facts on
|
|
17
|
+
* one measured turn, which batched into four scoring calls and queued 45 chunks.
|
|
18
|
+
*
|
|
19
|
+
* The facts are NOT ordered before the cut. Atomic facts carry no embedding
|
|
20
|
+
* (spec §2.4), so there is no relevance signal to order by — this is a spend
|
|
21
|
+
* bound, not a ranking.
|
|
22
|
+
*/
|
|
23
|
+
exports.MAX_ATOMIC_FACTS = 150;
|
|
24
|
+
/**
|
|
25
|
+
* Hard backstop on provider calls in one contextualiser run. Replaces
|
|
26
|
+
* `maxHops = 20`, which counted NODES — and three of them advanced the counter
|
|
27
|
+
* by two, so twenty was really about ten nodes and the `hops >= 15` brakes fired
|
|
28
|
+
* after seven. It was never a spend bound.
|
|
29
|
+
*
|
|
30
|
+
* Spec §5.4's value, restored now that Block 3c has landed. The post-3c worst
|
|
31
|
+
* case is SIX provider calls per run — question refiner, rational plan, concept
|
|
32
|
+
* reranking, and at most three atomic-fact batches — because both per-chunk
|
|
33
|
+
* fan-outs are gone. Twelve is therefore double the worst case: a backstop
|
|
34
|
+
* against a routing bug, not a bound anyone should reach.
|
|
35
|
+
*
|
|
36
|
+
* It was deliberately 100 through Blocks 3a and 3b, when `chunk_vector` still
|
|
37
|
+
* reported one call per chunk read (median 25, measured maximum 34) and a budget
|
|
38
|
+
* of 12 would have been spent by that node's own return, routing every question
|
|
39
|
+
* straight to the answer and skipping the whole graph walk.
|
|
40
|
+
*/
|
|
41
|
+
exports.MAX_LLM_CALLS_PER_RUN = 12;
|
|
42
|
+
/**
|
|
43
|
+
* Key concepts the reranker may hand to the graph walk. Spec §5.4 — the value
|
|
44
|
+
* is UNCHANGED behaviour, replacing a bare literal `10` at the end of the
|
|
45
|
+
* selection in `keyconcepts.node.service.ts` so the number is named and tunable
|
|
46
|
+
* with the rest.
|
|
47
|
+
*/
|
|
48
|
+
exports.MAX_KEY_CONCEPTS = 10;
|
|
49
|
+
/**
|
|
50
|
+
* Characters of notebook the answer node may receive. NEVER applies to seed
|
|
51
|
+
* contexts (C3) — the budget lives inside `buildNotebookSection`, which cannot
|
|
52
|
+
* reach `buildSeedSection`.
|
|
53
|
+
*
|
|
54
|
+
* This is the ONLY thing bounding what the contextualiser sends downstream once
|
|
55
|
+
* Block 3c deletes the per-chunk LLM calls. Owner decision, 2026-08-22: no
|
|
56
|
+
* relevance threshold and no chunk-count cap — entries are sorted best-score
|
|
57
|
+
* first and the weakest are dropped when the budget fills. Measured reason: on
|
|
58
|
+
* this corpus the spec's relative bar admits every candidate (scores bunch into
|
|
59
|
+
* 0.69–0.86) and a count cap of 8 loses required evidence on 4 of 20 questions.
|
|
60
|
+
* A character budget adapts to how large the chunks actually are, which a count
|
|
61
|
+
* cap cannot. See docs/eval/retrieval/calibration-3a.md.
|
|
62
|
+
*
|
|
63
|
+
* 40,000 → 80,000, owner decision 2026-08-22 (shed-widening gate fallback,
|
|
64
|
+
* docs/superpowers/specs/2026-08-22-notebook-budget-shed-widening-design.md §4):
|
|
65
|
+
* at 40k the trim discarded required evidence even after shedding — med-04 kept
|
|
66
|
+
* 4 of 24 entries and the model never read the 55% invalidity figure it was
|
|
67
|
+
* asked about. ~80k chars ≈ ~20k tokens of notebook; measured median input
|
|
68
|
+
* moves from ~20.7k toward the high-20ks, still far below the 104k pre-3c
|
|
69
|
+
* baseline.
|
|
70
|
+
*/
|
|
71
|
+
exports.NOTEBOOK_BUDGET_CHARS = 80_000;
|
|
72
|
+
//# sourceMappingURL=retrieval.constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"retrieval.constants.js","sourceRoot":"","sources":["../../../../src/foundations/chunk/repositories/retrieval.constants.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACU,QAAA,4BAA4B,GAAG,IAAI,CAAC;AAEjD,4FAA4F;AAC/E,QAAA,sBAAsB,GAAG,IAAI,CAAC;AAE3C,uCAAuC;AAC1B,QAAA,2BAA2B,GAAG,IAAI,CAAC;AAEhD;;;;;;;;GAQG;AACU,QAAA,gBAAgB,GAAG,GAAG,CAAC;AAEpC;;;;;;;;;;;;;;;;GAgBG;AACU,QAAA,qBAAqB,GAAG,EAAE,CAAC;AAExC;;;;;GAKG;AACU,QAAA,gBAAgB,GAAG,EAAE,CAAC;AAEnC;;;;;;;;;;;;;;;;;;;;;GAqBG;AACU,QAAA,qBAAqB,GAAG,MAAM,CAAC"}
|
|
@@ -36,6 +36,8 @@ export declare class KeyConceptRepository implements OnModuleInit {
|
|
|
36
36
|
question: string;
|
|
37
37
|
dataLimits: DataLimits;
|
|
38
38
|
attribution?: EmbedderAttribution;
|
|
39
|
+
/** See `findPotentialChunks`. */
|
|
40
|
+
queryEmbedding?: number[];
|
|
39
41
|
}): Promise<KeyConcept[]>;
|
|
40
42
|
deleteDisconnectedKeyConcepts(): Promise<void>;
|
|
41
43
|
findKeyConceptByValue(params: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keyconcept.repository.d.ts","sourceRoot":"","sources":["../../../../src/foundations/keyconcept/repositories/keyconcept.repository.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAElE,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,EAAE,uBAAuB,EAAE,MAAM,iDAAiD,CAAC;AAC1F,OAAO,EAAmB,qBAAqB,EAAE,MAAM,uDAAuD,CAAC;AAC/G,OAAO,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAC;AAC/D,OAAO,EAAE,mBAAmB,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AACnF,OAAO,EAAE,YAAY,EAAE,MAAM,4CAA4C,CAAC;AAC1E,OAAO,EAAE,eAAe,EAAE,MAAM,kDAAkD,CAAC;
|
|
1
|
+
{"version":3,"file":"keyconcept.repository.d.ts","sourceRoot":"","sources":["../../../../src/foundations/keyconcept/repositories/keyconcept.repository.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAElE,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,EAAE,uBAAuB,EAAE,MAAM,iDAAiD,CAAC;AAC1F,OAAO,EAAmB,qBAAqB,EAAE,MAAM,uDAAuD,CAAC;AAC/G,OAAO,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAC;AAC/D,OAAO,EAAE,mBAAmB,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AACnF,OAAO,EAAE,YAAY,EAAE,MAAM,4CAA4C,CAAC;AAC1E,OAAO,EAAE,eAAe,EAAE,MAAM,kDAAkD,CAAC;AAEnF,OAAO,EAAE,UAAU,EAAE,MAAM,8CAA8C,CAAC;AAI1E,qBACa,oBAAqB,YAAW,YAAY;IAErD,OAAO,CAAC,QAAQ,CAAC,K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AgB,EAAE,MAAM,EAAE,CAAA;KAAE,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC;IAgB5F;;;;;;;;OAQG;IACG,uBAAuB,CAAC,MAAM,EAAE;QACpC,gBAAgB,EAAE,MAAM,EAAE,CAAC;QAC3B,WAAW,CAAC,EAAE,mBAAmB,CAAC;KACnC,GAAG,OAAO,CAAC,IAAI,CAAC;IAsBjB;;;OAGG;IACG,4BAA4B,CAAC,MAAM,EAAE;QACzC,YAAY,EAAE;YAAE,UAAU,EAAE,MAAM,CAAC;YAAC,WAAW,EAAE,MAAM,CAAA;SAAE,EAAE,CAAC;KAC7D,GAAG,OAAO,CAAC,IAAI,CAAC;IAejB;;;;;;OAMG;IACG,gBAAgB,CAAC,MAAM,EAAE;QAC7B,eAAe,EAAE,MAAM,CAAC;QACxB,YAAY,EAAE,MAAM,CAAC;QACrB,WAAW,CAAC,EAAE,mBAAmB,CAAC;KACnC,GAAG,OAAO,CAAC,IAAI,CAAC;IAyCX,wBAAwB,CAAC,MAAM,EAAE;QAAE,eAAe,EAAE,MAAM,CAAC;QAAC,YAAY,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAgBlG,qCAAqC,CAAC,MAAM,EAAE;QAClD,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,OAAO,EAAE,MAAM,CAAC;QAChB,aAAa,EAAE;YACb,WAAW,EAAE,MAAM,CAAC;YACpB,WAAW,EAAE,MAAM,CAAC;YACpB,YAAY,EAAE,MAAM,CAAC;SACtB,EAAE,CAAC;KACL,GAAG,OAAO,CAAC,IAAI,CAAC;IAiGX,kDAAkD,CAAC,MAAM,EAAE;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC;CAqBrG"}
|
|
@@ -21,6 +21,7 @@ const ai_source_query_provider_1 = require("../../../common/repositories/ai-sour
|
|
|
21
21
|
const core_1 = require("../../../core");
|
|
22
22
|
const neo4j_service_1 = require("../../../core/neo4j/services/neo4j.service");
|
|
23
23
|
const security_service_1 = require("../../../core/security/services/security.service");
|
|
24
|
+
const retrieval_constants_1 = require("../../chunk/repositories/retrieval.constants");
|
|
24
25
|
const key_concept_meta_1 = require("../../keyconcept/entities/key.concept.meta");
|
|
25
26
|
const key_concept_model_1 = require("../../keyconcept/entities/key.concept.model");
|
|
26
27
|
let KeyConceptRepository = class KeyConceptRepository {
|
|
@@ -145,10 +146,12 @@ let KeyConceptRepository = class KeyConceptRepository {
|
|
|
145
146
|
*/
|
|
146
147
|
async findPotentialKeyConcepts(params) {
|
|
147
148
|
const query = this.neo4j.initQuery({ serialiser: key_concept_model_1.KeyConceptModel });
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
149
|
+
// Embedded once per turn — see findPotentialChunks for the rationale.
|
|
150
|
+
const queryEmbedding = params.queryEmbedding ??
|
|
151
|
+
(await this.embedderService.vectoriseText({
|
|
152
|
+
text: params.question,
|
|
153
|
+
attribution: params.attribution,
|
|
154
|
+
}));
|
|
152
155
|
const scope = this.aiSourceQuery.build({
|
|
153
156
|
dataLimits: params.dataLimits,
|
|
154
157
|
currentUserId: this.clsService.get("userId"),
|
|
@@ -162,6 +165,7 @@ let KeyConceptRepository = class KeyConceptRepository {
|
|
|
162
165
|
query.queryParams = {
|
|
163
166
|
...query.queryParams,
|
|
164
167
|
queryEmbedding,
|
|
168
|
+
overFetch: retrieval_constants_1.KEYCONCEPT_VECTOR_OVERFETCH,
|
|
165
169
|
...scope.params,
|
|
166
170
|
...scopeFilter.params,
|
|
167
171
|
};
|
|
@@ -171,7 +175,7 @@ let KeyConceptRepository = class KeyConceptRepository {
|
|
|
171
175
|
MATCH (data)-[:HAS_CHUNK]->()-[:HAS_ATOMIC_FACT]->()-[:HAS_KEY_CONCEPT]->(keyconcept:KeyConcept)
|
|
172
176
|
WITH COLLECT(DISTINCT keyconcept.id) AS topicKeyConceptIds
|
|
173
177
|
|
|
174
|
-
CALL db.index.vector.queryNodes('keyconcepts',
|
|
178
|
+
CALL db.index.vector.queryNodes('keyconcepts', toInteger($overFetch), $queryEmbedding)
|
|
175
179
|
YIELD node AS candidateKeyConcept, score
|
|
176
180
|
WHERE candidateKeyConcept.id IN topicKeyConceptIds
|
|
177
181
|
|