import { OnModuleInit } from "@nestjs/common"; import { ClsService } from "nestjs-cls"; import { AgentScopeFilterService } from "../../../common/repositories/agent-scope.filter"; import { AiSourceQueryProvider } from "../../../common/repositories/ai-source-query.provider"; import { DataLimits } from "../../../common/types/data.limits"; import { EmbedderAttribution, EmbedderService, ModelService } from "../../../core"; import { Neo4jService } from "../../../core/neo4j/services/neo4j.service"; import { SecurityService } from "../../../core/security/services/security.service"; import { KeyConcept } from "../../keyconcept/entities/key.concept.entity"; export declare class KeyConceptRepository implements OnModuleInit { private readonly neo4j; private readonly embedderService; private readonly modelService; private readonly securityService; private readonly clsService; private readonly aiSourceQuery; private readonly agentScope; constructor(neo4j: Neo4jService, embedderService: EmbedderService, modelService: ModelService, securityService: SecurityService, clsService: ClsService, aiSourceQuery: AiSourceQueryProvider, agentScope: AgentScopeFilterService); onModuleInit(): Promise; recreateVectorIndex(): Promise; findAllKeyConcepts(): Promise; updateEmbedding(params: { keyConceptId: string; embedding: number[]; }): Promise; findNeighboursByKeyConcepts(params: { keyConcepts: string[]; dataLimits: DataLimits; }): Promise; /** * `attribution` is OPTIONAL and opt-in: this is a QUERY-time embedding, so * the repository has no entity of its own to bill it to — the retrieval scope * lives with the caller (see `findPotentialChunks` for the same rationale). */ findPotentialKeyConcepts(params: { question: string; dataLimits: DataLimits; attribution?: EmbedderAttribution; /** See `findPotentialChunks`. */ queryEmbedding?: number[]; }): Promise; deleteDisconnectedKeyConcepts(): Promise; findKeyConceptByValue(params: { keyConceptValue: string; }): Promise; findKeyConceptsByValues(params: { keyConceptValues: string[]; }): Promise; /** * `attribution` is OPTIONAL. ONE usage record covers the whole batch, and * that is honest here: every value in it was extracted from a SINGLE chunk of * a SINGLE entity during that entity's ingestion (`ChunkService.generateGraph`), * so one entity caused the whole cost. KeyConcept nodes are globally * de-duplicated by `MERGE (keyconcept:KeyConcept {value})` and are therefore * not owned by that entity — billing follows who INCURRED the spend, not who * ends up sharing the node. */ createOrphanKeyConcepts(params: { keyConceptValues: string[]; attribution?: EmbedderAttribution; }): Promise; /** * Update descriptions for existing KeyConcepts (only if they don't have a description yet) * This preserves existing descriptions and only adds new ones */ updateKeyConceptDescriptions(params: { descriptions: { keyConcept: string; description: string; }[]; }): Promise; /** * `attribution` is OPTIONAL and threaded down from `ChunkService.generateGraph` * — the entity whose ingestion produced this atomic fact. Deriving it locally * from `atomicFactId` was rejected: an `AtomicFact` is an internal graph node * with no owner, so a `USED_FOR` edge to it tells a cost report nothing about * which entity the spend belongs to. */ createKeyConcept(params: { keyConceptValue: string; atomicFactId: string; attribution?: EmbedderAttribution; }): Promise; createKeyConceptRelation(params: { keyConceptValue: string; atomicFactId: string; }): Promise; createOrUpdateKeyConceptRelationships(params: { companyId?: string; chunkId: string; relationships: { keyConcept1: string; keyConcept2: string; relationship: string; }[]; }): Promise; resizeKeyConceptRelationshipsWeightOnChunkDeletion(params: { chunkId: string; }): Promise; } //# sourceMappingURL=keyconcept.repository.d.ts.map