# WasmKnowledgeService

- File ID: file:1ufa6nr:wasmknowledgeservice-cs
- Path: NexusReader.Web.Client/Services/WasmKnowledgeService.cs
- Role: integration-client
- Layer: infrastructure

## Purpose

Blazor WebAssembly client implementation of IKnowledgeService that calls backend /api/knowledge endpoints to provide semantic search, QA, summaries, maps, and cache operations.

## Key Details

Client-side WASM integration that centralizes all /api/knowledge interactions; uses a generic CallKnowledgeApiAsync helper for several endpoints and includes consistent HTTP-success/error handling and exception wrapping into FluentResults.

## Symbols

- WasmKnowledgeService: Blazor WebAssembly client implementation of IKnowledgeService that calls backend /api/knowledge endpoints to provide semantic search, QA, summaries, maps, and cache operations.
- WasmKnowledgeService(): Constructs the service and stores an HttpClient for API calls.
- GetKnowledgeAsync(): Requests a general knowledge packet from the backend for the provided text and optional ebookId.
- GetGraphDataAsync(): Requests graph-form knowledge data from backend.
- GetKnowledgeMapAsync(): Requests a knowledge map from the backend.
- GetSummaryAndQuizAsync(): Requests summary and quiz content for given text from the backend.
- GetRelevantContextAsync(): Posts a query to backend to retrieve a list of relevant contexts (semantic retrieval).
- VerifyGroundednessAsync(): Sends answer+context to backend to verify groundedness and returns structured result.
- SearchLibrarySemanticallyAsync(): Performs semantic search against the library via backend endpoint and returns result list.
- AskQuestionAsync(): Sends a question to the backend QA endpoint and returns a grounded response DTO.
- CallKnowledgeApiAsync(): Generic helper that POSTs text to a given endpoint and deserializes a KnowledgePacket, handling HTTP errors and exceptions.
- ClearCacheAsync(): Requests the server to clear the knowledge cache via DELETE /api/knowledge and logs simple console messages.

## Dependencies

- No resolved dependencies.

## Calls

- No resolved calls.

## Unresolved References

- dependency-target: NexusReader.Application.Abstractions.Services (IKnowledgeService)
- dependency-target: NexusReader.Application.DTOs.AI (KnowledgePacket, RelevantContext, GroundednessResult, SemanticSearchResultDto, GroundedResponseDto)
- call-target: self
- call-target: self
- call-target: self
- call-target: self
- interaction-target: return context != null ? Result.Ok(context) : Result.Fail("Failed to deserialize relevant context.");
- interaction-target: Sends payload { query, tenantId } via HttpClient.PostAsJsonAsync
- interaction-target: Sends payload { answer, context, tenantId } via HttpClient.PostAsJsonAsync
- interaction-target: Sends payload { queryText, tenantId, limit } via HttpClient.PostAsJsonAsync
- interaction-target: Sends payload { question, tenantId, ebookId, limit } via HttpClient.PostAsJsonAsync
- interaction-target: HttpClient.PostAsJsonAsync(endpoint, new { text, ebookId })
- interaction-target: HttpClient.DeleteAsync("/api/knowledge")

## Coverage

- Symbols: 12
- Executable symbols: 11
- Executable symbols with control flow: 11
- Grounded edges: 12
- Unresolved references: 13
- Control-flow fragments: 11
- Unresolved jumps: 0
- Unsupported constructs: 0
- Control-flow coverage: 100%
- Required diagrams: 2
- Generated diagrams: 8

## Control Flow Fragments

- WasmKnowledgeService: 3 nodes, 2 edges, 0 jumps, 0 unsupported constructs
- GetKnowledgeAsync: 7 nodes, 6 edges, 1 jumps, 0 unsupported constructs
- GetGraphDataAsync: 6 nodes, 5 edges, 1 jumps, 0 unsupported constructs
- GetKnowledgeMapAsync: 6 nodes, 5 edges, 1 jumps, 0 unsupported constructs
- GetSummaryAndQuizAsync: 6 nodes, 5 edges, 1 jumps, 0 unsupported constructs
- GetRelevantContextAsync: 26 nodes, 28 edges, 0 jumps, 0 unsupported constructs
- VerifyGroundednessAsync: 25 nodes, 27 edges, 0 jumps, 0 unsupported constructs
- SearchLibrarySemanticallyAsync: 25 nodes, 27 edges, 0 jumps, 0 unsupported constructs
- AskQuestionAsync: 25 nodes, 27 edges, 0 jumps, 0 unsupported constructs
- CallKnowledgeApiAsync: 25 nodes, 27 edges, 0 jumps, 0 unsupported constructs
- ClearCacheAsync: 21 nodes, 22 edges, 0 jumps, 0 unsupported constructs

## Diagrams

### WasmKnowledgeService Neighborhood

_Warnings: diagram file_1ufa6nr_wasmknowledgeservice_cs_neighborhood_view exceeds preferred complexity thresholds (13 nodes, 0 edges)._

```mermaid
---
config:
  flowchart:
    defaultRenderer: "elk"
---
flowchart LR
    class_rcx5lg_wasmknowledgeservice("WasmKnowledgeService")
    file_1ufa6nr_wasmknowledgeservice_cs("WasmKnowledgeService")
    method_1ca58m3_getrelevantcontextasync[["GetRelevantContextAsync()"]]
    method_1jw3y39_getknowledgeasync[["GetKnowledgeAsync()"]]
    method_1k4gp5_wasmknowledgeservice[["WasmKnowledgeService()"]]
    method_1ol1cx2_verifygroundednessasync[["VerifyGroundednessAsync()"]]
    method_1oz3km6_getsummaryandquizasync[["GetSummaryAndQuizAsync()"]]
    method_1sn20bf_searchlibrarysemanticallyasync[["SearchLibrarySemanticallyAsync()"]]
    method_1wz04qu_clearcacheasync[["ClearCacheAsync()"]]
    method_3dd3av_callknowledgeapiasync[["CallKnowledgeApiAsync()"]]
    method_jffhoh_askquestionasync[["AskQuestionAsync()"]]
    method_jq1xnu_getknowledgemapasync[["GetKnowledgeMapAsync()"]]
    method_wcjzgl_getgraphdataasync[["GetGraphDataAsync()"]]
```

### WasmKnowledgeService Execution Overview

_Warnings: diagram file_1ufa6nr_wasmknowledgeservice_cs_execution_view exceeds preferred complexity thresholds (23 nodes, 22 edges)._

```mermaid
---
config:
  flowchart:
    defaultRenderer: "elk"
---
flowchart TD
    class_rcx5lg_wasmknowledgeservice("WasmKnowledgeService")
    method_1ca58m3_getrelevantcontextasync[["GetRelevantContextAsync()"]]
    method_1jw3y39_getknowledgeasync[["GetKnowledgeAsync()"]]
    method_1k4gp5_wasmknowledgeservice[["WasmKnowledgeService()"]]
    method_1ol1cx2_verifygroundednessasync[["VerifyGroundednessAsync()"]]
    method_1oz3km6_getsummaryandquizasync[["GetSummaryAndQuizAsync()"]]
    method_1sn20bf_searchlibrarysemanticallyasync[["SearchLibrarySemanticallyAsync()"]]
    method_1wz04qu_clearcacheasync[["ClearCacheAsync()"]]
    method_3dd3av_callknowledgeapiasync[["CallKnowledgeApiAsync()"]]
    method_jffhoh_askquestionasync[["AskQuestionAsync()"]]
    method_jq1xnu_getknowledgemapasync[["GetKnowledgeMapAsync()"]]
    method_wcjzgl_getgraphdataasync[["GetGraphDataAsync()"]]
    unresolved_unresolved_10doift_call_target{"Unresolved: CallKnowledgeApiAsync"}
    unresolved_unresolved_1aomd4t_call_target{"Unresolved: CallKnowledgeApiAsync"}
    unresolved_unresolved_1f3wgbt_interaction_target{"Unresolved: Sends payload { answer, context, tenantId } via HttpClient.PostAsJsonAsync"}
    unresolved_unresolved_1flrr8g_interaction_target{"Unresolved: Sends payload { queryText, tenantId, limit } via HttpClient.PostAsJsonAsync"}
    unresolved_unresolved_1h8ov95_call_target{"Unresolved: CallKnowledgeApiAsync"}
    unresolved_unresolved_1keqoem_interaction_target{"Unresolved: HttpClient.DeleteAsync(\\"/api/knowledge\\")"}
    unresolved_unresolved_1ley46_interaction_target{"Unresolved: Sends payload { query, tenantId } via HttpClient.PostAsJsonAsync"}
    unresolved_unresolved_1y8e7le_interaction_target{"Unresolved: Sends payload { question, tenantId, ebookId, limit } via HttpClient.PostAsJsonAsync"}
    unresolved_unresolved_2a4zw_interaction_target{"Unresolved: HttpClient.PostAsJsonAsync(endpoint, new { text, ebookId })"}
    unresolved_unresolved_9z33f5_interaction_target{"Unresolved: return context != null ? Result.Ok(context) : Result.Fail(\\"Failed to deserialize relevant context.\\");"}
    unresolved_unresolved_yqmhny_call_target{"Unresolved: CallKnowledgeApiAsync"}
    class_rcx5lg_wasmknowledgeservice -->|contains| method_1ca58m3_getrelevantcontextasync
    class_rcx5lg_wasmknowledgeservice -->|contains| method_1jw3y39_getknowledgeasync
    class_rcx5lg_wasmknowledgeservice -->|contains| method_1k4gp5_wasmknowledgeservice
    class_rcx5lg_wasmknowledgeservice -->|contains| method_1ol1cx2_verifygroundednessasync
    class_rcx5lg_wasmknowledgeservice -->|contains| method_1oz3km6_getsummaryandquizasync
    class_rcx5lg_wasmknowledgeservice -->|contains| method_1sn20bf_searchlibrarysemanticallyasync
    class_rcx5lg_wasmknowledgeservice -->|contains| method_1wz04qu_clearcacheasync
    class_rcx5lg_wasmknowledgeservice -->|contains| method_3dd3av_callknowledgeapiasync
    class_rcx5lg_wasmknowledgeservice -->|contains| method_jffhoh_askquestionasync
    class_rcx5lg_wasmknowledgeservice -->|contains| method_jq1xnu_getknowledgemapasync
    class_rcx5lg_wasmknowledgeservice -->|contains| method_wcjzgl_getgraphdataasync
    class_rcx5lg_wasmknowledgeservice -->|unresolved interaction| unresolved_unresolved_1f3wgbt_interaction_target
    class_rcx5lg_wasmknowledgeservice -->|unresolved interaction| unresolved_unresolved_1flrr8g_interaction_target
    class_rcx5lg_wasmknowledgeservice -->|unresolved interaction| unresolved_unresolved_1keqoem_interaction_target
    class_rcx5lg_wasmknowledgeservice -->|unresolved interaction| unresolved_unresolved_1ley46_interaction_target
    class_rcx5lg_wasmknowledgeservice -->|unresolved interaction| unresolved_unresolved_1y8e7le_interaction_target
    class_rcx5lg_wasmknowledgeservice -->|unresolved interaction| unresolved_unresolved_2a4zw_interaction_target
    class_rcx5lg_wasmknowledgeservice -->|unresolved interaction| unresolved_unresolved_9z33f5_interaction_target
    method_1jw3y39_getknowledgeasync -->|unresolved call| unresolved_unresolved_yqmhny_call_target
    method_1oz3km6_getsummaryandquizasync -->|unresolved call| unresolved_unresolved_1h8ov95_call_target
    method_jq1xnu_getknowledgemapasync -->|unresolved call| unresolved_unresolved_1aomd4t_call_target
    method_wcjzgl_getgraphdataasync -->|unresolved call| unresolved_unresolved_10doift_call_target
```

### GetRelevantContextAsync() Control Flow

_Warnings: diagram method_1ca58m3_getrelevantcontextasync__fragment_diagram exceeds preferred complexity thresholds (26 nodes, 28 edges)._

```mermaid
---
config:
  flowchart:
    defaultRenderer: "elk"
---
flowchart TD
    method_1ca58m3_getrelevantcontextasync__action_39_getrelevantcontextasync_try_39_0__try("Begins protected execution")
    method_1ca58m3_getrelevantcontextasync__action_39_try_catch_39__linear("Network exception handling")
    method_1ca58m3_getrelevantcontextasync__action_41_getrelevantcontextasync_await_41_1__await[["Waits for async work"]]
    method_1ca58m3_getrelevantcontextasync__action_42_branch_42__condition{"response.IsSuccessStatusCode"}
    method_1ca58m3_getrelevantcontextasync__action_42_branch_42__false("failure -> read error and fail")
    method_1ca58m3_getrelevantcontextasync__action_42_branch_42__merge("merge")
    method_1ca58m3_getrelevantcontextasync__action_42_branch_42__true("success -> deserialize")
    method_1ca58m3_getrelevantcontextasync__action_42_getrelevantcontextasync_branch_42_2__condition{"response.IsSuccessStatusCode"}
    method_1ca58m3_getrelevantcontextasync__action_42_getrelevantcontextasync_branch_42_2__false("false")
    method_1ca58m3_getrelevantcontextasync__action_42_getrelevantcontextasync_branch_42_2__merge("merge")
    method_1ca58m3_getrelevantcontextasync__action_42_getrelevantcontextasync_branch_42_2__true("true")
    method_1ca58m3_getrelevantcontextasync__action_44_deserialize_44__linear("Read List<RelevantContext>")
    method_1ca58m3_getrelevantcontextasync__action_44_getrelevantcontextasync_await_44_3__await[["Waits for async work"]]
    method_1ca58m3_getrelevantcontextasync__action_45_guard_clause_45__condition{"context == null"}
    method_1ca58m3_getrelevantcontextasync__action_45_guard_clause_45__false("ok")
    method_1ca58m3_getrelevantcontextasync__action_45_guard_clause_45__merge("merge")
    method_1ca58m3_getrelevantcontextasync__action_45_guard_clause_45__true("fail")
    method_1ca58m3_getrelevantcontextasync__action_48_error_path_48__linear("Server error handling")
    method_1ca58m3_getrelevantcontextasync__action_48_getrelevantcontextasync_await_48_6__await[["Waits for async work"]]
    method_1ca58m3_getrelevantcontextasync__action_51_getrelevantcontextasync_catch_51_8__catch("catch Exception ex")
    method_1ca58m3_getrelevantcontextasync__entry(["GetRelevantContextAsync entry"])
    method_1ca58m3_getrelevantcontextasync__action_41_external_call_41__linear("POST /api/knowledge/relevant")
    method_1ca58m3_getrelevantcontextasync__action_45_getrelevantcontextasync_repository_read_45_4__linear[("Reads repository or persistence state")]
    method_1ca58m3_getrelevantcontextasync__action_45_getrelevantcontextasync_return_45_5__return(["Returns result"])
    method_1ca58m3_getrelevantcontextasync__action_49_getrelevantcontextasync_return_49_7__return(["Returns result"])
    method_1ca58m3_getrelevantcontextasync__action_53_getrelevantcontextasync_return_53_9__return(["Returns result"])
    method_1ca58m3_getrelevantcontextasync__action_39_getrelevantcontextasync_try_39_0__try -->|next| method_1ca58m3_getrelevantcontextasync__action_41_getrelevantcontextasync_await_41_1__await
    method_1ca58m3_getrelevantcontextasync__action_39_try_catch_39__linear -->|next| method_1ca58m3_getrelevantcontextasync__action_39_getrelevantcontextasync_try_39_0__try
    method_1ca58m3_getrelevantcontextasync__action_41_external_call_41__linear -->|next| method_1ca58m3_getrelevantcontextasync__action_42_getrelevantcontextasync_branch_42_2__condition
    method_1ca58m3_getrelevantcontextasync__action_41_getrelevantcontextasync_await_41_1__await -->|next| method_1ca58m3_getrelevantcontextasync__action_41_external_call_41__linear
    method_1ca58m3_getrelevantcontextasync__action_42_branch_42__condition -->|failure -> read error and fail| method_1ca58m3_getrelevantcontextasync__action_42_branch_42__false
    method_1ca58m3_getrelevantcontextasync__action_42_branch_42__condition -->|success -> deserialize| method_1ca58m3_getrelevantcontextasync__action_42_branch_42__true
    method_1ca58m3_getrelevantcontextasync__action_42_branch_42__false -->|next| method_1ca58m3_getrelevantcontextasync__action_42_branch_42__merge
    method_1ca58m3_getrelevantcontextasync__action_42_branch_42__merge -->|next| method_1ca58m3_getrelevantcontextasync__action_44_getrelevantcontextasync_await_44_3__await
    method_1ca58m3_getrelevantcontextasync__action_42_branch_42__true -->|next| method_1ca58m3_getrelevantcontextasync__action_42_branch_42__merge
    method_1ca58m3_getrelevantcontextasync__action_42_getrelevantcontextasync_branch_42_2__condition -->|false| method_1ca58m3_getrelevantcontextasync__action_42_getrelevantcontextasync_branch_42_2__false
    method_1ca58m3_getrelevantcontextasync__action_42_getrelevantcontextasync_branch_42_2__condition -->|true| method_1ca58m3_getrelevantcontextasync__action_42_getrelevantcontextasync_branch_42_2__true
    method_1ca58m3_getrelevantcontextasync__action_42_getrelevantcontextasync_branch_42_2__false -->|next| method_1ca58m3_getrelevantcontextasync__action_42_getrelevantcontextasync_branch_42_2__merge
    method_1ca58m3_getrelevantcontextasync__action_42_getrelevantcontextasync_branch_42_2__merge -->|next| method_1ca58m3_getrelevantcontextasync__action_42_branch_42__condition
    method_1ca58m3_getrelevantcontextasync__action_42_getrelevantcontextasync_branch_42_2__true -->|next| method_1ca58m3_getrelevantcontextasync__action_42_getrelevantcontextasync_branch_42_2__merge
    method_1ca58m3_getrelevantcontextasync__action_44_deserialize_44__linear -->|return| method_1ca58m3_getrelevantcontextasync__action_45_getrelevantcontextasync_return_45_5__return
    method_1ca58m3_getrelevantcontextasync__action_44_getrelevantcontextasync_await_44_3__await -->|next| method_1ca58m3_getrelevantcontextasync__action_44_deserialize_44__linear
    method_1ca58m3_getrelevantcontextasync__action_45_getrelevantcontextasync_repository_read_45_4__linear -->|next| method_1ca58m3_getrelevantcontextasync__action_45_guard_clause_45__condition
    method_1ca58m3_getrelevantcontextasync__action_45_getrelevantcontextasync_return_45_5__return -->|next| method_1ca58m3_getrelevantcontextasync__action_45_getrelevantcontextasync_repository_read_45_4__linear
    method_1ca58m3_getrelevantcontextasync__action_45_guard_clause_45__condition -->|ok| method_1ca58m3_getrelevantcontextasync__action_45_guard_clause_45__false
    method_1ca58m3_getrelevantcontextasync__action_45_guard_clause_45__condition -->|fail| method_1ca58m3_getrelevantcontextasync__action_45_guard_clause_45__true
    method_1ca58m3_getrelevantcontextasync__action_45_guard_clause_45__false -->|next| method_1ca58m3_getrelevantcontextasync__action_45_guard_clause_45__merge
    method_1ca58m3_getrelevantcontextasync__action_45_guard_clause_45__merge -->|next| method_1ca58m3_getrelevantcontextasync__action_48_getrelevantcontextasync_await_48_6__await
    method_1ca58m3_getrelevantcontextasync__action_45_guard_clause_45__true -->|next| method_1ca58m3_getrelevantcontextasync__action_45_guard_clause_45__merge
    method_1ca58m3_getrelevantcontextasync__action_48_error_path_48__linear -->|return| method_1ca58m3_getrelevantcontextasync__action_49_getrelevantcontextasync_return_49_7__return
    method_1ca58m3_getrelevantcontextasync__action_48_getrelevantcontextasync_await_48_6__await -->|next| method_1ca58m3_getrelevantcontextasync__action_48_error_path_48__linear
    method_1ca58m3_getrelevantcontextasync__action_49_getrelevantcontextasync_return_49_7__return -->|exception| method_1ca58m3_getrelevantcontextasync__action_51_getrelevantcontextasync_catch_51_8__catch
    method_1ca58m3_getrelevantcontextasync__action_51_getrelevantcontextasync_catch_51_8__catch -->|return| method_1ca58m3_getrelevantcontextasync__action_53_getrelevantcontextasync_return_53_9__return
    method_1ca58m3_getrelevantcontextasync__entry -->|next| method_1ca58m3_getrelevantcontextasync__action_39_try_catch_39__linear
```

### VerifyGroundednessAsync() Control Flow

_Warnings: diagram method_1ol1cx2_verifygroundednessasync__fragment_diagram exceeds preferred complexity thresholds (25 nodes, 27 edges)._

```mermaid
---
config:
  flowchart:
    defaultRenderer: "elk"
---
flowchart TD
    method_1ol1cx2_verifygroundednessasync__action_58_try_catch_58__linear("Network exception handling")
    method_1ol1cx2_verifygroundednessasync__action_58_verifygroundednessasync_try_58_0__try("Begins protected execution")
    method_1ol1cx2_verifygroundednessasync__action_60_verifygroundednessasync_await_60_1__await[["Waits for async work"]]
    method_1ol1cx2_verifygroundednessasync__action_61_branch_61__condition{"response.IsSuccessStatusCode"}
    method_1ol1cx2_verifygroundednessasync__action_61_branch_61__false("failure -> read error and fail")
    method_1ol1cx2_verifygroundednessasync__action_61_branch_61__merge("merge")
    method_1ol1cx2_verifygroundednessasync__action_61_branch_61__true("success -> deserialize")
    method_1ol1cx2_verifygroundednessasync__action_61_verifygroundednessasync_branch_61_2__condition{"response.IsSuccessStatusCode"}
    method_1ol1cx2_verifygroundednessasync__action_61_verifygroundednessasync_branch_61_2__false("false")
    method_1ol1cx2_verifygroundednessasync__action_61_verifygroundednessasync_branch_61_2__merge("merge")
    method_1ol1cx2_verifygroundednessasync__action_61_verifygroundednessasync_branch_61_2__true("true")
    method_1ol1cx2_verifygroundednessasync__action_63_deserialize_63__linear("Read GroundednessResult")
    method_1ol1cx2_verifygroundednessasync__action_63_verifygroundednessasync_await_63_3__await[["Waits for async work"]]
    method_1ol1cx2_verifygroundednessasync__action_64_guard_clause_64__condition{"result == null"}
    method_1ol1cx2_verifygroundednessasync__action_64_guard_clause_64__false("ok")
    method_1ol1cx2_verifygroundednessasync__action_64_guard_clause_64__merge("merge")
    method_1ol1cx2_verifygroundednessasync__action_64_guard_clause_64__true("fail")
    method_1ol1cx2_verifygroundednessasync__action_67_error_path_67__linear("Server error handling")
    method_1ol1cx2_verifygroundednessasync__action_67_verifygroundednessasync_await_67_5__await[["Waits for async work"]]
    method_1ol1cx2_verifygroundednessasync__action_70_verifygroundednessasync_catch_70_7__catch("catch Exception ex")
    method_1ol1cx2_verifygroundednessasync__entry(["VerifyGroundednessAsync entry"])
    method_1ol1cx2_verifygroundednessasync__action_60_external_call_60__linear("POST /api/knowledge/verify-groundedness")
    method_1ol1cx2_verifygroundednessasync__action_64_verifygroundednessasync_return_64_4__return(["Returns result"])
    method_1ol1cx2_verifygroundednessasync__action_68_verifygroundednessasync_return_68_6__return(["Returns result"])
    method_1ol1cx2_verifygroundednessasync__action_72_verifygroundednessasync_return_72_8__return(["Returns result"])
    method_1ol1cx2_verifygroundednessasync__action_58_try_catch_58__linear -->|next| method_1ol1cx2_verifygroundednessasync__action_58_verifygroundednessasync_try_58_0__try
    method_1ol1cx2_verifygroundednessasync__action_58_verifygroundednessasync_try_58_0__try -->|next| method_1ol1cx2_verifygroundednessasync__action_60_verifygroundednessasync_await_60_1__await
    method_1ol1cx2_verifygroundednessasync__action_60_external_call_60__linear -->|next| method_1ol1cx2_verifygroundednessasync__action_61_verifygroundednessasync_branch_61_2__condition
    method_1ol1cx2_verifygroundednessasync__action_60_verifygroundednessasync_await_60_1__await -->|next| method_1ol1cx2_verifygroundednessasync__action_60_external_call_60__linear
    method_1ol1cx2_verifygroundednessasync__action_61_branch_61__condition -->|failure -> read error and fail| method_1ol1cx2_verifygroundednessasync__action_61_branch_61__false
    method_1ol1cx2_verifygroundednessasync__action_61_branch_61__condition -->|success -> deserialize| method_1ol1cx2_verifygroundednessasync__action_61_branch_61__true
    method_1ol1cx2_verifygroundednessasync__action_61_branch_61__false -->|next| method_1ol1cx2_verifygroundednessasync__action_61_branch_61__merge
    method_1ol1cx2_verifygroundednessasync__action_61_branch_61__merge -->|next| method_1ol1cx2_verifygroundednessasync__action_63_verifygroundednessasync_await_63_3__await
    method_1ol1cx2_verifygroundednessasync__action_61_branch_61__true -->|next| method_1ol1cx2_verifygroundednessasync__action_61_branch_61__merge
    method_1ol1cx2_verifygroundednessasync__action_61_verifygroundednessasync_branch_61_2__condition -->|false| method_1ol1cx2_verifygroundednessasync__action_61_verifygroundednessasync_branch_61_2__false
    method_1ol1cx2_verifygroundednessasync__action_61_verifygroundednessasync_branch_61_2__condition -->|true| method_1ol1cx2_verifygroundednessasync__action_61_verifygroundednessasync_branch_61_2__true
    method_1ol1cx2_verifygroundednessasync__action_61_verifygroundednessasync_branch_61_2__false -->|next| method_1ol1cx2_verifygroundednessasync__action_61_verifygroundednessasync_branch_61_2__merge
    method_1ol1cx2_verifygroundednessasync__action_61_verifygroundednessasync_branch_61_2__merge -->|next| method_1ol1cx2_verifygroundednessasync__action_61_branch_61__condition
    method_1ol1cx2_verifygroundednessasync__action_61_verifygroundednessasync_branch_61_2__true -->|next| method_1ol1cx2_verifygroundednessasync__action_61_verifygroundednessasync_branch_61_2__merge
    method_1ol1cx2_verifygroundednessasync__action_63_deserialize_63__linear -->|return| method_1ol1cx2_verifygroundednessasync__action_64_verifygroundednessasync_return_64_4__return
    method_1ol1cx2_verifygroundednessasync__action_63_verifygroundednessasync_await_63_3__await -->|next| method_1ol1cx2_verifygroundednessasync__action_63_deserialize_63__linear
    method_1ol1cx2_verifygroundednessasync__action_64_guard_clause_64__condition -->|ok| method_1ol1cx2_verifygroundednessasync__action_64_guard_clause_64__false
    method_1ol1cx2_verifygroundednessasync__action_64_guard_clause_64__condition -->|fail| method_1ol1cx2_verifygroundednessasync__action_64_guard_clause_64__true
    method_1ol1cx2_verifygroundednessasync__action_64_guard_clause_64__false -->|next| method_1ol1cx2_verifygroundednessasync__action_64_guard_clause_64__merge
    method_1ol1cx2_verifygroundednessasync__action_64_guard_clause_64__merge -->|next| method_1ol1cx2_verifygroundednessasync__action_67_verifygroundednessasync_await_67_5__await
    method_1ol1cx2_verifygroundednessasync__action_64_guard_clause_64__true -->|next| method_1ol1cx2_verifygroundednessasync__action_64_guard_clause_64__merge
    method_1ol1cx2_verifygroundednessasync__action_64_verifygroundednessasync_return_64_4__return -->|next| method_1ol1cx2_verifygroundednessasync__action_64_guard_clause_64__condition
    method_1ol1cx2_verifygroundednessasync__action_67_error_path_67__linear -->|return| method_1ol1cx2_verifygroundednessasync__action_68_verifygroundednessasync_return_68_6__return
    method_1ol1cx2_verifygroundednessasync__action_67_verifygroundednessasync_await_67_5__await -->|next| method_1ol1cx2_verifygroundednessasync__action_67_error_path_67__linear
    method_1ol1cx2_verifygroundednessasync__action_68_verifygroundednessasync_return_68_6__return -->|exception| method_1ol1cx2_verifygroundednessasync__action_70_verifygroundednessasync_catch_70_7__catch
    method_1ol1cx2_verifygroundednessasync__action_70_verifygroundednessasync_catch_70_7__catch -->|return| method_1ol1cx2_verifygroundednessasync__action_72_verifygroundednessasync_return_72_8__return
    method_1ol1cx2_verifygroundednessasync__entry -->|next| method_1ol1cx2_verifygroundednessasync__action_58_try_catch_58__linear
```

### SearchLibrarySemanticallyAsync() Control Flow

_Warnings: diagram method_1sn20bf_searchlibrarysemanticallyasync__fragment_diagram exceeds preferred complexity thresholds (25 nodes, 27 edges)._

```mermaid
---
config:
  flowchart:
    defaultRenderer: "elk"
---
flowchart TD
    method_1sn20bf_searchlibrarysemanticallyasync__action_78_searchlibrarysemanticallyasync_try_78_0__try("Begins protected execution")
    method_1sn20bf_searchlibrarysemanticallyasync__action_78_try_catch_78__linear("Network exception handling")
    method_1sn20bf_searchlibrarysemanticallyasync__action_80_searchlibrarysemanticallyasync_await_80_1__await[["Waits for async work"]]
    method_1sn20bf_searchlibrarysemanticallyasync__action_81_branch_81__condition{"response.IsSuccessStatusCode"}
    method_1sn20bf_searchlibrarysemanticallyasync__action_81_branch_81__false("failure -> read error and fail")
    method_1sn20bf_searchlibrarysemanticallyasync__action_81_branch_81__merge("merge")
    method_1sn20bf_searchlibrarysemanticallyasync__action_81_branch_81__true("success -> deserialize or return empty list")
    method_1sn20bf_searchlibrarysemanticallyasync__action_81_searchlibrarysemanticallyasync_branch_81_2__condition{"response.IsSuccessStatusCode"}
    method_1sn20bf_searchlibrarysemanticallyasync__action_81_searchlibrarysemanticallyasync_branch_81_2__false("false")
    method_1sn20bf_searchlibrarysemanticallyasync__action_81_searchlibrarysemanticallyasync_branch_81_2__merge("merge")
    method_1sn20bf_searchlibrarysemanticallyasync__action_81_searchlibrarysemanticallyasync_branch_81_2__true("true")
    method_1sn20bf_searchlibrarysemanticallyasync__action_83_deserialize_83__linear("Read List<SemanticSearchResultDto>")
    method_1sn20bf_searchlibrarysemanticallyasync__action_83_searchlibrarysemanticallyasync_await_83_3__await[["Waits for async work"]]
    method_1sn20bf_searchlibrarysemanticallyasync__action_84_fallback_84__condition{"Return empty list on null deserialization"}
    method_1sn20bf_searchlibrarysemanticallyasync__action_84_fallback_84__false("false")
    method_1sn20bf_searchlibrarysemanticallyasync__action_84_fallback_84__merge("merge")
    method_1sn20bf_searchlibrarysemanticallyasync__action_84_fallback_84__true("true")
    method_1sn20bf_searchlibrarysemanticallyasync__action_87_error_path_87__linear("Server error handling")
    method_1sn20bf_searchlibrarysemanticallyasync__action_87_searchlibrarysemanticallyasync_await_87_5__await[["Waits for async work"]]
    method_1sn20bf_searchlibrarysemanticallyasync__action_90_searchlibrarysemanticallyasync_catch_90_7__catch("catch Exception ex")
    method_1sn20bf_searchlibrarysemanticallyasync__entry(["SearchLibrarySemanticallyAsync entry"])
    method_1sn20bf_searchlibrarysemanticallyasync__action_80_external_call_80__linear("POST /api/knowledge/search")
    method_1sn20bf_searchlibrarysemanticallyasync__action_84_searchlibrarysemanticallyasync_return_84_4__return(["Returns result"])
    method_1sn20bf_searchlibrarysemanticallyasync__action_88_searchlibrarysemanticallyasync_return_88_6__return(["Returns result"])
    method_1sn20bf_searchlibrarysemanticallyasync__action_92_searchlibrarysemanticallyasync_return_92_8__return(["Returns result"])
    method_1sn20bf_searchlibrarysemanticallyasync__action_78_searchlibrarysemanticallyasync_try_78_0__try -->|next| method_1sn20bf_searchlibrarysemanticallyasync__action_80_searchlibrarysemanticallyasync_await_80_1__await
    method_1sn20bf_searchlibrarysemanticallyasync__action_78_try_catch_78__linear -->|next| method_1sn20bf_searchlibrarysemanticallyasync__action_78_searchlibrarysemanticallyasync_try_78_0__try
    method_1sn20bf_searchlibrarysemanticallyasync__action_80_external_call_80__linear -->|next| method_1sn20bf_searchlibrarysemanticallyasync__action_81_searchlibrarysemanticallyasync_branch_81_2__condition
    method_1sn20bf_searchlibrarysemanticallyasync__action_80_searchlibrarysemanticallyasync_await_80_1__await -->|next| method_1sn20bf_searchlibrarysemanticallyasync__action_80_external_call_80__linear
    method_1sn20bf_searchlibrarysemanticallyasync__action_81_branch_81__condition -->|failure -> read error and fail| method_1sn20bf_searchlibrarysemanticallyasync__action_81_branch_81__false
    method_1sn20bf_searchlibrarysemanticallyasync__action_81_branch_81__condition -->|success -> deserialize or return empty list| method_1sn20bf_searchlibrarysemanticallyasync__action_81_branch_81__true
    method_1sn20bf_searchlibrarysemanticallyasync__action_81_branch_81__false -->|next| method_1sn20bf_searchlibrarysemanticallyasync__action_81_branch_81__merge
    method_1sn20bf_searchlibrarysemanticallyasync__action_81_branch_81__merge -->|next| method_1sn20bf_searchlibrarysemanticallyasync__action_83_searchlibrarysemanticallyasync_await_83_3__await
    method_1sn20bf_searchlibrarysemanticallyasync__action_81_branch_81__true -->|next| method_1sn20bf_searchlibrarysemanticallyasync__action_81_branch_81__merge
    method_1sn20bf_searchlibrarysemanticallyasync__action_81_searchlibrarysemanticallyasync_branch_81_2__condition -->|false| method_1sn20bf_searchlibrarysemanticallyasync__action_81_searchlibrarysemanticallyasync_branch_81_2__false
    method_1sn20bf_searchlibrarysemanticallyasync__action_81_searchlibrarysemanticallyasync_branch_81_2__condition -->|true| method_1sn20bf_searchlibrarysemanticallyasync__action_81_searchlibrarysemanticallyasync_branch_81_2__true
    method_1sn20bf_searchlibrarysemanticallyasync__action_81_searchlibrarysemanticallyasync_branch_81_2__false -->|next| method_1sn20bf_searchlibrarysemanticallyasync__action_81_searchlibrarysemanticallyasync_branch_81_2__merge
    method_1sn20bf_searchlibrarysemanticallyasync__action_81_searchlibrarysemanticallyasync_branch_81_2__merge -->|next| method_1sn20bf_searchlibrarysemanticallyasync__action_81_branch_81__condition
    method_1sn20bf_searchlibrarysemanticallyasync__action_81_searchlibrarysemanticallyasync_branch_81_2__true -->|next| method_1sn20bf_searchlibrarysemanticallyasync__action_81_searchlibrarysemanticallyasync_branch_81_2__merge
    method_1sn20bf_searchlibrarysemanticallyasync__action_83_deserialize_83__linear -->|return| method_1sn20bf_searchlibrarysemanticallyasync__action_84_searchlibrarysemanticallyasync_return_84_4__return
    method_1sn20bf_searchlibrarysemanticallyasync__action_83_searchlibrarysemanticallyasync_await_83_3__await -->|next| method_1sn20bf_searchlibrarysemanticallyasync__action_83_deserialize_83__linear
    method_1sn20bf_searchlibrarysemanticallyasync__action_84_fallback_84__condition -->|false| method_1sn20bf_searchlibrarysemanticallyasync__action_84_fallback_84__false
    method_1sn20bf_searchlibrarysemanticallyasync__action_84_fallback_84__condition -->|true| method_1sn20bf_searchlibrarysemanticallyasync__action_84_fallback_84__true
    method_1sn20bf_searchlibrarysemanticallyasync__action_84_fallback_84__false -->|next| method_1sn20bf_searchlibrarysemanticallyasync__action_84_fallback_84__merge
    method_1sn20bf_searchlibrarysemanticallyasync__action_84_fallback_84__merge -->|next| method_1sn20bf_searchlibrarysemanticallyasync__action_87_searchlibrarysemanticallyasync_await_87_5__await
    method_1sn20bf_searchlibrarysemanticallyasync__action_84_fallback_84__true -->|next| method_1sn20bf_searchlibrarysemanticallyasync__action_84_fallback_84__merge
    method_1sn20bf_searchlibrarysemanticallyasync__action_84_searchlibrarysemanticallyasync_return_84_4__return -->|fallback| method_1sn20bf_searchlibrarysemanticallyasync__action_84_fallback_84__condition
    method_1sn20bf_searchlibrarysemanticallyasync__action_87_error_path_87__linear -->|return| method_1sn20bf_searchlibrarysemanticallyasync__action_88_searchlibrarysemanticallyasync_return_88_6__return
    method_1sn20bf_searchlibrarysemanticallyasync__action_87_searchlibrarysemanticallyasync_await_87_5__await -->|next| method_1sn20bf_searchlibrarysemanticallyasync__action_87_error_path_87__linear
    method_1sn20bf_searchlibrarysemanticallyasync__action_88_searchlibrarysemanticallyasync_return_88_6__return -->|exception| method_1sn20bf_searchlibrarysemanticallyasync__action_90_searchlibrarysemanticallyasync_catch_90_7__catch
    method_1sn20bf_searchlibrarysemanticallyasync__action_90_searchlibrarysemanticallyasync_catch_90_7__catch -->|return| method_1sn20bf_searchlibrarysemanticallyasync__action_92_searchlibrarysemanticallyasync_return_92_8__return
    method_1sn20bf_searchlibrarysemanticallyasync__entry -->|next| method_1sn20bf_searchlibrarysemanticallyasync__action_78_try_catch_78__linear
```

### AskQuestionAsync() Control Flow

_Warnings: diagram method_jffhoh_askquestionasync__fragment_diagram exceeds preferred complexity thresholds (25 nodes, 27 edges)._

```mermaid
---
config:
  flowchart:
    defaultRenderer: "elk"
---
flowchart TD
    method_jffhoh_askquestionasync__action_100_askquestionasync_await_100_1__await[["Waits for async work"]]
    method_jffhoh_askquestionasync__action_101_askquestionasync_branch_101_2__condition{"response.IsSuccessStatusCode"}
    method_jffhoh_askquestionasync__action_101_askquestionasync_branch_101_2__false("false")
    method_jffhoh_askquestionasync__action_101_askquestionasync_branch_101_2__merge("merge")
    method_jffhoh_askquestionasync__action_101_askquestionasync_branch_101_2__true("true")
    method_jffhoh_askquestionasync__action_101_branch_101__condition{"response.IsSuccessStatusCode"}
    method_jffhoh_askquestionasync__action_101_branch_101__false("failure -> read error and fail")
    method_jffhoh_askquestionasync__action_101_branch_101__merge("merge")
    method_jffhoh_askquestionasync__action_101_branch_101__true("success -> deserialize")
    method_jffhoh_askquestionasync__action_103_askquestionasync_await_103_3__await[["Waits for async work"]]
    method_jffhoh_askquestionasync__action_103_deserialize_103__linear("Read GroundedResponseDto")
    method_jffhoh_askquestionasync__action_104_guard_clause_104__condition{"result == null"}
    method_jffhoh_askquestionasync__action_104_guard_clause_104__false("ok")
    method_jffhoh_askquestionasync__action_104_guard_clause_104__merge("merge")
    method_jffhoh_askquestionasync__action_104_guard_clause_104__true("fail")
    method_jffhoh_askquestionasync__action_107_askquestionasync_await_107_5__await[["Waits for async work"]]
    method_jffhoh_askquestionasync__action_107_error_path_107__linear("Server error handling")
    method_jffhoh_askquestionasync__action_110_askquestionasync_catch_110_7__catch("catch Exception ex")
    method_jffhoh_askquestionasync__action_98_askquestionasync_try_98_0__try("Begins protected execution")
    method_jffhoh_askquestionasync__action_98_try_catch_98__linear("Network exception handling")
    method_jffhoh_askquestionasync__entry(["AskQuestionAsync entry"])
    method_jffhoh_askquestionasync__action_100_external_call_100__linear("POST /api/knowledge/ask")
    method_jffhoh_askquestionasync__action_104_askquestionasync_return_104_4__return(["Returns result"])
    method_jffhoh_askquestionasync__action_108_askquestionasync_return_108_6__return(["Returns result"])
    method_jffhoh_askquestionasync__action_112_askquestionasync_return_112_8__return(["Returns result"])
    method_jffhoh_askquestionasync__action_100_askquestionasync_await_100_1__await -->|next| method_jffhoh_askquestionasync__action_100_external_call_100__linear
    method_jffhoh_askquestionasync__action_100_external_call_100__linear -->|next| method_jffhoh_askquestionasync__action_101_askquestionasync_branch_101_2__condition
    method_jffhoh_askquestionasync__action_101_askquestionasync_branch_101_2__condition -->|false| method_jffhoh_askquestionasync__action_101_askquestionasync_branch_101_2__false
    method_jffhoh_askquestionasync__action_101_askquestionasync_branch_101_2__condition -->|true| method_jffhoh_askquestionasync__action_101_askquestionasync_branch_101_2__true
    method_jffhoh_askquestionasync__action_101_askquestionasync_branch_101_2__false -->|next| method_jffhoh_askquestionasync__action_101_askquestionasync_branch_101_2__merge
    method_jffhoh_askquestionasync__action_101_askquestionasync_branch_101_2__merge -->|next| method_jffhoh_askquestionasync__action_101_branch_101__condition
    method_jffhoh_askquestionasync__action_101_askquestionasync_branch_101_2__true -->|next| method_jffhoh_askquestionasync__action_101_askquestionasync_branch_101_2__merge
    method_jffhoh_askquestionasync__action_101_branch_101__condition -->|failure -> read error and fail| method_jffhoh_askquestionasync__action_101_branch_101__false
    method_jffhoh_askquestionasync__action_101_branch_101__condition -->|success -> deserialize| method_jffhoh_askquestionasync__action_101_branch_101__true
    method_jffhoh_askquestionasync__action_101_branch_101__false -->|next| method_jffhoh_askquestionasync__action_101_branch_101__merge
    method_jffhoh_askquestionasync__action_101_branch_101__merge -->|next| method_jffhoh_askquestionasync__action_103_askquestionasync_await_103_3__await
    method_jffhoh_askquestionasync__action_101_branch_101__true -->|next| method_jffhoh_askquestionasync__action_101_branch_101__merge
    method_jffhoh_askquestionasync__action_103_askquestionasync_await_103_3__await -->|next| method_jffhoh_askquestionasync__action_103_deserialize_103__linear
    method_jffhoh_askquestionasync__action_103_deserialize_103__linear -->|return| method_jffhoh_askquestionasync__action_104_askquestionasync_return_104_4__return
    method_jffhoh_askquestionasync__action_104_askquestionasync_return_104_4__return -->|next| method_jffhoh_askquestionasync__action_104_guard_clause_104__condition
    method_jffhoh_askquestionasync__action_104_guard_clause_104__condition -->|ok| method_jffhoh_askquestionasync__action_104_guard_clause_104__false
    method_jffhoh_askquestionasync__action_104_guard_clause_104__condition -->|fail| method_jffhoh_askquestionasync__action_104_guard_clause_104__true
    method_jffhoh_askquestionasync__action_104_guard_clause_104__false -->|next| method_jffhoh_askquestionasync__action_104_guard_clause_104__merge
    method_jffhoh_askquestionasync__action_104_guard_clause_104__merge -->|next| method_jffhoh_askquestionasync__action_107_askquestionasync_await_107_5__await
    method_jffhoh_askquestionasync__action_104_guard_clause_104__true -->|next| method_jffhoh_askquestionasync__action_104_guard_clause_104__merge
    method_jffhoh_askquestionasync__action_107_askquestionasync_await_107_5__await -->|next| method_jffhoh_askquestionasync__action_107_error_path_107__linear
    method_jffhoh_askquestionasync__action_107_error_path_107__linear -->|return| method_jffhoh_askquestionasync__action_108_askquestionasync_return_108_6__return
    method_jffhoh_askquestionasync__action_108_askquestionasync_return_108_6__return -->|exception| method_jffhoh_askquestionasync__action_110_askquestionasync_catch_110_7__catch
    method_jffhoh_askquestionasync__action_110_askquestionasync_catch_110_7__catch -->|return| method_jffhoh_askquestionasync__action_112_askquestionasync_return_112_8__return
    method_jffhoh_askquestionasync__action_98_askquestionasync_try_98_0__try -->|next| method_jffhoh_askquestionasync__action_100_askquestionasync_await_100_1__await
    method_jffhoh_askquestionasync__action_98_try_catch_98__linear -->|next| method_jffhoh_askquestionasync__action_98_askquestionasync_try_98_0__try
    method_jffhoh_askquestionasync__entry -->|next| method_jffhoh_askquestionasync__action_98_try_catch_98__linear
```

### CallKnowledgeApiAsync() Control Flow

_Warnings: diagram method_3dd3av_callknowledgeapiasync__fragment_diagram exceeds preferred complexity thresholds (25 nodes, 27 edges)._

```mermaid
---
config:
  flowchart:
    defaultRenderer: "elk"
---
flowchart TD
    method_3dd3av_callknowledgeapiasync__action_118_callknowledgeapiasync_try_118_0__try("Begins protected execution")
    method_3dd3av_callknowledgeapiasync__action_118_try_catch_118__linear("Network or parsing exception handling")
    method_3dd3av_callknowledgeapiasync__action_120_callknowledgeapiasync_await_120_1__await[["Waits for async work"]]
    method_3dd3av_callknowledgeapiasync__action_121_branch_121__condition{"response.IsSuccessStatusCode"}
    method_3dd3av_callknowledgeapiasync__action_121_branch_121__false("failure -> read error and fail")
    method_3dd3av_callknowledgeapiasync__action_121_branch_121__merge("merge")
    method_3dd3av_callknowledgeapiasync__action_121_branch_121__true("success -> deserialize")
    method_3dd3av_callknowledgeapiasync__action_121_callknowledgeapiasync_branch_121_2__condition{"response.IsSuccessStatusCode"}
    method_3dd3av_callknowledgeapiasync__action_121_callknowledgeapiasync_branch_121_2__false("false")
    method_3dd3av_callknowledgeapiasync__action_121_callknowledgeapiasync_branch_121_2__merge("merge")
    method_3dd3av_callknowledgeapiasync__action_121_callknowledgeapiasync_branch_121_2__true("true")
    method_3dd3av_callknowledgeapiasync__action_123_callknowledgeapiasync_await_123_3__await[["Waits for async work"]]
    method_3dd3av_callknowledgeapiasync__action_123_deserialize_123__linear("Read KnowledgePacket")
    method_3dd3av_callknowledgeapiasync__action_124_guard_clause_124__condition{"packet == null"}
    method_3dd3av_callknowledgeapiasync__action_124_guard_clause_124__false("ok")
    method_3dd3av_callknowledgeapiasync__action_124_guard_clause_124__merge("merge")
    method_3dd3av_callknowledgeapiasync__action_124_guard_clause_124__true("fail")
    method_3dd3av_callknowledgeapiasync__action_127_callknowledgeapiasync_await_127_5__await[["Waits for async work"]]
    method_3dd3av_callknowledgeapiasync__action_127_error_path_127__linear("Server error handling")
    method_3dd3av_callknowledgeapiasync__action_130_callknowledgeapiasync_catch_130_7__catch("catch Exception ex")
    method_3dd3av_callknowledgeapiasync__entry(["CallKnowledgeApiAsync entry"])
    method_3dd3av_callknowledgeapiasync__action_120_external_call_120__linear("POST to provided endpoint")
    method_3dd3av_callknowledgeapiasync__action_124_callknowledgeapiasync_return_124_4__return(["Returns result"])
    method_3dd3av_callknowledgeapiasync__action_128_callknowledgeapiasync_return_128_6__return(["Returns result"])
    method_3dd3av_callknowledgeapiasync__action_132_callknowledgeapiasync_return_132_8__return(["Returns result"])
    method_3dd3av_callknowledgeapiasync__action_118_callknowledgeapiasync_try_118_0__try -->|next| method_3dd3av_callknowledgeapiasync__action_120_callknowledgeapiasync_await_120_1__await
    method_3dd3av_callknowledgeapiasync__action_118_try_catch_118__linear -->|next| method_3dd3av_callknowledgeapiasync__action_118_callknowledgeapiasync_try_118_0__try
    method_3dd3av_callknowledgeapiasync__action_120_callknowledgeapiasync_await_120_1__await -->|next| method_3dd3av_callknowledgeapiasync__action_120_external_call_120__linear
    method_3dd3av_callknowledgeapiasync__action_120_external_call_120__linear -->|next| method_3dd3av_callknowledgeapiasync__action_121_callknowledgeapiasync_branch_121_2__condition
    method_3dd3av_callknowledgeapiasync__action_121_branch_121__condition -->|failure -> read error and fail| method_3dd3av_callknowledgeapiasync__action_121_branch_121__false
    method_3dd3av_callknowledgeapiasync__action_121_branch_121__condition -->|success -> deserialize| method_3dd3av_callknowledgeapiasync__action_121_branch_121__true
    method_3dd3av_callknowledgeapiasync__action_121_branch_121__false -->|next| method_3dd3av_callknowledgeapiasync__action_121_branch_121__merge
    method_3dd3av_callknowledgeapiasync__action_121_branch_121__merge -->|next| method_3dd3av_callknowledgeapiasync__action_123_callknowledgeapiasync_await_123_3__await
    method_3dd3av_callknowledgeapiasync__action_121_branch_121__true -->|next| method_3dd3av_callknowledgeapiasync__action_121_branch_121__merge
    method_3dd3av_callknowledgeapiasync__action_121_callknowledgeapiasync_branch_121_2__condition -->|false| method_3dd3av_callknowledgeapiasync__action_121_callknowledgeapiasync_branch_121_2__false
    method_3dd3av_callknowledgeapiasync__action_121_callknowledgeapiasync_branch_121_2__condition -->|true| method_3dd3av_callknowledgeapiasync__action_121_callknowledgeapiasync_branch_121_2__true
    method_3dd3av_callknowledgeapiasync__action_121_callknowledgeapiasync_branch_121_2__false -->|next| method_3dd3av_callknowledgeapiasync__action_121_callknowledgeapiasync_branch_121_2__merge
    method_3dd3av_callknowledgeapiasync__action_121_callknowledgeapiasync_branch_121_2__merge -->|next| method_3dd3av_callknowledgeapiasync__action_121_branch_121__condition
    method_3dd3av_callknowledgeapiasync__action_121_callknowledgeapiasync_branch_121_2__true -->|next| method_3dd3av_callknowledgeapiasync__action_121_callknowledgeapiasync_branch_121_2__merge
    method_3dd3av_callknowledgeapiasync__action_123_callknowledgeapiasync_await_123_3__await -->|next| method_3dd3av_callknowledgeapiasync__action_123_deserialize_123__linear
    method_3dd3av_callknowledgeapiasync__action_123_deserialize_123__linear -->|return| method_3dd3av_callknowledgeapiasync__action_124_callknowledgeapiasync_return_124_4__return
    method_3dd3av_callknowledgeapiasync__action_124_callknowledgeapiasync_return_124_4__return -->|next| method_3dd3av_callknowledgeapiasync__action_124_guard_clause_124__condition
    method_3dd3av_callknowledgeapiasync__action_124_guard_clause_124__condition -->|ok| method_3dd3av_callknowledgeapiasync__action_124_guard_clause_124__false
    method_3dd3av_callknowledgeapiasync__action_124_guard_clause_124__condition -->|fail| method_3dd3av_callknowledgeapiasync__action_124_guard_clause_124__true
    method_3dd3av_callknowledgeapiasync__action_124_guard_clause_124__false -->|next| method_3dd3av_callknowledgeapiasync__action_124_guard_clause_124__merge
    method_3dd3av_callknowledgeapiasync__action_124_guard_clause_124__merge -->|next| method_3dd3av_callknowledgeapiasync__action_127_callknowledgeapiasync_await_127_5__await
    method_3dd3av_callknowledgeapiasync__action_124_guard_clause_124__true -->|next| method_3dd3av_callknowledgeapiasync__action_124_guard_clause_124__merge
    method_3dd3av_callknowledgeapiasync__action_127_callknowledgeapiasync_await_127_5__await -->|next| method_3dd3av_callknowledgeapiasync__action_127_error_path_127__linear
    method_3dd3av_callknowledgeapiasync__action_127_error_path_127__linear -->|return| method_3dd3av_callknowledgeapiasync__action_128_callknowledgeapiasync_return_128_6__return
    method_3dd3av_callknowledgeapiasync__action_128_callknowledgeapiasync_return_128_6__return -->|exception| method_3dd3av_callknowledgeapiasync__action_130_callknowledgeapiasync_catch_130_7__catch
    method_3dd3av_callknowledgeapiasync__action_130_callknowledgeapiasync_catch_130_7__catch -->|return| method_3dd3av_callknowledgeapiasync__action_132_callknowledgeapiasync_return_132_8__return
    method_3dd3av_callknowledgeapiasync__entry -->|next| method_3dd3av_callknowledgeapiasync__action_118_try_catch_118__linear
```

### ClearCacheAsync() Control Flow

_Warnings: diagram method_1wz04qu_clearcacheasync__fragment_diagram exceeds preferred complexity thresholds (21 nodes, 22 edges)._

```mermaid
---
config:
  flowchart:
    defaultRenderer: "elk"
---
flowchart TD
    method_1wz04qu_clearcacheasync__action_138_clearcacheasync_try_138_0__try("Begins protected execution")
    method_1wz04qu_clearcacheasync__action_138_try_catch_138__linear("Network exception handling")
    method_1wz04qu_clearcacheasync__action_140_log_140__linear("Log request start")
    method_1wz04qu_clearcacheasync__action_141_clearcacheasync_await_141_1__await[["Waits for async work"]]
    method_1wz04qu_clearcacheasync__action_142_branch_142__condition{"response.IsSuccessStatusCode"}
    method_1wz04qu_clearcacheasync__action_142_branch_142__false("failure -> read error and fail")
    method_1wz04qu_clearcacheasync__action_142_branch_142__merge("merge")
    method_1wz04qu_clearcacheasync__action_142_branch_142__true("success -> log success and return Ok")
    method_1wz04qu_clearcacheasync__action_142_clearcacheasync_branch_142_2__condition{"response.IsSuccessStatusCode"}
    method_1wz04qu_clearcacheasync__action_142_clearcacheasync_branch_142_2__false("false")
    method_1wz04qu_clearcacheasync__action_142_clearcacheasync_branch_142_2__merge("merge")
    method_1wz04qu_clearcacheasync__action_142_clearcacheasync_branch_142_2__true("true")
    method_1wz04qu_clearcacheasync__action_144_log_144__linear("Log success")
    method_1wz04qu_clearcacheasync__action_148_clearcacheasync_await_148_4__await[["Waits for async work"]]
    method_1wz04qu_clearcacheasync__action_148_error_path_148__linear("Server error handling")
    method_1wz04qu_clearcacheasync__action_151_clearcacheasync_catch_151_6__catch("catch Exception ex")
    method_1wz04qu_clearcacheasync__entry(["ClearCacheAsync entry"])
    method_1wz04qu_clearcacheasync__action_141_external_call_141__linear("DELETE /api/knowledge")
    method_1wz04qu_clearcacheasync__action_145_clearcacheasync_return_145_3__return(["Returns result"])
    method_1wz04qu_clearcacheasync__action_149_clearcacheasync_return_149_5__return(["Returns result"])
    method_1wz04qu_clearcacheasync__action_153_clearcacheasync_return_153_7__return(["Returns result"])
    method_1wz04qu_clearcacheasync__action_138_clearcacheasync_try_138_0__try -->|next| method_1wz04qu_clearcacheasync__action_140_log_140__linear
    method_1wz04qu_clearcacheasync__action_138_try_catch_138__linear -->|next| method_1wz04qu_clearcacheasync__action_138_clearcacheasync_try_138_0__try
    method_1wz04qu_clearcacheasync__action_140_log_140__linear -->|next| method_1wz04qu_clearcacheasync__action_141_clearcacheasync_await_141_1__await
    method_1wz04qu_clearcacheasync__action_141_clearcacheasync_await_141_1__await -->|next| method_1wz04qu_clearcacheasync__action_141_external_call_141__linear
    method_1wz04qu_clearcacheasync__action_141_external_call_141__linear -->|next| method_1wz04qu_clearcacheasync__action_142_clearcacheasync_branch_142_2__condition
    method_1wz04qu_clearcacheasync__action_142_branch_142__condition -->|failure -> read error and fail| method_1wz04qu_clearcacheasync__action_142_branch_142__false
    method_1wz04qu_clearcacheasync__action_142_branch_142__condition -->|success -> log success and return Ok| method_1wz04qu_clearcacheasync__action_142_branch_142__true
    method_1wz04qu_clearcacheasync__action_142_branch_142__false -->|next| method_1wz04qu_clearcacheasync__action_142_branch_142__merge
    method_1wz04qu_clearcacheasync__action_142_branch_142__merge -->|next| method_1wz04qu_clearcacheasync__action_144_log_144__linear
    method_1wz04qu_clearcacheasync__action_142_branch_142__true -->|next| method_1wz04qu_clearcacheasync__action_142_branch_142__merge
    method_1wz04qu_clearcacheasync__action_142_clearcacheasync_branch_142_2__condition -->|false| method_1wz04qu_clearcacheasync__action_142_clearcacheasync_branch_142_2__false
    method_1wz04qu_clearcacheasync__action_142_clearcacheasync_branch_142_2__condition -->|true| method_1wz04qu_clearcacheasync__action_142_clearcacheasync_branch_142_2__true
    method_1wz04qu_clearcacheasync__action_142_clearcacheasync_branch_142_2__false -->|next| method_1wz04qu_clearcacheasync__action_142_clearcacheasync_branch_142_2__merge
    method_1wz04qu_clearcacheasync__action_142_clearcacheasync_branch_142_2__merge -->|next| method_1wz04qu_clearcacheasync__action_142_branch_142__condition
    method_1wz04qu_clearcacheasync__action_142_clearcacheasync_branch_142_2__true -->|next| method_1wz04qu_clearcacheasync__action_142_clearcacheasync_branch_142_2__merge
    method_1wz04qu_clearcacheasync__action_144_log_144__linear -->|return| method_1wz04qu_clearcacheasync__action_145_clearcacheasync_return_145_3__return
    method_1wz04qu_clearcacheasync__action_145_clearcacheasync_return_145_3__return -->|next| method_1wz04qu_clearcacheasync__action_148_clearcacheasync_await_148_4__await
    method_1wz04qu_clearcacheasync__action_148_clearcacheasync_await_148_4__await -->|next| method_1wz04qu_clearcacheasync__action_148_error_path_148__linear
    method_1wz04qu_clearcacheasync__action_148_error_path_148__linear -->|return| method_1wz04qu_clearcacheasync__action_149_clearcacheasync_return_149_5__return
    method_1wz04qu_clearcacheasync__action_149_clearcacheasync_return_149_5__return -->|exception| method_1wz04qu_clearcacheasync__action_151_clearcacheasync_catch_151_6__catch
    method_1wz04qu_clearcacheasync__action_151_clearcacheasync_catch_151_6__catch -->|return| method_1wz04qu_clearcacheasync__action_153_clearcacheasync_return_153_7__return
    method_1wz04qu_clearcacheasync__entry -->|next| method_1wz04qu_clearcacheasync__action_138_try_catch_138__linear
```

## Diagram Validation

- Status: warn
- Warning: neighborhood-view: diagram file_1ufa6nr_wasmknowledgeservice_cs_neighborhood_view exceeds preferred complexity thresholds (13 nodes, 0 edges).
- Warning: execution-overview: diagram file_1ufa6nr_wasmknowledgeservice_cs_execution_view exceeds preferred complexity thresholds (23 nodes, 22 edges).
- Warning: control-flow: diagram method_1ca58m3_getrelevantcontextasync__fragment_diagram exceeds preferred complexity thresholds (26 nodes, 28 edges).
- Warning: control-flow: diagram method_1ol1cx2_verifygroundednessasync__fragment_diagram exceeds preferred complexity thresholds (25 nodes, 27 edges).
- Warning: control-flow: diagram method_1sn20bf_searchlibrarysemanticallyasync__fragment_diagram exceeds preferred complexity thresholds (25 nodes, 27 edges).
- Warning: control-flow: diagram method_jffhoh_askquestionasync__fragment_diagram exceeds preferred complexity thresholds (25 nodes, 27 edges).
- Warning: control-flow: diagram method_3dd3av_callknowledgeapiasync__fragment_diagram exceeds preferred complexity thresholds (25 nodes, 27 edges).
- Warning: control-flow: diagram method_1wz04qu_clearcacheasync__fragment_diagram exceeds preferred complexity thresholds (21 nodes, 22 edges).
