QA : Metadata and multi instance? #2001
Replies: 1 comment 6 replies
-
looks like you’re basically asking two things:
for ingestion, most frameworks don’t inject metadata automatically; you usually pass it alongside each chunk when calling for querying, what you’re sketching ( so the gap isn’t really in lightRAG’s concept but in making sure the vector db driver you’re using respects metadata at both insert and filter time. if you want a more structured breakdown, we keep a “ProblemMap” that matches common RAG failures to fixes (like metadata drift, or filter collapse). your case looks like No.1 (hallucination & chunk drift if metadata not bound) and No.8 (black-box ingestion where metadata is silently dropped). if you’d like the link to that checklist, just say so and I’ll share it. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I have a question about the best way to implement strict multi-tenancy with LightRAG.
My app has two levels: Organization and Branch. Security requirement:
The approach I’m considering: tag all data at ingestion with
organization_id
andbranch_id
. What I need clarity on is:1. Ingestion
How do I attach custom metadata like
organization_id
andbranch_id
to text passed intorag.insert()
so that it flows into chunks, entities, and relationships?rag.insert()
I’m missing (like it does take ids and i do see query param has id when we query but i was wondering if there was a flexible metadatata KVP like filter)rag.insert_custom_kg()
with custom metadata (like ininsert_custom_kg.py
)? (I know we can define custom relationships and put it but i'd like to avoid manual work)2. Querying
At query time, I want to filter retrieval so only matching
organization_id
and (optionally)branch_id
are considered.Does
QueryParam
support filters for this? For example:This library seems awesome and i'd rather not try to mess with how it works internally. I've read few medium references about this and what i mostly saw was it created a local directory and ran there so i can probably create a Light Rag Instance for each organization (as the files i store are in a IIS server and each organization has it's own dedicated folder (with id duh) seperated by branching btw so i could create a Light rag instance there and whenever any organization tries to query i guess I could finally use that instance and close it when i am done and also use it when I want to batch insert document I could probably use that instance to insert document or query (which i guess reduces cross organization issues?)
I'm not sure how the data is chunked or stored in the database level, i'm more of a doc reader and i havent looked into this library as i just found it today I just want to know more about this lib as it seems interesting and the benchmark seems good :D
I hope I can get help and I apolgoise if i was naivee :')) I'm kind of slacking off writing this but i hope i wrote enough to cover some basic answers!
Beta Was this translation helpful? Give feedback.
All reactions