Skip to content

Add workspace param for lightrag with PG storage #1597

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 19 commits into
base: main
Choose a base branch
from

Conversation

jasperchen01
Copy link

Description

Add workspace param for lightrag with PG storage

Related Issues

#1573

Changes Made

  1. Add workspace param in class StorageNameSpace(ABC)
  2. Change milvus_impl.py to support the workspace collections
  3. Change postgres_impl.py to support the workspace query
  4. Change lightrag/lightrag.py to pass the workspace value when init the lightrag

Checklist

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

Additional Notes

[Add any additional notes or context for the reviewer(s).]

Copy link
Collaborator

@danielaskdd danielaskdd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PGGraphStorage class itself does not directly support data isolation through workspaces. The graph data from different workspaces will be stored in the same Apache AGE graph, which can cause LightRAG RAG to malfunction.

@danielaskdd
Copy link
Collaborator

In the current workflow, it seems that the workspace can only be set during the initialization of the LightRAG object. If you need to switch workspaces later, you have to create a new LightRAG object. Is my understanding correct? If so, is there a better way to switch workspaces?

@jasperchen01
Copy link
Author

The PGGraphStorage class itself does not directly support data isolation through workspaces. The graph data from different workspaces will be stored in the same Apache AGE graph, which can cause LightRAG RAG to malfunction.

Yeah, you're correct, PGGraphStorage doesn't support the workspace, I'll check that again.

@jasperchen01
Copy link
Author

In the current workflow, it seems that the workspace can only be set during the initialization of the LightRAG object. If you need to switch workspaces later, you have to create a new LightRAG object. Is my understanding correct? If so, is there a better way to switch workspaces?

Yes, it can not to dynamically switch workspace for my changes. I think if we wanna the ability to dynamically switch workspaces , we need to modify all insert/query interfaces to add a workspace parameter

merge HKUDS main branch
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.

3 participants