Dust Community Icon

Issues with Code Review: Magento Class Retrieval Failure

·
·

I’m trying to get an Agent to do a code review and use the Knowledge folder to look into code dependency. Its reporting:

The class Magento\Customer\Model\Address\Validator\Customer couldn’t be verified due to retrieval failure.

I can see the class in the Knowledge -> Folders -> _folder_ and when I ask the Agent about it:

the class Magento\Customer\Model\Address\Validator\Customer exists in Knowledge -> Folders -> _folder_

it replies:

It appears there was an issue retrieving information about the class Magento\Customer\Model\Address\Validator\Customer from the specified location in the knowledge base, even though it is expected to exist under the vendor folder. This could be due to a connectivity issue, access permissions, or a problem with the indexing of the information. To proceed, I recommend directly accessing the specified path in the knowledge base or consulting the system administrator to ensure that the information is correctly indexed and accessible. If you need further assistance with this, please let me know, and I can help guide you through alternative methods to access or confirm the details of this class.

when I ask it to fetch/output the file content it says:

I was unable to retrieve the specific class Magento\Customer\Model\Address\Validator\Customer directly. However, the search results did not indicate any explicit references to this class, which could suggest that there might have been a miscommunication or misunderstanding about the existence of this specific class.

Yet the class exists 😕

  • Avatar of Gregor
    Gregor
    ·
    ·

    the Folder used is set as a “Search” tool and contains the codebase of the whole project (~44k of files).

  • Avatar of Remi
    Remi
    ·
    ·

    hey Gregor 👋 interesting usecase. "search" is using vector search which isn't deterministic. it's good but it can happen that the exact function that you are looking for doesn't come up in the search output. if you already checked that the documents have been properly uploaded to the folder and that the agent tool is properly setup - then it looks like you hit one of the limitation of the tech today :s

  • Avatar of Gregor
    Gregor
    ·
    ·

    the document is uploaded. I can’t confirm the content since the Admin UI doesn’t allow to “Edit” when filtering (regression bug 😞 ) but when fetching thru API it shows up correctly.

  • Avatar of Gregor
    Gregor
    ·
    ·

    How can I validate that agent tool is properly setup? Its pointing to the correct folder, I added a prompt.

  • Avatar of Gregor
    Gregor
    ·
    ·

    also Remi is there a different approach that would allow for AI to process the file(s) based on the input and use them in “thinking” ?

  • Avatar of Remi
    Remi
    ·
    ·

    Gregor thanks! can you see when clicking on "view raw content"? If you didn't add weird tools or stuff, it should be good

  • Avatar of Remi
    Remi
    ·
    ·

    I don't have any different approaches on top of mind. you could specify in the instructions to always search multiple times before answering. maybe giving the architecture of your repo in the instructions could help.

  • Avatar of Gregor
    Gregor
    ·
    ·

    Remi clicking on “view raw content” works. But Edit to see the labels does not

  • Avatar of Gregor
    Gregor
    ·
    ·

    Remi the weird thing is that I added info at the top of each file:

    /*
    Vendor: magento
    Package: module-customer
    Path: Model/Address/Validator/Customer.php
    FQCN: Magento\Customer\Model\Address\Validator\Customer
    */

    which should help with search yet no difference 😞 Could this be done thru table/DB approach?

  • Avatar of Remi
    Remi
    ·
    ·

    table/DB and "query table" can help with keyword search but i am not sure how you'd use it in your use case 🤔

  • Avatar of Gregor
    Gregor
    ·
    ·

    Remi It didn’t. I was able to get around the problem with more “exact” prompts for the search:

    Each PHP file in this folder includes metadata tags: Vendor, Package, Path, and FQCN, representing the full class name and location. These files span all vendor packages and contain the complete source code for each class. Use the FQCN to locate files and recursively resolve class dependencies by parsing use statements, inheritance, and type hints. Build a dependency graph by loading each referenced class via its FQCN tag. This enables context-aware code analysis, allowing Retrieval-Augmented Generation (RAG) for tasks like code review, refactoring, and static analysis across the entire codebase.

    If you see a better way or prompt - I’m all ears. But using this - gets me results!

  • Avatar of Remi
    Remi
    ·
    ·

    Awesome! Congrats 🚀