{"path":"NexusReader.Application/Abstractions/Services/IKnowledgeService.cs","purpose":"Defines the application-level abstraction for knowledge-related operations (semantic search, summarization, QA, groundedness checks, cache management) used by higher-level components.","classification":{"role":"service","layer":"application","confidence":0.9,"evidence":["Service naming pattern","Application/service path heuristic","Namespace includes Application.Abstractions.Services","Interface name IKnowledgeService and method signatures indicate a service contract for knowledge/AI features"]},"className":"IKnowledgeService","methods":[{"name":"GetKnowledgeAsync","line":8,"endLine":8,"signature":"(text: string, tenantId: string, ebookId: Guid? = null, cancellationToken: CancellationToken = default) -> Task>","purpose":"Return a KnowledgePacket for provided text scoped to a tenant and optional ebook.","calls":[],"actions":[]},{"name":"GetGraphDataAsync","line":9,"endLine":9,"signature":"(text: string, tenantId: string, ebookId: Guid? = null, cancellationToken: CancellationToken = default) -> Task>","purpose":"Produce graph-structured knowledge data for the given text and tenant context.","calls":[],"actions":[]},{"name":"GetKnowledgeMapAsync","line":10,"endLine":10,"signature":"(text: string, tenantId: string, ebookId: Guid? = null, cancellationToken: CancellationToken = default) -> Task>","purpose":"Generate a knowledge map (likely node/edge representation) for the supplied text and tenant.","calls":[],"actions":[]},{"name":"GetSummaryAndQuizAsync","line":11,"endLine":11,"signature":"(text: string, tenantId: string, ebookId: Guid? = null, cancellationToken: CancellationToken = default) -> Task>","purpose":"Create a summary and quiz (assessment) artifact for given text within tenant/ebook scope.","calls":[],"actions":[]},{"name":"GetRelevantContextAsync","line":12,"endLine":12,"signature":"(query: string, tenantId: string, cancellationToken: CancellationToken = default) -> Task>>","purpose":"Retrieve a list of relevant context snippets for a query within a tenant.","calls":[],"actions":[]},{"name":"VerifyGroundednessAsync","line":13,"endLine":13,"signature":"(answer: string, context: string, tenantId: string, cancellationToken: CancellationToken = default) -> Task>","purpose":"Evaluate whether an answer is grounded in provided context and return a score/rationale.","calls":[],"actions":[]},{"name":"SearchLibrarySemanticallyAsync","line":14,"endLine":14,"signature":"(queryText: string, tenantId: string, limit: int, cancellationToken: CancellationToken = default) -> Task>>","purpose":"Perform a semantic search over the library for a tenant and return top results up to a limit.","calls":[],"actions":[]},{"name":"AskQuestionAsync","line":15,"endLine":15,"signature":"(question: string, tenantId: string, ebookId: Guid? = null, limit: int = 5, cancellationToken: CancellationToken = default) -> Task>","purpose":"Ask a question against tenant (and optional ebook) data and return a grounded response, limited by passed limit.","calls":[],"actions":[]},{"name":"ClearCacheAsync","line":16,"endLine":16,"signature":"(cancellationToken: CancellationToken = default) -> Task","purpose":"Clear any service-level caches used by the knowledge subsystem.","calls":[],"actions":[]}],"types":[{"name":"GroundednessResult","kind":"dto","line":19,"purpose":"Represents the outcome of a groundedness check with score, rationale, and boolean flag.","fields":[{"name":"Score","type":"float","required":true,"line":19,"description":"Numeric groundedness score"},{"name":"Rationale","type":"string","required":true,"line":19,"description":"Textual explanation of the score"},{"name":"IsGrounded","type":"bool","required":true,"line":19,"description":"Whether the answer is considered grounded"}]}],"serviceRegistrations":[],"startupActions":[],"dependencies":["FluentResults","NexusReader.Application.DTOs.AI"],"patterns":["Service Interface","DTO"],"domainConcepts":["Knowledge","Groundedness","Semantic Search","QA/Answering"],"keyDetails":"Application-level abstraction returning FluentResults-wrapped DTOs (KnowledgePacket, GroundedResponseDto, SemanticSearchResultDto). No runtime logic in this file; it defines contracts for knowledge-related orchestration implemented elsewhere.","orchestrationMethods":[],"typedContracts":[{"name":"GroundednessResult","kind":"dto","line":19,"fieldCount":3,"evidencePaths":["NexusReader.Application/Abstractions/Services/IKnowledgeService.cs"]}],"persistenceInteractions":[],"externalInteractions":[],"evidenceAnchors":[{"kind":"typed-contract","label":"GroundednessResult","line":19,"summary":"dto with 3 fields.","confidence":0.8,"evidencePaths":["NexusReader.Application/Abstractions/Services/IKnowledgeService.cs"]}],"cacheMetadata":{"schemaVersion":2,"analysisVersion":"2026-05-23.cache-v1","contentChecksum":"bff51cfba7d52bd6fb72629eb9de5060052e02bb5d23233fadddc2c70feb8a4d","sourceByteSize":1604,"analyzedAt":"2026-05-23T16:16:39.285Z","technology":"dotnet"}}