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]: <title>failed to delete doc by id: some functions are not implimented #1081

Open
2 tasks done
KangCaijun opened this issue Mar 13, 2025 · 0 comments
Open
2 tasks done
Labels
bug Something isn't working

Comments

@KangCaijun
Copy link

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

I used the git main branch with MongoKVStorage, MongoDocStatusStorage, QdrantVectorDBStorage and Neo4JStorage.
and the demo code as below:

        try:
            # 检查文档是否存在
            doc_status = await rag.doc_status.get_by_id(doc_id)
            if not doc_status:
                raise HTTPException(
                    status_code=404,
                    detail=f"Document with ID '{doc_id}' not found"
                )

            # 删除文档及其相关数据
            await rag.adelete_by_doc_id(doc_id)
            
            return InsertResponse(
                status="success",
                message=f"Document '{doc_id}' and its related data deleted successfully"
            )
        except Exception as e:
            logger.error(f"Error DELETE /documents/{doc_id}: {str(e)}")
            logger.error(traceback.format_exc())

And I got these error:

heai_kb    | Traceback (most recent call last):                                                                                                                                                                                                                             
heai_kb    |   File "<frozen runpy>", line 198, in _run_module_as_main
heai_kb    |   File "<frozen runpy>", line 88, in _run_code                                                                                                                                                                                                                 
heai_kb    |   File "/app/lightrag/api/lightrag_server.py", line 600, in <module>                                                                                                                                                                                           
heai_kb    |     main()                                                                                                                                                                                                                                                     
heai_kb    |   File "/app/lightrag/api/lightrag_server.py", line 577, in main                                                                                                                                                                                               
heai_kb    |     app = create_app(args)
heai_kb    |           ^^^^^^^^^^^^^^^^                                                                                                                                                                                                                                     
heai_kb    |   File "/app/lightrag/api/lightrag_server.py", line 314, in create_app                                                                                                                                                                                         
heai_kb    |     rag = LightRAG(                                                                                                                                                                                                                                            
heai_kb    |           ^^^^^^^^^
heai_kb    |   File "<string>", line 37, in __init__                                                                                                                                                                                                                        
heai_kb    |   File "/app/lightrag/lightrag.py", line 387, in __post_init__                                                                                                                                                                                                 
heai_kb    |     self.entities_vdb: BaseVectorStorage = self.vector_db_storage_cls(  # type: ignore                                                                                                                                                                         
heai_kb    |                                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^                                                                                                                                                                         
heai_kb    |   File "/app/lightrag/utils.py", line 890, in import_class
heai_kb    |     return cls(*args, **kwargs)                                                                                                                                                                                                                                
heai_kb    |            ^^^^^^^^^^^^^^^^^^^^                                                                                                                                                                                                                                
heai_kb    | TypeError: Can't instantiate abstract class QdrantVectorDBStorage with abstract methods get_by_id, get_by_ids   

When I review the code, I find that "QdrantVectorDBStorage .get_by_id", "QdrantVectorDBStorage .get_by_ids" , "QdrantVectorDBStorage.client_storage", "MongoKVStorage.get_all", "MongoKVStorage.delete" and "MongoDocStatusStorage.delete" are not implemented. So the function "adelete_by_doc_id" is completely unusable.

Steps to reproduce

No response

Expected Behavior

No response

LightRAG Config Used

Paste your config here

Logs and screenshots

No response

Additional Information

  • LightRAG Version:
  • Operating System:
  • Python Version:
  • Related Issues:
@KangCaijun KangCaijun added the bug Something isn't working label Mar 13, 2025
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

1 participant