LightRAG icon indicating copy to clipboard operation
LightRAG copied to clipboard

Added support for loading user-defined prompts template

Open jerrywang121 opened this issue 7 months ago • 1 comments

Description

Adding support for loading user-defined prompts template. This is to make it easier for user to apply domain specific prompts (e.g. entity types, long examples, and tweak the instructions for specific llm model) for their domains (e.g. finance, telecom).

Related Issues

None

Changes Made

Allow user to specify a yaml file prompt template to be loaded on top of default PROMPTS

  • added LightRAG server support through environment variable PROMPTS_YAML_FILE and command line parameter --prompts-yaml-file
  • added LightRAG core support through addon_params["prompts_yaml_file"], and load yaml and update PROMPTS during __post_init__
  • updated prompt to keep record of default PROMPTS, so it can be reset if needed
  • added prompts.example.yaml
  • updated requirements.txt with PyYAML
  • updated README

Checklist

  • [x] Changes tested locally
  • [x] Code reviewed
  • [x] Documentation updated (if necessary)
  • [ ] Unit tests added (if applicable)

Additional Notes

changes are kept minimum, hope it is OK

jerrywang121 avatar May 22 '25 01:05 jerrywang121

Thanks Daniel for the feedback. glad to learn there is already similar (and more complete) feature planned/under dev I will surely check that out.

jerrywang121 avatar May 22 '25 08:05 jerrywang121

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

github-actions[bot] avatar Aug 20 '25 22:08 github-actions[bot]

This pull request has been automatically closed because it has not had recent activity.

github-actions[bot] avatar Aug 27 '25 22:08 github-actions[bot]