better way to search for the agent resource