Skip to content

feat: add Prompt module for grounded RAG query construction - #52

Merged
ParamThakkar123 merged 9 commits into
retrievalfrom
prompt_construction
Sep 21, 2026
Merged

ParamThakkar123 merged 9 commits into
retrievalfrom
prompt_construction

Conversation

@ParamThakkar123

Copy link
Copy Markdown
Collaborator

Summary

  • Prompt module (src/prompt.jl): Introduces FUNSQL_SYSTEM_PROMPT, PromptTemplate, DEFAULT_FUNSQL_TEMPLATE, format_context, and build_prompt for constructing grounded LLM prompts from retrieved chunks
  • Integration: Wires the Prompt module into HealthLLM.jl public API and docs
  • Tests: Full test coverage in test/PromptTest.jl
  • Docs: New querying.md page with usage examples

This completes the RAG pipeline by adding the final step: formatting retrieved context into a structured prompt for LLM-based FUNSQL query generation.

Introduces a Prompt module with:
- FUNSQL system prompt and customizable PromptTemplate
- Context formatting from retrieved chunks
- Build prompts for LLM query construction

Includes full test coverage and documentation page.
@codecov

codecov Bot commented Jul 19, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 77.57353% with 61 lines in your changes missing coverage. Please review.
✅ Project coverage is 71.66%. Comparing base (940e863) to head (63e856f).
⚠️ Report is 10 commits behind head on retrieval.

Files with missing lines Patch % Lines
src/huggingface.jl 65.33% 26 Missing ⚠️
src/execution.jl 73.13% 18 Missing ⚠️
src/storage.jl 56.25% 7 Missing ⚠️
src/utils.jl 88.63% 5 Missing ⚠️
src/database.jl 66.66% 2 Missing ⚠️
src/prompt.jl 96.00% 2 Missing ⚠️
src/embeddings.jl 66.66% 1 Missing ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##           retrieval      #52      +/-   ##
=============================================
+ Coverage      65.96%   71.66%   +5.69%     
=============================================
  Files             12       15       +3     
  Lines            526      720     +194     
=============================================
+ Hits             347      516     +169     
- Misses           179      204      +25     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

ParamThakkar123 and others added 5 commits July 19, 2026 11:29
Introduces an Execution module with:
- FUNSQL query execution against DuckDB via RAGTools
- Result extraction, formatting, and display
- End-to-end query-to-answer pipeline integration

Includes tests and documentation updates.
Refactor and make HealthLLM.jl more modular and easy to use
@ParamThakkar123
ParamThakkar123 changed the base branch from main to retrieval September 5, 2026 04:34
ParamThakkar123 and others added 3 commits September 5, 2026 10:13
The Documentation job failed with six unresolvable `@ref` targets,
from two separate causes:

- `Chunk`, `HeaderChunk` and the rest of the chunking API are defined
  and exported by the `Ingestion` submodule but were never re-exported
  from `HealthLLM`, so `[`Chunk`](@ref)` in querying.md (which runs
  under `CurrentModule = HealthLLM`) had no binding to resolve against.
  Add them to the `import .Ingestion:` and `export` lists alongside the
  other ingestion names.

- Documenter resolves `@ref`s inside a docstring in that docstring's own
  module. The `Prompt` docstrings reference `retrieve`, `search` and
  `Chunk`, none of which `Prompt` imports, so they failed as
  `HealthLLM.Prompt.retrieve` and friends. Qualify them with the
  `[`name`](@ref Module.name)` form, which keeps the rendered link text
  unchanged.

`julia --project=docs docs/make.jl` now completes CrossReferences and
RenderDocument with no errors.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RYi1NAjjGQ848cUMLEbh1x
feat: add Execution module for FUNSQL query execution and answer generation
@ParamThakkar123
ParamThakkar123 merged commit af9059d into retrieval Sep 21, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant