LightRAG icon indicating copy to clipboard operation
LightRAG copied to clipboard

[Feature Request]: configuration of entity types and custom kg in LightRAG server

Open vmahe35 opened this issue 8 months ago • 7 comments

Do you need to file a feature request?

  • [x] I have searched the existing feature request and this feature request is not already filed.
  • [x] I believe this is a legitimate feature request, not just a question or bug.

Feature Request Description

Hello,

I would like to be able to provide a custom KG and list of entity types to my LightRAG server.

  • The custom KG could be provided as an environment variable pointing to a json file (or a directory of files ?)
  • The list of entity types could be provided as an environment variable as well. Using the same format as the one used in PROMPTS["DEFAULT_ENTITY_TYPES"].

What do you think ?

Thanks

Additional Context

No response

vmahe35 avatar Mar 31 '25 08:03 vmahe35

+1

Being able to pass a configuration would be preferable.

flamz3d avatar Mar 31 '25 10:03 flamz3d

I believe this is currently possible:

if you pass a dict for "addon_params"

https://github.com/HKUDS/LightRAG/blob/7a67f6c2fd95aa01c7a9c7945874eb170b1eb6f0/examples/lightrag_oracle_demo.py#L94


    config["addon_params"] = {
        "entity_types": args.entity_types,
        "language": "English",
        "example_number": 0  # Disable default examples
    }

0bserver07 avatar Apr 01 '25 04:04 0bserver07

Yes, I know it is possible if I use lightrag package in my python code. But here the point is to be able to do it also in the LightRAG server, with only configuration via environment variables and config files (no Python code).

vmahe35 avatar Apr 01 '25 07:04 vmahe35

+1 I need this feature badly.

ujnxs123 avatar Apr 02 '25 04:04 ujnxs123

Do you mean we may need a feature to specify the type of nodes stored in the graph database before queries, so that when retrieve knowledge we can only get nodes in a specific range as knowledge input?

Exploding-Soda avatar Apr 03 '25 05:04 Exploding-Soda

Can I just add my own types in DEFAULT_ENTITY_TYPES ? Will the Lightrag server get them on every start?

ndrewpj avatar Apr 23 '25 12:04 ndrewpj

I changed the contents of the PROMPTS["DEFAULT_ENTITY_TYPES"] directly in the prompts.py file. This should do the job, but it did not work. I have to look deer into the code to understand the flow, but I am surprised it doesn't work. If someone knows, please share this info here.

ntsarb avatar May 16 '25 16:05 ntsarb