Use the ResearchTools concern for shared functionality
mainThe ResearchTools concern allows you to share research-related logic and configuration across multiple agents. It provides class-level methods to configure research settings and instance methods to perform common research tasks.
Shared Actions provided by the concern:
search_academic_papers: Searches for papers using MCP tools.analyze_research_data: Analyzes provided data using a specified analysis type.generate_research_visualization: Usesimage_generationtools to create visual representations of research topics.
Implementation Pattern:
module ResearchTools
extend ActiveSupport::Concern
class_methods do
def configure_research_tools(config = {})
@research_tools_config = config
end
def research_tools_config
@research_tools_config || {}
end
end
def search_academic_papers
# ... implementation
end
endclass ResearchAgent < ApplicationAgent
include ResearchTools
configure_research_tools(
enable_web_search: true,
mcps: ["arxiv"]
)
end