Skip to content

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

Open
ParamThakkar123 wants to merge 2 commits into
retrievalfrom
prompt_construction
Open

feat: add Prompt module for grounded RAG query construction#52
ParamThakkar123 wants to merge 2 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 96.61017% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 69.05%. Comparing base (940e863) to head (73c54bf).

Files with missing lines Patch % Lines
src/prompt.jl 96.61% 2 Missing ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##           retrieval      #52      +/-   ##
=============================================
+ Coverage      65.96%   69.05%   +3.09%     
=============================================
  Files             12       13       +1     
  Lines            526      585      +59     
=============================================
+ Hits             347      404      +57     
- Misses           179      181       +2     

☔ 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
ParamThakkar123 changed the base branch from main to retrieval September 5, 2026 04:34
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
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