WeKnora/internal/application/service/chat_pipeline
wizardchen f740e7cecf feat(observability): expand Langfuse spans across chat pipeline
Previously the Langfuse timeline for a knowledge-chat request only
showed generations (chat.completion, embedding.embed, rerank), so the
work happening between them — query setup, vector/keyword search,
result merging, prompt assembly — appeared as unexplained gaps.

Add spans around the pieces that fill those gaps:

* qa.setup wraps request-time KB / model / search-target resolution
  before the pipeline event loop starts, accounting for the visible
  delay before the first chat.completion.
* pipeline.<event> wraps each pipeline stage's eventManager.Trigger
  call so generations inside a stage nest under it. CHAT_COMPLETION_
  STREAM is intentionally skipped because its OnEvent returns as soon
  as the streaming goroutine starts; a stage span would always finish
  before the chat.completion.stream generation it nominally parents.
* retrieve wraps the actual vector + keyword retrieve call inside
  HybridSearch, exposing the DB round-trip that previously sat invisibly
  between embedding generations and rerank.
* web_search wraps the external web-search HTTP call when enabled.
2026-05-12 21:16:37 +08:00
..
chat_completion.go feat(prompts): update assistant descriptions and add intent-specific templates 2026-03-25 22:08:29 +08:00
chat_completion_stream.go feat(prompts): update assistant descriptions and add intent-specific templates 2026-03-25 22:08:29 +08:00
chat_pipeline.go feat(prompts): update assistant descriptions and add intent-specific templates 2026-03-25 22:08:29 +08:00
chat_pipeline_test.go feat(prompts): update assistant descriptions and add intent-specific templates 2026-03-25 22:08:29 +08:00
common.go fix(chat): include history in model fallback 2026-05-04 23:24:21 +08:00
data_analysis.go feat: correct data analysis errors using fileService. 2026-04-27 13:18:08 +08:00
extract_entity.go fix(graph): recover JSON from malformed/truncated fences in extract_entity 2026-05-07 15:40:19 +08:00
extract_entity_test.go fix(graph): recover JSON from malformed/truncated fences in extract_entity 2026-05-07 15:40:19 +08:00
filter_top_k.go feat(prompts): update assistant descriptions and add intent-specific templates 2026-03-25 22:08:29 +08:00
into_chat_message.go feat(prompt): enhance question rewriting and intent classification in prompt templates 2026-04-16 23:15:02 +08:00
load_history.go feat(prompts): update assistant descriptions and add intent-specific templates 2026-03-25 22:08:29 +08:00
memory.go fix(memory): dedupe episode write on duplicate streaming Done 2026-05-04 23:49:29 +08:00
merge.go feat(logger): implement LLM debug logging functionality 2026-04-16 23:15:02 +08:00
merge_expand.go feat(prompts): update assistant descriptions and add intent-specific templates 2026-03-25 22:08:29 +08:00
merge_faq.go feat(prompts): update assistant descriptions and add intent-specific templates 2026-03-25 22:08:29 +08:00
merge_history.go feat(prompts): update assistant descriptions and add intent-specific templates 2026-03-25 22:08:29 +08:00
merge_overlap.go refactor(postgres): optimize vector retrieval and HNSW settings 2026-04-17 12:11:03 +08:00
plugin_test.go feat(prompt): enhance context and intent classification in templates 2026-03-26 18:57:12 +08:00
query_expansion.go feat(prompts): update assistant descriptions and add intent-specific templates 2026-03-25 22:08:29 +08:00
query_understand.go feat(agent): support dedicated model for query understanding step 2026-05-12 20:27:20 +08:00
rerank.go refactor(chat_pipeline): improve regex patterns for table parsing 2026-03-25 22:08:29 +08:00
rerank_clean_test.go feat(prompts): update assistant descriptions and add intent-specific templates 2026-03-25 22:08:29 +08:00
search.go feat(observability): expand Langfuse spans across chat pipeline 2026-05-12 21:16:37 +08:00
search_entity.go feat(logger): implement LLM debug logging functionality 2026-04-16 23:15:02 +08:00
search_parallel.go feat(web-search): refactor web search provider 2026-03-31 20:22:34 +08:00
web_fetch.go feat(web-search): refactor web search provider 2026-03-31 20:22:34 +08:00
wiki_boost.go feat: Enhance wiki API and repository with slug encoding and improved search functionality 2026-04-22 21:18:09 +08:00