Skip to content
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

[Bug]: Document Deletion Issues #985

Open
2 tasks
axunrun opened this issue Mar 3, 2025 · 2 comments
Open
2 tasks

[Bug]: Document Deletion Issues #985

axunrun opened this issue Mar 3, 2025 · 2 comments
Labels
bug Something isn't working

Comments

@axunrun
Copy link

axunrun commented Mar 3, 2025

Do you need to file an issue?

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

Describe the bug

Describe the bug

Document deletion through API and WebUI is not working properly:

  • DELETE /documents endpoint only clears memory references but not database data
  • WebUI document cleanup operation fails to delete documents
  • No support for deleting individual documents by ID

Steps to reproduce

Document Deletion Issues:

  1. Through API:

    Invoke-WebRequest -Method DELETE -Uri "http://host:port/documents"
    • Check documents via GET /documents
    • Documents still exist in database
  2. Through WebUI:

    • Navigate to documents management page
    • Click "Clear All Documents" button
    • Refresh page
    • Documents still present in the list
  3. Single Document:

    • No option available to delete individual document
    • No API endpoint for single document deletion

Expected Behavior

Document Management:

  1. DELETE /documents API should:

    • Clear all data from memory
    • Delete all records from databases
    • Remove all related vectors and relationships
  2. WebUI document cleanup should:

    • Successfully delete all documents
    • Clear UI display
    • Show success confirmation
  3. Single document deletion should:

    • Allow deleting specific documents by ID
    • Remove all related data
    • Update UI immediately

LightRAG Config Used

  • OS: Windows 10
  • Database Configuration:
    [postgres]
    host = 192.168.1.99
    port = 5432
    database = lightrag
    
    [neo4j]
    uri = bolt://192.168.1.99:7687
    
    [qdrant]
    uri = http://192.168.1.99:6333

Logs and screenshots

No response

Additional Information

  • LightRAG Version:
  • Operating System:
  • Python Version:
  • Related Issues:
@axunrun axunrun added the bug Something isn't working label Mar 3, 2025
@axunrun axunrun changed the title [Bug]: Document Deletion Issues & Knowledge Graph Display Problems [Bug]: Document Deletion Issues Mar 3, 2025
@jradikk
Copy link

jradikk commented Mar 4, 2025

I'm interested in this as well. There's a functionality that allows setting your own IDs per document(s) on insert #892. So, even though, that's quite tedious to manage and keep track of, it allows deleting the documents from the DB. However, there's no metadata in knowledge graph and vector database that allows clearing entities and their relationships.
I think the right way to do it, would be to add an additional field to the schema of all tables, just like the workspace is and keep the document name in it. So that whenever you need to delete all entities, relations, document chunks and embeddings, you can call a corresponding method and pass that document name

@FeHuynhVI
Copy link

I have applied a temporary fix; you can refer to it here:
#960.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants