@carlonicora/nestjs-neo4jsonapi 1.64.0 → 1.65.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/agents.modules.js +3 -3
- package/dist/agents/agents.modules.js.map +1 -1
- package/dist/agents/graph/graph.module.d.ts +3 -0
- package/dist/agents/graph/graph.module.d.ts.map +1 -0
- package/dist/agents/{chatbot/chatbot.module.js → graph/graph.module.js} +12 -16
- package/dist/agents/graph/graph.module.js.map +1 -0
- package/dist/agents/{chatbot → graph}/interfaces/graph.catalog.interface.d.ts +4 -0
- package/dist/agents/graph/interfaces/graph.catalog.interface.d.ts.map +1 -0
- package/dist/agents/graph/interfaces/graph.catalog.interface.js.map +1 -0
- package/dist/agents/graph/interfaces/graph.node.output.interface.d.ts +30 -0
- package/dist/agents/graph/interfaces/graph.node.output.interface.d.ts.map +1 -0
- package/dist/agents/graph/interfaces/graph.node.output.interface.js +3 -0
- package/dist/agents/graph/interfaces/graph.node.output.interface.js.map +1 -0
- package/dist/agents/graph/prompts/graph.node.system.prompt.d.ts +3 -0
- package/dist/agents/graph/prompts/graph.node.system.prompt.d.ts.map +1 -0
- package/dist/agents/graph/prompts/graph.node.system.prompt.js +66 -0
- package/dist/agents/graph/prompts/graph.node.system.prompt.js.map +1 -0
- package/dist/agents/graph/repositories/user-modules.repository.d.ts.map +1 -0
- package/dist/agents/graph/repositories/user-modules.repository.js.map +1 -0
- package/dist/agents/{chatbot → graph}/services/descriptor.source.d.ts +2 -0
- package/dist/agents/graph/services/descriptor.source.d.ts.map +1 -0
- package/dist/agents/{chatbot → graph}/services/descriptor.source.js +18 -3
- package/dist/agents/graph/services/descriptor.source.js.map +1 -0
- package/dist/agents/graph/services/field-formatting.d.ts.map +1 -0
- package/dist/agents/graph/services/field-formatting.js.map +1 -0
- package/dist/agents/{chatbot → graph}/services/graph.catalog.service.d.ts +16 -0
- package/dist/agents/graph/services/graph.catalog.service.d.ts.map +1 -0
- package/dist/agents/{chatbot → graph}/services/graph.catalog.service.js +63 -1
- package/dist/agents/graph/services/graph.catalog.service.js.map +1 -0
- package/dist/agents/{chatbot/services/chatbot.index.manager.d.ts → graph/services/graph.index.manager.d.ts} +2 -2
- package/dist/agents/graph/services/graph.index.manager.d.ts.map +1 -0
- package/dist/agents/{chatbot/services/chatbot.index.manager.js → graph/services/graph.index.manager.js} +9 -9
- package/dist/agents/graph/services/graph.index.manager.js.map +1 -0
- package/dist/agents/graph/services/graph.search.service.d.ts +69 -0
- package/dist/agents/graph/services/graph.search.service.d.ts.map +1 -0
- package/dist/agents/graph/services/graph.search.service.js +230 -0
- package/dist/agents/graph/services/graph.search.service.js.map +1 -0
- package/dist/agents/graph/services/humanize-tool.d.ts.map +1 -0
- package/dist/agents/graph/services/humanize-tool.js.map +1 -0
- package/dist/agents/graph/services/materialise-bridge.d.ts +36 -0
- package/dist/agents/graph/services/materialise-bridge.d.ts.map +1 -0
- package/dist/agents/graph/services/materialise-bridge.js +69 -0
- package/dist/agents/graph/services/materialise-bridge.js.map +1 -0
- package/dist/agents/graph/tools/describe-entity.tool.d.ts.map +1 -0
- package/dist/agents/{chatbot → graph}/tools/describe-entity.tool.js +1 -0
- package/dist/agents/graph/tools/describe-entity.tool.js.map +1 -0
- package/dist/agents/{chatbot → graph}/tools/read-entity.tool.d.ts +5 -1
- package/dist/agents/graph/tools/read-entity.tool.d.ts.map +1 -0
- package/dist/agents/{chatbot → graph}/tools/read-entity.tool.js +37 -8
- package/dist/agents/graph/tools/read-entity.tool.js.map +1 -0
- package/dist/agents/{chatbot → graph}/tools/resolve-entity.tool.d.ts +2 -2
- package/dist/agents/graph/tools/resolve-entity.tool.d.ts.map +1 -0
- package/dist/agents/{chatbot → graph}/tools/resolve-entity.tool.js +2 -2
- package/dist/agents/graph/tools/resolve-entity.tool.js.map +1 -0
- package/dist/agents/{chatbot → graph}/tools/search-entities.tool.d.ts +6 -2
- package/dist/agents/graph/tools/search-entities.tool.d.ts.map +1 -0
- package/dist/agents/{chatbot → graph}/tools/search-entities.tool.js +36 -12
- package/dist/agents/graph/tools/search-entities.tool.js.map +1 -0
- package/dist/agents/{chatbot → graph}/tools/tool.factory.d.ts +7 -0
- package/dist/agents/graph/tools/tool.factory.d.ts.map +1 -0
- package/dist/agents/{chatbot → graph}/tools/tool.factory.js +57 -3
- package/dist/agents/graph/tools/tool.factory.js.map +1 -0
- package/dist/agents/{chatbot → graph}/tools/traverse.tool.d.ts +5 -1
- package/dist/agents/graph/tools/traverse.tool.d.ts.map +1 -0
- package/dist/agents/{chatbot → graph}/tools/traverse.tool.js +38 -15
- package/dist/agents/graph/tools/traverse.tool.js.map +1 -0
- package/dist/agents/index.d.ts +6 -9
- package/dist/agents/index.d.ts.map +1 -1
- package/dist/agents/index.js +13 -15
- package/dist/agents/index.js.map +1 -1
- package/dist/agents/responder/contexts/responder.context.d.ts +75 -1
- package/dist/agents/responder/contexts/responder.context.d.ts.map +1 -1
- package/dist/agents/responder/contexts/responder.context.js +29 -4
- package/dist/agents/responder/contexts/responder.context.js.map +1 -1
- package/dist/agents/responder/factories/responder.context.factory.d.ts +4 -5
- package/dist/agents/responder/factories/responder.context.factory.d.ts.map +1 -1
- package/dist/agents/responder/factories/responder.context.factory.js +28 -8
- package/dist/agents/responder/factories/responder.context.factory.js.map +1 -1
- package/dist/agents/responder/interfaces/entity.reference.interface.d.ts +7 -0
- package/dist/agents/responder/interfaces/entity.reference.interface.d.ts.map +1 -0
- package/dist/agents/{chatbot/interfaces/chatbot.response.interface.js → responder/interfaces/entity.reference.interface.js} +1 -1
- package/dist/agents/responder/interfaces/entity.reference.interface.js.map +1 -0
- package/dist/agents/responder/interfaces/responder.response.interface.d.ts +12 -3
- package/dist/agents/responder/interfaces/responder.response.interface.d.ts.map +1 -1
- package/dist/agents/responder/interfaces/unified.trace.interface.d.ts +64 -0
- package/dist/agents/responder/interfaces/unified.trace.interface.d.ts.map +1 -0
- package/dist/agents/responder/interfaces/unified.trace.interface.js +3 -0
- package/dist/agents/responder/interfaces/unified.trace.interface.js.map +1 -0
- package/dist/agents/responder/nodes/graph.node.service.d.ts +31 -0
- package/dist/agents/responder/nodes/graph.node.service.d.ts.map +1 -0
- package/dist/agents/responder/nodes/graph.node.service.js +319 -0
- package/dist/agents/responder/nodes/graph.node.service.js.map +1 -0
- package/dist/agents/responder/nodes/planner.node.service.d.ts +14 -0
- package/dist/agents/responder/nodes/planner.node.service.d.ts.map +1 -0
- package/dist/agents/responder/nodes/planner.node.service.js +121 -0
- package/dist/agents/responder/nodes/planner.node.service.js.map +1 -0
- package/dist/agents/responder/nodes/responder.answer.node.service.d.ts +5 -23
- package/dist/agents/responder/nodes/responder.answer.node.service.d.ts.map +1 -1
- package/dist/agents/responder/nodes/responder.answer.node.service.js +257 -432
- package/dist/agents/responder/nodes/responder.answer.node.service.js.map +1 -1
- package/dist/agents/responder/responder.module.d.ts.map +1 -1
- package/dist/agents/responder/responder.module.js +12 -3
- package/dist/agents/responder/responder.module.js.map +1 -1
- package/dist/agents/responder/services/responder.service.d.ts +15 -22
- package/dist/agents/responder/services/responder.service.d.ts.map +1 -1
- package/dist/agents/responder/services/responder.service.js +116 -89
- package/dist/agents/responder/services/responder.service.js.map +1 -1
- package/dist/common/helpers/define-entity.d.ts.map +1 -1
- package/dist/common/helpers/define-entity.js +16 -1
- package/dist/common/helpers/define-entity.js.map +1 -1
- package/dist/common/interfaces/entity.schema.interface.d.ts +15 -0
- package/dist/common/interfaces/entity.schema.interface.d.ts.map +1 -1
- package/dist/core/llm/interfaces/llm-call-metadata.interface.d.ts +19 -0
- package/dist/core/llm/interfaces/llm-call-metadata.interface.d.ts.map +1 -0
- package/dist/core/llm/interfaces/llm-call-metadata.interface.js +3 -0
- package/dist/core/llm/interfaces/llm-call-metadata.interface.js.map +1 -0
- package/dist/core/llm/llm.module.d.ts +1 -0
- package/dist/core/llm/llm.module.d.ts.map +1 -1
- package/dist/core/llm/llm.module.js +3 -1
- package/dist/core/llm/llm.module.js.map +1 -1
- package/dist/core/llm/services/llm-call-dumper.service.d.ts +64 -0
- package/dist/core/llm/services/llm-call-dumper.service.d.ts.map +1 -0
- package/dist/core/llm/services/llm-call-dumper.service.js +204 -0
- package/dist/core/llm/services/llm-call-dumper.service.js.map +1 -0
- package/dist/core/llm/services/llm.service.d.ts +4 -1
- package/dist/core/llm/services/llm.service.d.ts.map +1 -1
- package/dist/core/llm/services/llm.service.js +304 -220
- package/dist/core/llm/services/llm.service.js.map +1 -1
- package/dist/foundations/assistant/assistant.module.d.ts.map +1 -1
- package/dist/foundations/assistant/assistant.module.js +3 -2
- package/dist/foundations/assistant/assistant.module.js.map +1 -1
- package/dist/foundations/assistant/entities/assistant.d.ts +15 -16
- package/dist/foundations/assistant/entities/assistant.d.ts.map +1 -1
- package/dist/foundations/assistant/entities/assistant.js +21 -9
- package/dist/foundations/assistant/entities/assistant.js.map +1 -1
- package/dist/foundations/assistant/repositories/assistant.repository.d.ts +13 -0
- package/dist/foundations/assistant/repositories/assistant.repository.d.ts.map +1 -1
- package/dist/foundations/assistant/services/assistant.service.d.ts +35 -10
- package/dist/foundations/assistant/services/assistant.service.d.ts.map +1 -1
- package/dist/foundations/assistant/services/assistant.service.js +132 -17
- package/dist/foundations/assistant/services/assistant.service.js.map +1 -1
- package/dist/foundations/assistant-message/entities/assistant-message.d.ts +30 -10
- package/dist/foundations/assistant-message/entities/assistant-message.d.ts.map +1 -1
- package/dist/foundations/assistant-message/entities/assistant-message.js +19 -4
- package/dist/foundations/assistant-message/entities/assistant-message.js.map +1 -1
- package/dist/foundations/assistant-message/repositories/assistant-message.repository.d.ts +53 -4
- package/dist/foundations/assistant-message/repositories/assistant-message.repository.d.ts.map +1 -1
- package/dist/foundations/assistant-message/repositories/assistant-message.repository.js +43 -3
- package/dist/foundations/assistant-message/repositories/assistant-message.repository.js.map +1 -1
- package/dist/foundations/assistant-message/services/assistant-message.service.d.ts +26 -0
- package/dist/foundations/assistant-message/services/assistant-message.service.d.ts.map +1 -1
- package/dist/foundations/chunk/chunk.module.d.ts.map +1 -1
- package/dist/foundations/chunk/chunk.module.js +4 -5
- package/dist/foundations/chunk/chunk.module.js.map +1 -1
- package/dist/foundations/chunk/entities/chunk.entity.d.ts +19 -4
- package/dist/foundations/chunk/entities/chunk.entity.d.ts.map +1 -1
- package/dist/foundations/chunk/entities/chunk.entity.js +48 -0
- package/dist/foundations/chunk/entities/chunk.entity.js.map +1 -1
- package/dist/foundations/chunk/index.d.ts +1 -2
- package/dist/foundations/chunk/index.d.ts.map +1 -1
- package/dist/foundations/chunk/index.js +3 -3
- package/dist/foundations/chunk/index.js.map +1 -1
- package/dist/foundations/chunk/repositories/chunk.repository.d.ts.map +1 -1
- package/dist/foundations/chunk/repositories/chunk.repository.js +8 -8
- package/dist/foundations/chunk/repositories/chunk.repository.js.map +1 -1
- package/dist/foundations/chunk/services/chunk.service.d.ts.map +1 -1
- package/dist/foundations/chunk/services/chunk.service.js +2 -2
- package/dist/foundations/chunk/services/chunk.service.js.map +1 -1
- package/package.json +1 -1
- package/dist/agents/chatbot/chatbot.module.d.ts +0 -3
- package/dist/agents/chatbot/chatbot.module.d.ts.map +0 -1
- package/dist/agents/chatbot/chatbot.module.js.map +0 -1
- package/dist/agents/chatbot/interfaces/chatbot.response.interface.d.ts +0 -25
- package/dist/agents/chatbot/interfaces/chatbot.response.interface.d.ts.map +0 -1
- package/dist/agents/chatbot/interfaces/chatbot.response.interface.js.map +0 -1
- package/dist/agents/chatbot/interfaces/graph.catalog.interface.d.ts.map +0 -1
- package/dist/agents/chatbot/interfaces/graph.catalog.interface.js.map +0 -1
- package/dist/agents/chatbot/prompts/chatbot.system.prompt.d.ts +0 -3
- package/dist/agents/chatbot/prompts/chatbot.system.prompt.d.ts.map +0 -1
- package/dist/agents/chatbot/prompts/chatbot.system.prompt.js +0 -60
- package/dist/agents/chatbot/prompts/chatbot.system.prompt.js.map +0 -1
- package/dist/agents/chatbot/repositories/user-modules.repository.d.ts.map +0 -1
- package/dist/agents/chatbot/repositories/user-modules.repository.js.map +0 -1
- package/dist/agents/chatbot/services/chatbot.index.manager.d.ts.map +0 -1
- package/dist/agents/chatbot/services/chatbot.index.manager.js.map +0 -1
- package/dist/agents/chatbot/services/chatbot.search.service.d.ts +0 -46
- package/dist/agents/chatbot/services/chatbot.search.service.d.ts.map +0 -1
- package/dist/agents/chatbot/services/chatbot.search.service.js +0 -148
- package/dist/agents/chatbot/services/chatbot.search.service.js.map +0 -1
- package/dist/agents/chatbot/services/chatbot.service.d.ts +0 -36
- package/dist/agents/chatbot/services/chatbot.service.d.ts.map +0 -1
- package/dist/agents/chatbot/services/chatbot.service.js +0 -220
- package/dist/agents/chatbot/services/chatbot.service.js.map +0 -1
- package/dist/agents/chatbot/services/descriptor.source.d.ts.map +0 -1
- package/dist/agents/chatbot/services/descriptor.source.js.map +0 -1
- package/dist/agents/chatbot/services/field-formatting.d.ts.map +0 -1
- package/dist/agents/chatbot/services/field-formatting.js.map +0 -1
- package/dist/agents/chatbot/services/graph.catalog.service.d.ts.map +0 -1
- package/dist/agents/chatbot/services/graph.catalog.service.js.map +0 -1
- package/dist/agents/chatbot/services/humanize-tool.d.ts.map +0 -1
- package/dist/agents/chatbot/services/humanize-tool.js.map +0 -1
- package/dist/agents/chatbot/tools/describe-entity.tool.d.ts.map +0 -1
- package/dist/agents/chatbot/tools/describe-entity.tool.js.map +0 -1
- package/dist/agents/chatbot/tools/read-entity.tool.d.ts.map +0 -1
- package/dist/agents/chatbot/tools/read-entity.tool.js.map +0 -1
- package/dist/agents/chatbot/tools/resolve-entity.tool.d.ts.map +0 -1
- package/dist/agents/chatbot/tools/resolve-entity.tool.js.map +0 -1
- package/dist/agents/chatbot/tools/search-entities.tool.d.ts.map +0 -1
- package/dist/agents/chatbot/tools/search-entities.tool.js.map +0 -1
- package/dist/agents/chatbot/tools/tool.factory.d.ts.map +0 -1
- package/dist/agents/chatbot/tools/tool.factory.js.map +0 -1
- package/dist/agents/chatbot/tools/traverse.tool.d.ts.map +0 -1
- package/dist/agents/chatbot/tools/traverse.tool.js.map +0 -1
- package/dist/foundations/chunk/entities/chunk.map.d.ts +0 -8
- package/dist/foundations/chunk/entities/chunk.map.d.ts.map +0 -1
- package/dist/foundations/chunk/entities/chunk.map.js +0 -31
- package/dist/foundations/chunk/entities/chunk.map.js.map +0 -1
- package/dist/foundations/chunk/entities/chunk.model.d.ts +0 -4
- package/dist/foundations/chunk/entities/chunk.model.d.ts.map +0 -1
- package/dist/foundations/chunk/entities/chunk.model.js +0 -13
- package/dist/foundations/chunk/entities/chunk.model.js.map +0 -1
- package/dist/foundations/chunk/serialisers/chunk.serialiser.d.ts +0 -14
- package/dist/foundations/chunk/serialisers/chunk.serialiser.d.ts.map +0 -1
- package/dist/foundations/chunk/serialisers/chunk.serialiser.js +0 -54
- package/dist/foundations/chunk/serialisers/chunk.serialiser.js.map +0 -1
- /package/dist/agents/{chatbot → graph}/interfaces/graph.catalog.interface.js +0 -0
- /package/dist/agents/{chatbot → graph}/repositories/user-modules.repository.d.ts +0 -0
- /package/dist/agents/{chatbot → graph}/repositories/user-modules.repository.js +0 -0
- /package/dist/agents/{chatbot → graph}/services/field-formatting.d.ts +0 -0
- /package/dist/agents/{chatbot → graph}/services/field-formatting.js +0 -0
- /package/dist/agents/{chatbot → graph}/services/humanize-tool.d.ts +0 -0
- /package/dist/agents/{chatbot → graph}/services/humanize-tool.js +0 -0
- /package/dist/agents/{chatbot → graph}/tools/describe-entity.tool.d.ts +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chunk.repository.d.ts","sourceRoot":"","sources":["../../../../src/foundations/chunk/repositories/chunk.repository.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAE3D,OAAO,EAAE,UAAU,EAAE,MAAM,m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AAQ,EAAE,MAAM,EAAE,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAgB3D,wBAAwB,IAAI,OAAO,CAAC,IAAI,CAAC;IAYzC,sBAAsB,CAAC,MAAM,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAe/E,2BAA2B,CAAC,MAAM,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,KAAK,EAAE,CAAC;CAe1F"}
|
|
@@ -18,7 +18,7 @@ const core_1 = require("../../../core");
|
|
|
18
18
|
const model_service_1 = require("../../../core/llm/services/model.service");
|
|
19
19
|
const neo4j_service_1 = require("../../../core/neo4j/services/neo4j.service");
|
|
20
20
|
const security_service_1 = require("../../../core/security/services/security.service");
|
|
21
|
-
const
|
|
21
|
+
const chunk_entity_1 = require("../../chunk/entities/chunk.entity");
|
|
22
22
|
let ChunkRepository = class ChunkRepository {
|
|
23
23
|
constructor(neo4j, modelService, embedderService, clsService, securityService) {
|
|
24
24
|
this.neo4j = neo4j;
|
|
@@ -45,7 +45,7 @@ let ChunkRepository = class ChunkRepository {
|
|
|
45
45
|
});
|
|
46
46
|
}
|
|
47
47
|
async findPotentialChunks(params) {
|
|
48
|
-
const query = this.neo4j.initQuery({ serialiser:
|
|
48
|
+
const query = this.neo4j.initQuery({ serialiser: chunk_entity_1.ChunkDescriptor.model });
|
|
49
49
|
const queryEmbedding = await this.embedderService.vectoriseText({ text: params.question });
|
|
50
50
|
query.queryParams = {
|
|
51
51
|
...query.queryParams,
|
|
@@ -73,7 +73,7 @@ let ChunkRepository = class ChunkRepository {
|
|
|
73
73
|
return this.neo4j.readMany(query);
|
|
74
74
|
}
|
|
75
75
|
async findSubsequentChunkId(params) {
|
|
76
|
-
const query = this.neo4j.initQuery({ serialiser:
|
|
76
|
+
const query = this.neo4j.initQuery({ serialiser: chunk_entity_1.ChunkDescriptor.model });
|
|
77
77
|
query.queryParams = {
|
|
78
78
|
...query.queryParams,
|
|
79
79
|
chunkId: params.chunkId,
|
|
@@ -85,7 +85,7 @@ let ChunkRepository = class ChunkRepository {
|
|
|
85
85
|
return this.neo4j.readOne(query);
|
|
86
86
|
}
|
|
87
87
|
async findPreviousChunkId(params) {
|
|
88
|
-
const query = this.neo4j.initQuery({ serialiser:
|
|
88
|
+
const query = this.neo4j.initQuery({ serialiser: chunk_entity_1.ChunkDescriptor.model });
|
|
89
89
|
query.queryParams = {
|
|
90
90
|
...query.queryParams,
|
|
91
91
|
chunkId: params.chunkId,
|
|
@@ -97,7 +97,7 @@ let ChunkRepository = class ChunkRepository {
|
|
|
97
97
|
return this.neo4j.readOne(query);
|
|
98
98
|
}
|
|
99
99
|
async findChunkById(params) {
|
|
100
|
-
const query = this.neo4j.initQuery({ serialiser:
|
|
100
|
+
const query = this.neo4j.initQuery({ serialiser: chunk_entity_1.ChunkDescriptor.model });
|
|
101
101
|
query.queryParams = {
|
|
102
102
|
...query.queryParams,
|
|
103
103
|
chunkId: params.chunkId,
|
|
@@ -109,7 +109,7 @@ let ChunkRepository = class ChunkRepository {
|
|
|
109
109
|
return this.neo4j.readOne(query);
|
|
110
110
|
}
|
|
111
111
|
async findChunks(params) {
|
|
112
|
-
const query = this.neo4j.initQuery({ serialiser:
|
|
112
|
+
const query = this.neo4j.initQuery({ serialiser: chunk_entity_1.ChunkDescriptor.model });
|
|
113
113
|
query.queryParams = {
|
|
114
114
|
...query.queryParams,
|
|
115
115
|
id: params.id,
|
|
@@ -177,7 +177,7 @@ let ChunkRepository = class ChunkRepository {
|
|
|
177
177
|
await this.neo4j.writeOne(query);
|
|
178
178
|
}
|
|
179
179
|
async getChunksInProgress(params) {
|
|
180
|
-
const query = this.neo4j.initQuery({ serialiser:
|
|
180
|
+
const query = this.neo4j.initQuery({ serialiser: chunk_entity_1.ChunkDescriptor.model });
|
|
181
181
|
query.queryParams = {
|
|
182
182
|
...query.queryParams,
|
|
183
183
|
id: params.id,
|
|
@@ -235,7 +235,7 @@ let ChunkRepository = class ChunkRepository {
|
|
|
235
235
|
await this.neo4j.writeOne(query);
|
|
236
236
|
}
|
|
237
237
|
async findChunkByContentIdAndType(params) {
|
|
238
|
-
const query = this.neo4j.initQuery({ fetchAll: true, serialiser:
|
|
238
|
+
const query = this.neo4j.initQuery({ fetchAll: true, serialiser: chunk_entity_1.ChunkDescriptor.model });
|
|
239
239
|
query.queryParams = {
|
|
240
240
|
id: params.id,
|
|
241
241
|
nodeType: params.type,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chunk.repository.js","sourceRoot":"","sources":["../../../../src/foundations/chunk/repositories/chunk.repository.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA0D;AAC1D,2CAAwC;AACxC,+DAA2D;AAC3D,kFAA6E;AAE7E,wCAAgD;AAChD,4EAAwE;AACxE,8EAA0E;AAC1E,uFAAmF;
|
|
1
|
+
{"version":3,"file":"chunk.repository.js","sourceRoot":"","sources":["../../../../src/foundations/chunk/repositories/chunk.repository.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA0D;AAC1D,2CAAwC;AACxC,+DAA2D;AAC3D,kFAA6E;AAE7E,wCAAgD;AAChD,4EAAwE;AACxE,8EAA0E;AAC1E,uFAAmF;AACnF,oEAA2E;AAGpE,IAAM,eAAe,GAArB,MAAM,eAAe;IAC1B,YACmB,KAAmB,EACnB,YAA0B,EAC1B,eAAgC,EAChC,UAAsB,EACtB,eAAgC;QAJhC,UAAK,GAAL,KAAK,CAAc;QACnB,iBAAY,GAAZ,YAAY,CAAc;QAC1B,oBAAe,GAAf,eAAe,CAAiB;QAChC,eAAU,GAAV,UAAU,CAAY;QACtB,oBAAe,GAAf,eAAe,CAAiB;IAChD,CAAC;IAEJ,KAAK,CAAC,YAAY;QAChB,MAAM,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC;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","sourceRoot":"","sources":["../../../../src/foundations/chunk/services/chunk.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAGrD,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAGzC,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,EAAE,mBAAmB,EAAE,MAAM,8DAA8D,CAAC;AAGnG,OAAO,EAAE,mBAAmB,EAAE,MAAM,kDAAkD,CAAC;AAEvF,OAAO,EAAE,oBAAoB,EAAE,MAAM,yDAAyD,CAAC;AAC/F,OAAO,EAAE,cAAc,EAAE,MAAM,gDAAgD,CAAC;AAChF,OAAO,EAAE,iBAAiB,EAAE,MAAM,gDAAgD,CAAC;AACnF,OAAO,EAAE,cAAc,EAAE,MAAM,gDAAgD,CAAC;AAChF,OAAO,EAAE,iBAAiB,EAAE,MAAM,8CAA8C,CAAC;AACjF,OAAO,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"chunk.service.d.ts","sourceRoot":"","sources":["../../../../src/foundations/chunk/services/chunk.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAGrD,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAGzC,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,EAAE,mBAAmB,EAAE,MAAM,8DAA8D,CAAC;AAGnG,OAAO,EAAE,mBAAmB,EAAE,MAAM,kDAAkD,CAAC;AAEvF,OAAO,EAAE,oBAAoB,EAAE,MAAM,yDAAyD,CAAC;AAC/F,OAAO,EAAE,cAAc,EAAE,MAAM,gDAAgD,CAAC;AAChF,OAAO,EAAE,iBAAiB,EAAE,MAAM,gDAAgD,CAAC;AACnF,OA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AAC,wBAAwB;YASlB,2BAA2B;YAqC3B,gCAAgC;IAkCxC,QAAQ,CAAC,MAAM,EAAE;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAQpE,YAAY,CAAC,MAAM,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,QAAQ,EAAE,CAAA;KAAE,GAAG,OAAO,CAAC,KAAK,EAAE,CAAC;IAyB1F,YAAY,CAAC,MAAM,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAkBrE,aAAa,CAAC,MAAM,EAAE;QAC1B,SAAS,EAAE,MAAM,CAAC;QAClB,MAAM,EAAE,MAAM,CAAC;QACf,OAAO,EAAE,MAAM,CAAC;QAChB,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,EAAE,MAAM,CAAC;KACd,GAAG,OAAO,CAAC,IAAI,CAAC;IAoIjB;;;;OAIG;IACH,OAAO,CAAC,WAAW;CAepB"}
|
|
@@ -22,7 +22,7 @@ const jsonapi_service_1 = require("../../../core/jsonapi/services/jsonapi.servic
|
|
|
22
22
|
const logging_service_1 = require("../../../core/logging/services/logging.service");
|
|
23
23
|
const tracing_service_1 = require("../../../core/tracing/services/tracing.service");
|
|
24
24
|
const atomicfact_service_1 = require("../../atomicfact/services/atomicfact.service");
|
|
25
|
-
const
|
|
25
|
+
const chunk_entity_1 = require("../../chunk/entities/chunk.entity");
|
|
26
26
|
const chunk_repository_1 = require("../../chunk/repositories/chunk.repository");
|
|
27
27
|
const keyconcept_repository_1 = require("../../keyconcept/repositories/keyconcept.repository");
|
|
28
28
|
const keyconcept_service_1 = require("../../keyconcept/services/keyconcept.service");
|
|
@@ -114,7 +114,7 @@ let ChunkService = class ChunkService {
|
|
|
114
114
|
const chunk = await this.chunkRepository.findChunkById({
|
|
115
115
|
chunkId: params.chunkId,
|
|
116
116
|
});
|
|
117
|
-
return this.builder.buildSingle(
|
|
117
|
+
return this.builder.buildSingle(chunk_entity_1.ChunkDescriptor.model, chunk);
|
|
118
118
|
}
|
|
119
119
|
async createChunks(params) {
|
|
120
120
|
let previousChunkId = undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chunk.service.js","sourceRoot":"","sources":["../../../../src/foundations/chunk/services/chunk.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,2CAA+C;AAC/C,2CAA4C;AAC5C,2CAA+C;AAC/C,uCAAyC;AAEzC,mCAAoC;AACpC,2CAAwC;AACxC,wGAAmG;AACnG,+DAA2D;AAK3D,oFAAgF;AAChF,oFAAmF;AACnF,oFAAgF;AAChF,qFAAiF;
|
|
1
|
+
{"version":3,"file":"chunk.service.js","sourceRoot":"","sources":["../../../../src/foundations/chunk/services/chunk.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,2CAA+C;AAC/C,2CAA4C;AAC5C,2CAA+C;AAC/C,uCAAyC;AAEzC,mCAAoC;AACpC,2CAAwC;AACxC,wGAAmG;AACnG,+DAA2D;AAK3D,oFAAgF;AAChF,oFAAmF;AACnF,oFAAgF;AAChF,qFAAiF;AACjF,oEAA2E;AAC3E,gFAA4E;AAC5E,+FAA2F;AAC3F,qFAAiF;AACjF,4EAAwE;AACxE,qFAAiF;AAG1E,IAAM,YAAY,GAAlB,MAAM,YAAY;IAGvB,YACmB,MAAyB,EACzB,MAAsB,EACtB,UAAsB,EACtB,OAAuB,EACvB,eAAgC,EAChC,iBAAoC,EACpC,iBAAoC,EACpC,qBAA0C,EAC1C,oBAA0C,EAC1C,iBAAoC,EACpC,SAAoB,EACrC,aAAiD;QAXhC,WAAM,GAAN,MAAM,CAAmB;QACzB,WAAM,GAAN,MAAM,CAAgB;QACtB,eAAU,GAAV,UAAU,CAAY;QACtB,YAAO,GAAP,OAAO,CAAgB;QACvB,oBAAe,GAA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KAAK,CAAC;QACf,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,iCAAiC,IAAI,MAAM,KAAK,CAAC,OAAO,EAAE,EAAE,cAAc,CAAC,CAAC;YAC9F,MAAM,IAAI,KAAK,CACb,2BAA2B,IAAI,mBAAmB,SAAS,iDAAiD,CAC7G,CAAC;QACJ,CAAC;IACH,CAAC;CACF,CAAA;AA/TY,oCAAY;uBAAZ,YAAY;IADxB,IAAA,mBAAU,GAAE;qCAKgB,mCAAiB;QACjB,gCAAc;QACV,uBAAU;QACb,gCAAc;QACN,kCAAe;QACb,sCAAiB;QACjB,sCAAiB;QACb,2CAAmB;QACpB,4CAAoB;QACvB,sCAAiB;QACzB,gBAAS;QACtB,sBAAa;GAfnB,YAAY,CA+TxB"}
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"chatbot.module.d.ts","sourceRoot":"","sources":["../../../src/agents/chatbot/chatbot.module.ts"],"names":[],"mappings":"AAeA,qBAsCa,aAAa;CAAG"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"chatbot.module.js","sourceRoot":"","sources":["../../../src/agents/chatbot/chatbot.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,0DAAsD;AACtD,oFAA+E;AAC/E,4EAAuE;AACvE,8EAAyE;AACzE,gEAA4D;AAC5D,oEAAuE;AACvE,4EAAuE;AACvE,uEAAkE;AAClE,+DAA0D;AAC1D,qEAAgE;AAChE,uEAAkE;AAClE,uDAAmD;AACnD,yDAAqD;AAwC9C,IAAM,aAAa,GAAnB,MAAM,aAAa;CAAG,CAAA;AAAhB,sCAAa;wBAAb,aAAa;IAtCzB,IAAA,eAAM,EAAC;QACN,OAAO,EAAE,CAAC,sBAAS,CAAC;QACpB,SAAS,EAAE;YACT,2CAAuB;YACvB;gBACE,OAAO,EAAE,2CAAmB;gBAC5B,UAAU,EAAE,CAAC,GAA4B,EAAE,EAAE,CAAC,IAAI,2CAAmB,CAAC,GAAG,CAAC;gBAC1E,MAAM,EAAE,CAAC,2CAAuB,CAAC;aAClC;YACD,0BAAW;YACX,uCAAiB;YACjB,yCAAkB;YAClB,yCAAkB;YAClB,iCAAc;YACd,4BAAY;YACZ,+CAAqB;YACrB,gCAAc;YAEd,wEAAwE;YACxE,2CAAmB;YAEnB,wEAAwE;YACxE,6CAAoB;SACrB;QACD,OAAO,EAAE;YACP,gCAAc;YACd,2CAAuB;YACvB,2CAAmB;YACnB,+CAAqB;YACrB,0BAAW;YACX,uCAAiB;YACjB,yCAAkB;YAClB,yCAAkB;YAClB,iCAAc;YACd,4BAAY;YACZ,6CAAoB;SACrB;KACF,CAAC;GACW,aAAa,CAAG"}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { AgentMessageType } from "../../../common/enums/agentmessage.type";
|
|
2
|
-
export interface ChatbotReference {
|
|
3
|
-
type: string;
|
|
4
|
-
id: string;
|
|
5
|
-
reason: string;
|
|
6
|
-
}
|
|
7
|
-
export interface ChatbotToolCall {
|
|
8
|
-
tool: string;
|
|
9
|
-
input: Record<string, unknown>;
|
|
10
|
-
durationMs: number;
|
|
11
|
-
error?: string;
|
|
12
|
-
}
|
|
13
|
-
export interface ChatbotResponseInterface {
|
|
14
|
-
type: AgentMessageType.Assistant;
|
|
15
|
-
answer: string;
|
|
16
|
-
references: ChatbotReference[];
|
|
17
|
-
needsClarification: boolean;
|
|
18
|
-
suggestedQuestions: string[];
|
|
19
|
-
tokens: {
|
|
20
|
-
input: number;
|
|
21
|
-
output: number;
|
|
22
|
-
};
|
|
23
|
-
toolCalls: ChatbotToolCall[];
|
|
24
|
-
}
|
|
25
|
-
//# sourceMappingURL=chatbot.response.interface.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"chatbot.response.interface.d.ts","sourceRoot":"","sources":["../../../../src/agents/chatbot/interfaces/chatbot.response.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,yCAAyC,CAAC;AAE3E,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC/B,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,wBAAwB;IACvC,IAAI,EAAE,gBAAgB,CAAC,SAAS,CAAC;IACjC,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,gBAAgB,EAAE,CAAC;IAC/B,kBAAkB,EAAE,OAAO,CAAC;IAC5B,kBAAkB,EAAE,MAAM,EAAE,CAAC;IAC7B,MAAM,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IAC1C,SAAS,EAAE,eAAe,EAAE,CAAC;CAC9B"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"chatbot.response.interface.js","sourceRoot":"","sources":["../../../../src/agents/chatbot/interfaces/chatbot.response.interface.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"graph.catalog.interface.d.ts","sourceRoot":"","sources":["../../../../src/agents/chatbot/interfaces/graph.catalog.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,oDAAoD,CAAC;AAE/E,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,6DAA6D;IAC7D,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,oDAAoD;IACpD,UAAU,EAAE,OAAO,CAAC;IACpB,6CAA6C;IAC7C,QAAQ,EAAE,OAAO,CAAC;IAClB;;;;OAIG;IACH,IAAI,CAAC,EAAE,SAAS,CAAC;CAClB;AAED,MAAM,WAAW,mBAAmB;IAClC,yCAAyC;IACzC,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,KAAK,GAAG,MAAM,CAAC;IAC5B,WAAW,EAAE,MAAM,CAAC;IACpB,wFAAwF;IACxF,eAAe,EAAE,KAAK,GAAG,IAAI,CAAC;IAC9B,WAAW,EAAE,MAAM,CAAC;IACpB,+FAA+F;IAC/F,SAAS,EAAE,OAAO,CAAC;IACnB;;;yFAGqF;IACrF,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,sEAAsE;IACtE,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,YAAY,EAAE,CAAC;IACvB,aAAa,EAAE,mBAAmB,EAAE,CAAC;IACrC,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,MAAM,CAAC;IAChC,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC5B,iEAAiE;IACjE,QAAQ,EAAE,MAAM,CAAC;IACjB,0DAA0D;IAC1D,SAAS,EAAE,MAAM,CAAC;CACnB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"graph.catalog.interface.js","sourceRoot":"","sources":["../../../../src/agents/chatbot/interfaces/graph.catalog.interface.ts"],"names":[],"mappings":""}
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
export declare const CHATBOT_SYSTEM_PROMPT_BASE = "# Role\n\nYou help a user explore their company's ERP data. The data is stored as a graph \u2014 entities are nodes, and the connections between them are edges.\n\nYou answer the user's questions by traversing this graph: find the entities the question is about, read their fields, and walk the relationships between them to reach related entities, continuing until you have enough information to answer. Nearly every useful answer requires following at least one edge \u2014 a single search is rarely the whole story.\n\nEvery fact in your answer must come from a tool call that returned it. Do not invent field names, relationship names, entity types, or record contents.\n\n## Your data\n\n{GRAPH_MAP}\n\nThe catalogue above is the complete list of entity types, fields, and relationships available to you. Anything not listed does not exist.\n\n**Every currency value in this system is stored as an integer number of cents \u2014 never as a decimal amount.** A stored value of `600` means 6.00, `500` means 5.00, and `1234567` means 12,345.67. Fields that carry money are marked `money` in the catalogue above (e.g. `total_amount (number, money [integer stored in minor units (2 decimals); divide by 10^2 to display], ...)`). For these fields, every record returned by `read_entity`, `search_entities`, or `traverse` also carries a sibling `<name>_formatted` string \u2014 quote that string when narrating the amount in your answer, and never quote the raw integer as if it were euros. Filters and sort still target the raw field (pass cents, e.g. `{ field: \"total_amount\", op: \"gt\", value: 10000 }` to mean \"over 100.00\").\n\n## Tools\n\nYou have five tools. Call them in sequence \u2014 a typical question needs two or three.\n\nBefore choosing a tool, check the \"Entities already in this conversation\" block that may be provided below. If the user's phrase refers to an entity listed there \u2014 by its exact name, by a partial name, or implicitly (\"them\", \"their\", \"other\", \"these\") \u2014 treat that entity as resolved. Use its `type` and `id` directly with `read_entity` or `traverse`. Do not call `resolve_entity` for a name that is already resolved in context.\n\nOtherwise, if the user names an entity \u2014 a customer, a person, a product, a project, anything that could correspond to a record in the graph \u2014 your first tool call is `resolve_entity` with the user's literal phrase. Do not guess a type. `resolve_entity` returns candidates across every entity type in one shot; you then pick a candidate and proceed with `describe_entity` + the typed tools.\n\n- `resolve_entity(text)` \u2014 look up nodes by name across every entity type in one call. Pass the user's literal phrase verbatim, including words like \"and\", \"&\", or other punctuation that may be part of a name. The response carries a `matchMode` and `items` sorted by `score` descending:\n - `exact` or `fuzzy` \u2192 if `items.length === 1` or `items[0].score - items[1].score \u2265 0.15`, pick `items[0]`. Otherwise set `needsClarification: true` and list the top candidates to the user.\n - `semantic` \u2192 same rule, margin \u2265 0.08. Also warn the user that the match is approximate.\n - `none` \u2192 no record exists; tell the user and suggest rephrasing.\n\n- `describe_entity(type)` \u2014 inspect one entity type in full: every field with its type, and every relationship with its target type and description. Call this for every type you intend to touch, BEFORE searching, reading, or traversing it. The next three tools will refuse to run on a type that has not been described in this turn.\n\n- `search_entities(type, filters?, sort?, limit?)` \u2014 find records of a known type by filter and sort. Use this when you already have the type (from `resolve_entity` or because the user referred to a kind of record without naming a specific one, e.g. \"all orders over 10,000\"). `search_entities` does not search by name \u2014 to find a record by name, call `resolve_entity` first.\n\n- `read_entity(type, id, include?)` \u2014 fetch the full fields of a single node by id. Tool outputs from other tools are summaries; call this to get the complete record before reporting on it.\n\n- `traverse(fromType, fromId, relationship, filters?, sort?, limit?)` \u2014 walk one edge from a known node to its connected nodes. The `relationship` must be one listed under the source type in the catalogue. `filters` and `sort` apply to the target node's fields. This is the only way to cross from one entity type to another.\n\nIf a tool returns `{ error: \"\u2026\" }`, read the message \u2014 it usually lists valid fields or relationships. Pick one of those and call the tool again. Recover within the same turn; do not apologise to the user for a tool error.\n\n## Output\n\nReturn these fields:\n\n- `answer` \u2014 a concise prose reply (2\u20134 sentences) built from the actual field values and traversal results. When you report on a record, use its real field values, not its type name.\n\n- `references` \u2014 every entity that contributes to the meaning of your `answer`, as `{ type, id, reason }`. An entity contributes when it is the subject the user asked about, or a record the answer reports a fact about. `reason` is one short clause explaining that role (for example \"the account the user asked about\", \"one of the orders listed in the answer\"). Do not include entities you retrieved, inspected, and discarded: a `resolve_entity` call that returned three candidates of which you only used one \u2014 the other two are not references; a `traverse` that walked an edge whose target you did not mention \u2014 not a reference. These references are persisted and re-loaded as context on the next turn, so polluting them with irrelevant records will cause the next turn to confuse them with the actual subject \u2014 be strict.\n\n- `suggestedQuestions` \u2014 3 to 5 concrete next questions. Each should name an entity from the answer and point to a relationship in the catalogue that you did not walk this turn.\n\n- `needsClarification` \u2014 `true` when (a) `resolve_entity` returned multiple candidates in the winning tier and the top score did not exceed the runner-up by the tier's margin threshold, or (b) a `search_entities` filter query returned multiple records with no way for you to pick between them. Do not set this without evidence from a tool call.\n";
|
|
2
|
-
export declare function renderChatbotSystemPrompt(graphMap: string): string;
|
|
3
|
-
//# sourceMappingURL=chatbot.system.prompt.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"chatbot.system.prompt.d.ts","sourceRoot":"","sources":["../../../../src/agents/chatbot/prompts/chatbot.system.prompt.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,0BAA0B,qwMAkDtC,CAAC;AAEF,wBAAgB,yBAAyB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAMlE"}
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CHATBOT_SYSTEM_PROMPT_BASE = void 0;
|
|
4
|
-
exports.renderChatbotSystemPrompt = renderChatbotSystemPrompt;
|
|
5
|
-
exports.CHATBOT_SYSTEM_PROMPT_BASE = `# Role
|
|
6
|
-
|
|
7
|
-
You help a user explore their company's ERP data. The data is stored as a graph — entities are nodes, and the connections between them are edges.
|
|
8
|
-
|
|
9
|
-
You answer the user's questions by traversing this graph: find the entities the question is about, read their fields, and walk the relationships between them to reach related entities, continuing until you have enough information to answer. Nearly every useful answer requires following at least one edge — a single search is rarely the whole story.
|
|
10
|
-
|
|
11
|
-
Every fact in your answer must come from a tool call that returned it. Do not invent field names, relationship names, entity types, or record contents.
|
|
12
|
-
|
|
13
|
-
## Your data
|
|
14
|
-
|
|
15
|
-
{GRAPH_MAP}
|
|
16
|
-
|
|
17
|
-
The catalogue above is the complete list of entity types, fields, and relationships available to you. Anything not listed does not exist.
|
|
18
|
-
|
|
19
|
-
**Every currency value in this system is stored as an integer number of cents — never as a decimal amount.** A stored value of \`600\` means 6.00, \`500\` means 5.00, and \`1234567\` means 12,345.67. Fields that carry money are marked \`money\` in the catalogue above (e.g. \`total_amount (number, money [integer stored in minor units (2 decimals); divide by 10^2 to display], ...)\`). For these fields, every record returned by \`read_entity\`, \`search_entities\`, or \`traverse\` also carries a sibling \`<name>_formatted\` string — quote that string when narrating the amount in your answer, and never quote the raw integer as if it were euros. Filters and sort still target the raw field (pass cents, e.g. \`{ field: "total_amount", op: "gt", value: 10000 }\` to mean "over 100.00").
|
|
20
|
-
|
|
21
|
-
## Tools
|
|
22
|
-
|
|
23
|
-
You have five tools. Call them in sequence — a typical question needs two or three.
|
|
24
|
-
|
|
25
|
-
Before choosing a tool, check the "Entities already in this conversation" block that may be provided below. If the user's phrase refers to an entity listed there — by its exact name, by a partial name, or implicitly ("them", "their", "other", "these") — treat that entity as resolved. Use its \`type\` and \`id\` directly with \`read_entity\` or \`traverse\`. Do not call \`resolve_entity\` for a name that is already resolved in context.
|
|
26
|
-
|
|
27
|
-
Otherwise, if the user names an entity — a customer, a person, a product, a project, anything that could correspond to a record in the graph — your first tool call is \`resolve_entity\` with the user's literal phrase. Do not guess a type. \`resolve_entity\` returns candidates across every entity type in one shot; you then pick a candidate and proceed with \`describe_entity\` + the typed tools.
|
|
28
|
-
|
|
29
|
-
- \`resolve_entity(text)\` — look up nodes by name across every entity type in one call. Pass the user's literal phrase verbatim, including words like "and", "&", or other punctuation that may be part of a name. The response carries a \`matchMode\` and \`items\` sorted by \`score\` descending:
|
|
30
|
-
- \`exact\` or \`fuzzy\` → if \`items.length === 1\` or \`items[0].score - items[1].score ≥ 0.15\`, pick \`items[0]\`. Otherwise set \`needsClarification: true\` and list the top candidates to the user.
|
|
31
|
-
- \`semantic\` → same rule, margin ≥ 0.08. Also warn the user that the match is approximate.
|
|
32
|
-
- \`none\` → no record exists; tell the user and suggest rephrasing.
|
|
33
|
-
|
|
34
|
-
- \`describe_entity(type)\` — inspect one entity type in full: every field with its type, and every relationship with its target type and description. Call this for every type you intend to touch, BEFORE searching, reading, or traversing it. The next three tools will refuse to run on a type that has not been described in this turn.
|
|
35
|
-
|
|
36
|
-
- \`search_entities(type, filters?, sort?, limit?)\` — find records of a known type by filter and sort. Use this when you already have the type (from \`resolve_entity\` or because the user referred to a kind of record without naming a specific one, e.g. "all orders over 10,000"). \`search_entities\` does not search by name — to find a record by name, call \`resolve_entity\` first.
|
|
37
|
-
|
|
38
|
-
- \`read_entity(type, id, include?)\` — fetch the full fields of a single node by id. Tool outputs from other tools are summaries; call this to get the complete record before reporting on it.
|
|
39
|
-
|
|
40
|
-
- \`traverse(fromType, fromId, relationship, filters?, sort?, limit?)\` — walk one edge from a known node to its connected nodes. The \`relationship\` must be one listed under the source type in the catalogue. \`filters\` and \`sort\` apply to the target node's fields. This is the only way to cross from one entity type to another.
|
|
41
|
-
|
|
42
|
-
If a tool returns \`{ error: "…" }\`, read the message — it usually lists valid fields or relationships. Pick one of those and call the tool again. Recover within the same turn; do not apologise to the user for a tool error.
|
|
43
|
-
|
|
44
|
-
## Output
|
|
45
|
-
|
|
46
|
-
Return these fields:
|
|
47
|
-
|
|
48
|
-
- \`answer\` — a concise prose reply (2–4 sentences) built from the actual field values and traversal results. When you report on a record, use its real field values, not its type name.
|
|
49
|
-
|
|
50
|
-
- \`references\` — every entity that contributes to the meaning of your \`answer\`, as \`{ type, id, reason }\`. An entity contributes when it is the subject the user asked about, or a record the answer reports a fact about. \`reason\` is one short clause explaining that role (for example "the account the user asked about", "one of the orders listed in the answer"). Do not include entities you retrieved, inspected, and discarded: a \`resolve_entity\` call that returned three candidates of which you only used one — the other two are not references; a \`traverse\` that walked an edge whose target you did not mention — not a reference. These references are persisted and re-loaded as context on the next turn, so polluting them with irrelevant records will cause the next turn to confuse them with the actual subject — be strict.
|
|
51
|
-
|
|
52
|
-
- \`suggestedQuestions\` — 3 to 5 concrete next questions. Each should name an entity from the answer and point to a relationship in the catalogue that you did not walk this turn.
|
|
53
|
-
|
|
54
|
-
- \`needsClarification\` — \`true\` when (a) \`resolve_entity\` returned multiple candidates in the winning tier and the top score did not exceed the runner-up by the tier's margin threshold, or (b) a \`search_entities\` filter query returned multiple records with no way for you to pick between them. Do not set this without evidence from a tool call.
|
|
55
|
-
`;
|
|
56
|
-
function renderChatbotSystemPrompt(graphMap) {
|
|
57
|
-
return exports.CHATBOT_SYSTEM_PROMPT_BASE.replace("{GRAPH_MAP}", graphMap ||
|
|
58
|
-
"(No accessible data — the user has no enabled modules with described entities. DO NOT attempt any tool calls. Respond politely explaining that you have no data to query.)");
|
|
59
|
-
}
|
|
60
|
-
//# sourceMappingURL=chatbot.system.prompt.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"chatbot.system.prompt.js","sourceRoot":"","sources":["../../../../src/agents/chatbot/prompts/chatbot.system.prompt.ts"],"names":[],"mappings":";;;AAoDA,8DAMC;AA1DY,QAAA,0BAA0B,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkDzC,CAAC;AAEF,SAAgB,yBAAyB,CAAC,QAAgB;IACxD,OAAO,kCAA0B,CAAC,OAAO,CACvC,aAAa,EACb,QAAQ;QACN,4KAA4K,CAC/K,CAAC;AACJ,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"user-modules.repository.d.ts","sourceRoot":"","sources":["../../../../src/agents/chatbot/repositories/user-modules.repository.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,4CAA4C,CAAC;AAQ1E;;;;;;;;;GASG;AACH,qBACa,qBAAqB;IAGpB,OAAO,CAAC,QAAQ,CAAC,KAAK;IAFlC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA0C;gBAEpC,KAAK,EAAE,YAAY;IAEhD;;;;;;;;;OASG;IACG,oBAAoB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;CA4B9D"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"user-modules.repository.js","sourceRoot":"","sources":["../../../../src/agents/chatbot/repositories/user-modules.repository.ts"],"names":[],"mappings":";;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ACP,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,8DAA8D,EAAE,EAAE,CAAC,CAAC;YACvF,CAAC;QACH,CAAC;QACD,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,gCAAgC,MAAM,sBAAsB,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;QACzG,OAAO,SAAS,CAAC;IACnB,CAAC;CACF,CAAA;AA3CY,sDAAqB;gCAArB,qBAAqB;IADjC,IAAA,mBAAU,GAAE;qCAIyB,4BAAY;GAHrC,qBAAqB,CA2CjC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"chatbot.index.manager.d.ts","sourceRoot":"","sources":["../../../../src/agents/chatbot/services/chatbot.index.manager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAC5E,OAAO,EAAE,YAAY,EAAE,MAAM,0CAA0C,CAAC;AACxE,OAAO,EAAE,YAAY,EAAE,MAAM,4CAA4C,CAAC;AAE1E,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAE9D,qBACa,mBAAoB,YAAW,sBAAsB;IAI9D,OAAO,CAAC,QAAQ,CAAC,KAAK;IACtB,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,MAAM;IALzB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAwC;gBAG5C,KAAK,EAAE,YAAY,EACnB,OAAO,EAAE,mBAAmB,EAC5B,MAAM,EAAE,YAAY;IAOjC,sBAAsB,IAAI,OAAO,CAAC,IAAI,CAAC;YAY/B,cAAc;YAed,YAAY;IAkB1B,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IAIxC,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;CAGvC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"chatbot.index.manager.js","sourceRoot":"","sources":["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AAC,QAAQ,CAAC;YACxB,KAAK,EAAE;kCACqB,SAAS;mBACxB,CAAC,CAAC,SAAS;mBACX,MAAM;OAClB;SACF,CAAC,CAAC;QACH,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,0BAA0B,SAAS,QAAQ,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC;IAC9E,CAAC;IAEO,KAAK,CAAC,YAAY,CAAC,CAAgB,EAAE,IAAY;QACvD,IAAI,CAAC,CAAC,CAAC,gBAAgB,EAAE,MAAM;YAAE,OAAO;QAExC,MAAM,SAAS,GAAG,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;QACpD,MAAM,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC;YACxB,KAAK,EAAE;gCACmB,SAAS;mBACtB,CAAC,CAAC,SAAS;;;mCAGK,IAAI;;;OAGhC;SACF,CAAC,CAAC;QACH,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,wBAAwB,SAAS,QAAQ,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC;IAC5E,CAAC;IAED,iBAAiB,CAAC,KAAa;QAC7B,OAAO,GAAG,KAAK,CAAC,WAAW,EAAE,gBAAgB,CAAC;IAChD,CAAC;IAED,eAAe,CAAC,KAAa;QAC3B,OAAO,GAAG,KAAK,CAAC,WAAW,EAAE,iBAAiB,CAAC;IACjD,CAAC;CACF,CAAA;AAjEY,kDAAmB;8BAAnB,mBAAmB;IAD/B,IAAA,mBAAU,GAAE;qCAKe,4BAAY;QACV,2CAAmB;QACpB,4BAAY;GAN5B,mBAAmB,CAiE/B"}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { EmbedderService } from "../../../core/llm/services/embedder.service";
|
|
2
|
-
import { Neo4jService } from "../../../core/neo4j/services/neo4j.service";
|
|
3
|
-
import { CatalogEntity } from "../interfaces/graph.catalog.interface";
|
|
4
|
-
import { ChatbotIndexManager } from "./chatbot.index.manager";
|
|
5
|
-
import { GraphCatalogService } from "./graph.catalog.service";
|
|
6
|
-
export declare const CHATBOT_EXACT_MAX_RESULTS = 10;
|
|
7
|
-
export declare const CHATBOT_FUZZY_MAX_RESULTS = 10;
|
|
8
|
-
export declare const CHATBOT_SEMANTIC_MAX_RESULTS = 5;
|
|
9
|
-
export declare const CHATBOT_RESOLVE_MAX_RESULTS = 10;
|
|
10
|
-
export declare const CHATBOT_SEMANTIC_MIN_SCORE = 0.6;
|
|
11
|
-
export type MatchMode = "exact" | "fuzzy" | "semantic" | "none";
|
|
12
|
-
export interface RunSearchParams {
|
|
13
|
-
entity: CatalogEntity;
|
|
14
|
-
text: string;
|
|
15
|
-
companyId: string;
|
|
16
|
-
limit: number;
|
|
17
|
-
}
|
|
18
|
-
export interface RankedCandidate {
|
|
19
|
-
type: string;
|
|
20
|
-
id: string;
|
|
21
|
-
summary: string;
|
|
22
|
-
score: number;
|
|
23
|
-
}
|
|
24
|
-
export interface ResolveEntityParams {
|
|
25
|
-
text: string;
|
|
26
|
-
companyId: string;
|
|
27
|
-
userModuleIds: string[];
|
|
28
|
-
}
|
|
29
|
-
export interface ResolveEntityResult {
|
|
30
|
-
matchMode: MatchMode;
|
|
31
|
-
items: RankedCandidate[];
|
|
32
|
-
}
|
|
33
|
-
export declare class ChatbotSearchService {
|
|
34
|
-
private readonly neo4j;
|
|
35
|
-
private readonly embedder;
|
|
36
|
-
private readonly indexNames;
|
|
37
|
-
private readonly catalog;
|
|
38
|
-
private readonly logger;
|
|
39
|
-
constructor(neo4j: Neo4jService, embedder: EmbedderService, indexNames: ChatbotIndexManager, catalog: GraphCatalogService);
|
|
40
|
-
resolveEntity(params: ResolveEntityParams): Promise<ResolveEntityResult>;
|
|
41
|
-
private runTierForEntitySafe;
|
|
42
|
-
private projectSummary;
|
|
43
|
-
private tierFulltext;
|
|
44
|
-
private tierSemantic;
|
|
45
|
-
}
|
|
46
|
-
//# sourceMappingURL=chatbot.search.service.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"chatbot.search.service.d.ts","sourceRoot":"","sources":["../../../../src/agents/chatbot/services/chatbot.search.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,6CAA6C,CAAC;AAC9E,OAAO,EAAE,YAAY,EAAE,MAAM,4CAA4C,CAAC;AAC1E,OAAO,EAAE,aAAa,EAAE,MAAM,uCAAuC,CAAC;AACtE,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAE9D,eAAO,MAAM,yBAAyB,KAAK,CAAC;AAC5C,eAAO,MAAM,yBAAyB,KAAK,CAAC;AAC5C,eAAO,MAAM,4BAA4B,IAAI,CAAC;AAC9C,eAAO,MAAM,2BAA2B,KAAK,CAAC;AAC9C,eAAO,MAAM,0BAA0B,MAAM,CAAC;AAK9C,MAAM,MAAM,SAAS,GAAG,OAAO,GAAG,OAAO,GAAG,UAAU,GAAG,MAAM,CAAC;AAEhE,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,aAAa,CAAC;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,EAAE,CAAC;CACzB;AAED,MAAM,WAAW,mBAAmB;IAClC,SAAS,EAAE,SAAS,CAAC;IACrB,KAAK,EAAE,eAAe,EAAE,CAAC;CAC1B;AASD,qBACa,oBAAoB;IAI7B,OAAO,CAAC,QAAQ,CAAC,KAAK;IACtB,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,UAAU;IAC3B,OAAO,CAAC,QAAQ,CAAC,OAAO;IAN1B,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAyC;gBAG7C,KAAK,EAAE,YAAY,EACnB,QAAQ,EAAE,eAAe,EACzB,UAAU,EAAE,mBAAmB,EAC/B,OAAO,EAAE,mBAAmB;IAGzC,aAAa,CAAC,MAAM,EAAE,mBAAmB,GAAG,OAAO,CAAC,mBAAmB,CAAC;YAyBhE,oBAAoB;IAgClC,OAAO,CAAC,cAAc;YAiBR,YAAY;YA6BZ,YAAY;CAgC3B"}
|
|
@@ -1,148 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
-
};
|
|
11
|
-
var ChatbotSearchService_1;
|
|
12
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
exports.ChatbotSearchService = exports.CHATBOT_SEMANTIC_MIN_SCORE = exports.CHATBOT_RESOLVE_MAX_RESULTS = exports.CHATBOT_SEMANTIC_MAX_RESULTS = exports.CHATBOT_FUZZY_MAX_RESULTS = exports.CHATBOT_EXACT_MAX_RESULTS = void 0;
|
|
14
|
-
const common_1 = require("@nestjs/common");
|
|
15
|
-
const embedder_service_1 = require("../../../core/llm/services/embedder.service");
|
|
16
|
-
const neo4j_service_1 = require("../../../core/neo4j/services/neo4j.service");
|
|
17
|
-
const chatbot_index_manager_1 = require("./chatbot.index.manager");
|
|
18
|
-
const graph_catalog_service_1 = require("./graph.catalog.service");
|
|
19
|
-
exports.CHATBOT_EXACT_MAX_RESULTS = 10;
|
|
20
|
-
exports.CHATBOT_FUZZY_MAX_RESULTS = 10;
|
|
21
|
-
exports.CHATBOT_SEMANTIC_MAX_RESULTS = 5;
|
|
22
|
-
exports.CHATBOT_RESOLVE_MAX_RESULTS = 10;
|
|
23
|
-
exports.CHATBOT_SEMANTIC_MIN_SCORE = 0.6;
|
|
24
|
-
const CHATBOT_VECTOR_OVERFETCH = 50;
|
|
25
|
-
const LUCENE_RESERVED_RE = /[+\-&|!(){}[\]^"~*?:\\/]/g;
|
|
26
|
-
let ChatbotSearchService = ChatbotSearchService_1 = class ChatbotSearchService {
|
|
27
|
-
constructor(neo4j, embedder, indexNames, catalog) {
|
|
28
|
-
this.neo4j = neo4j;
|
|
29
|
-
this.embedder = embedder;
|
|
30
|
-
this.indexNames = indexNames;
|
|
31
|
-
this.catalog = catalog;
|
|
32
|
-
this.logger = new common_1.Logger(ChatbotSearchService_1.name);
|
|
33
|
-
}
|
|
34
|
-
async resolveEntity(params) {
|
|
35
|
-
const entities = this.catalog.getAllChatEnabledEntities().filter((e) => params.userModuleIds.includes(e.moduleId));
|
|
36
|
-
if (!entities.length) {
|
|
37
|
-
return { matchMode: "none", items: [] };
|
|
38
|
-
}
|
|
39
|
-
const tiers = [
|
|
40
|
-
["substring", "exact"],
|
|
41
|
-
["fuzzy", "fuzzy"],
|
|
42
|
-
["semantic", "semantic"],
|
|
43
|
-
];
|
|
44
|
-
for (const [tier, label] of tiers) {
|
|
45
|
-
const buckets = await Promise.all(entities.map((e) => this.runTierForEntitySafe(e, params, tier)));
|
|
46
|
-
const merged = buckets.flat();
|
|
47
|
-
if (merged.length) {
|
|
48
|
-
merged.sort((a, b) => b.score - a.score);
|
|
49
|
-
return { matchMode: label, items: merged.slice(0, exports.CHATBOT_RESOLVE_MAX_RESULTS) };
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
return { matchMode: "none", items: [] };
|
|
53
|
-
}
|
|
54
|
-
async runTierForEntitySafe(entity, params, tier) {
|
|
55
|
-
try {
|
|
56
|
-
const runParams = {
|
|
57
|
-
entity,
|
|
58
|
-
text: params.text,
|
|
59
|
-
companyId: params.companyId,
|
|
60
|
-
limit: tier === "semantic"
|
|
61
|
-
? exports.CHATBOT_SEMANTIC_MAX_RESULTS
|
|
62
|
-
: tier === "fuzzy"
|
|
63
|
-
? exports.CHATBOT_FUZZY_MAX_RESULTS
|
|
64
|
-
: exports.CHATBOT_EXACT_MAX_RESULTS,
|
|
65
|
-
};
|
|
66
|
-
const inner = tier === "semantic" ? await this.tierSemantic(runParams) : await this.tierFulltext(runParams, tier);
|
|
67
|
-
return inner.items.map((i) => ({
|
|
68
|
-
type: entity.type,
|
|
69
|
-
id: i.id,
|
|
70
|
-
summary: this.projectSummary(entity, i.properties, i.id),
|
|
71
|
-
score: i.score,
|
|
72
|
-
}));
|
|
73
|
-
}
|
|
74
|
-
catch (err) {
|
|
75
|
-
this.logger.warn(`resolveEntity: tier=${tier} type=${entity.type} threw: ${err instanceof Error ? err.message : String(err)}`);
|
|
76
|
-
return [];
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
projectSummary(entity, properties, id) {
|
|
80
|
-
if (entity.summary) {
|
|
81
|
-
try {
|
|
82
|
-
return entity.summary(properties);
|
|
83
|
-
}
|
|
84
|
-
catch {
|
|
85
|
-
/* fall through */
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
const name = properties.name;
|
|
89
|
-
if (typeof name === "string" && name.length)
|
|
90
|
-
return name;
|
|
91
|
-
return id;
|
|
92
|
-
}
|
|
93
|
-
async tierFulltext(params, mode) {
|
|
94
|
-
const indexName = this.indexNames.fulltextIndexName(params.entity.labelName);
|
|
95
|
-
const escaped = params.text.replace(LUCENE_RESERVED_RE, "\\$&").toLowerCase();
|
|
96
|
-
const term = mode === "substring" ? `*${escaped}*` : `${escaped}~`;
|
|
97
|
-
const max = mode === "substring" ? exports.CHATBOT_EXACT_MAX_RESULTS : exports.CHATBOT_FUZZY_MAX_RESULTS;
|
|
98
|
-
const result = await this.neo4j.read(`
|
|
99
|
-
CALL db.index.fulltext.queryNodes($indexName, $term)
|
|
100
|
-
YIELD node, score
|
|
101
|
-
WHERE (node)-[:BELONGS_TO]->(:Company { id: $companyId })
|
|
102
|
-
RETURN node.id AS id, properties(node) AS properties, score
|
|
103
|
-
ORDER BY score DESC
|
|
104
|
-
LIMIT toInteger($limit)
|
|
105
|
-
`, { indexName, term, companyId: params.companyId, limit: Math.min(params.limit, max) });
|
|
106
|
-
const items = result.records.map((r) => ({
|
|
107
|
-
id: r.get("id"),
|
|
108
|
-
score: r.get("score"),
|
|
109
|
-
properties: r.get("properties") ?? {},
|
|
110
|
-
}));
|
|
111
|
-
return { matchMode: mode === "substring" ? "exact" : "fuzzy", items };
|
|
112
|
-
}
|
|
113
|
-
async tierSemantic(params) {
|
|
114
|
-
const indexName = this.indexNames.vectorIndexName(params.entity.labelName);
|
|
115
|
-
const queryEmbedding = await this.embedder.vectoriseText({ text: params.text });
|
|
116
|
-
const result = await this.neo4j.read(`
|
|
117
|
-
CALL db.index.vector.queryNodes($indexName, toInteger($overFetch), $queryEmbedding)
|
|
118
|
-
YIELD node, score
|
|
119
|
-
WHERE (node)-[:BELONGS_TO]->(:Company { id: $companyId })
|
|
120
|
-
AND score >= $minScore
|
|
121
|
-
RETURN node.id AS id, properties(node) AS properties, score
|
|
122
|
-
ORDER BY score DESC
|
|
123
|
-
LIMIT toInteger($limit)
|
|
124
|
-
`, {
|
|
125
|
-
indexName,
|
|
126
|
-
overFetch: CHATBOT_VECTOR_OVERFETCH,
|
|
127
|
-
queryEmbedding,
|
|
128
|
-
companyId: params.companyId,
|
|
129
|
-
minScore: exports.CHATBOT_SEMANTIC_MIN_SCORE,
|
|
130
|
-
limit: Math.min(params.limit, exports.CHATBOT_SEMANTIC_MAX_RESULTS),
|
|
131
|
-
});
|
|
132
|
-
const items = result.records.map((r) => ({
|
|
133
|
-
id: r.get("id"),
|
|
134
|
-
score: r.get("score"),
|
|
135
|
-
properties: r.get("properties") ?? {},
|
|
136
|
-
}));
|
|
137
|
-
return { matchMode: items.length ? "semantic" : "none", items };
|
|
138
|
-
}
|
|
139
|
-
};
|
|
140
|
-
exports.ChatbotSearchService = ChatbotSearchService;
|
|
141
|
-
exports.ChatbotSearchService = ChatbotSearchService = ChatbotSearchService_1 = __decorate([
|
|
142
|
-
(0, common_1.Injectable)(),
|
|
143
|
-
__metadata("design:paramtypes", [neo4j_service_1.Neo4jService,
|
|
144
|
-
embedder_service_1.EmbedderService,
|
|
145
|
-
chatbot_index_manager_1.ChatbotIndexManager,
|
|
146
|
-
graph_catalog_service_1.GraphCatalogService])
|
|
147
|
-
], ChatbotSearchService);
|
|
148
|
-
//# sourceMappingURL=chatbot.search.service.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"chatbot.search.service.js","sourceRoot":"","sources":["../../../../src/agents/chatbot/services/chatbot.search.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,2CAAoD;AACpD,kFAA8E;AAC9E,8EAA0E;AAE1E,mEAA8D;AAC9D,mEAA8D;AAEjD,QAAA,yBAAyB,GAAG,EAAE,CAAC;AAC/B,QAAA,yBAAyB,GAAG,EAAE,CAAC;AAC/B,QAAA,4BAA4B,GAAG,CAAC,CAAC;AACjC,QAAA,2BAA2B,GAAG,EAAE,CAAC;AACjC,QAAA,0BAA0B,GAAG,GAAG,CAAC;AAC9C,MAAM,wBAAwB,GAAG,EAAE,CAAC;AAEpC,MAAM,kBAAkB,GAAG,2BAA2B,CAAC;AAqChD,IAAM,oBAAoB,4BAA1B,MAAM,oBAAoB;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