import { OnModuleInit } from "@nestjs/common"; import { ConfigService } from "@nestjs/config"; import { BaseConfigInterface } from "../../../config/interfaces"; import { WebSocketService } from "../../../core/websocket/services/websocket.service"; import { LLMService } from "../../../core/llm/services/llm.service"; import { GraphCatalogService } from "../../graph/services/graph.catalog.service"; import { ToolFactory } from "../../graph/tools/tool.factory"; import { ResolveEntityTool } from "../../graph/tools/resolve-entity.tool"; import { DescribeEntityTool } from "../../graph/tools/describe-entity.tool"; import { SearchEntitiesTool } from "../../graph/tools/search-entities.tool"; import { ReadEntityTool } from "../../graph/tools/read-entity.tool"; import { TraverseTool } from "../../graph/tools/traverse.tool"; import { ResponderContextState } from "../contexts/responder.context"; export declare const MAX_TOOL_ITERATIONS = 15; export declare const GRAPH_NODE_WALL_CLOCK_MS = 60000; export declare const RETRY_INSTRUCTION = "Your previous attempt did not call any tools. You cannot answer a question about this system's data without first looking it up.\n\nYou must call at least one tool BEFORE producing a final answer. For a question that names an entity (a person, a place, an organisation, a project \u2014 anything that could correspond to a record in the graph), the first tool call is always:\n\n resolve_entity({ text: \"\" })\n\nInspect the returned candidates, pick a type, then call describe_entity and proceed with the typed tools (read_entity, search_entities, traverse) until you have the data the answer needs. Do not respond with prose alone \u2014 call the tool now."; export declare const TRAVERSAL_RETRY_INSTRUCTION = "Your previous attempt answered without a single successful traverse call. A record's own fields describe it as it was when the record was written; what has happened to it since lives on the records that reference it, and those are reachable only by walking a relationship.\n\nDecide which case this question is:\n- If it asks what a record IS and that record's own fields fully answer it, return your answer unchanged.\n- Otherwise, call describe_entity on the subject's type if you have not already, pick the relationships that lead to the records referencing it, call traverse along each, read what comes back, and rebuild your answer from those records.\n\nDo not return the previous answer unchanged unless the first case truly applies."; export declare class GraphNodeService implements OnModuleInit { private readonly llm; private readonly graph; private readonly factory; private readonly resolveTool; private readonly describeTool; private readonly searchTool; private readonly readTool; private readonly traverseTool; private readonly configService; private readonly ws?; private readonly logger; private readonly domain?; private readonly graphTuning?; constructor(llm: LLMService, graph: GraphCatalogService, factory: ToolFactory, resolveTool: ResolveEntityTool, describeTool: DescribeEntityTool, searchTool: SearchEntitiesTool, readTool: ReadEntityTool, traverseTool: TraverseTool, configService: ConfigService, ws?: WebSocketService); onModuleInit(): void; execute(params: { state: ResponderContextState; }): Promise>; private traceFromOutput; /** * Cost attribution for EVERY llm.call this node makes. The retries below the * first pass are billed by the provider exactly like the first one, so each * carries the same attribution. */ private attribution; private buildMetadata; } //# sourceMappingURL=graph.node.service.d.ts.map