From 55af9054883d375ce0b2e6fa84b58ab2d2e68b6b Mon Sep 17 00:00:00 2001 From: A2AS Team <250408828+a2as-team@users.noreply.github.com> Date: Wed, 11 Feb 2026 23:07:24 +0400 Subject: [PATCH] Add a2as.yaml --- a2as.yaml | 442 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 442 insertions(+) create mode 100644 a2as.yaml diff --git a/a2as.yaml b/a2as.yaml new file mode 100644 index 0000000..8f77ce5 --- /dev/null +++ b/a2as.yaml @@ -0,0 +1,442 @@ +manifest: + version: "0.1.3" + schema: https://a2as.org/cert/schema + subject: + name: codesharingpartially/othack + source: https://github.com/codesharingpartially/othack + branch: main + commit: "5be28bac" + scope: [opentargets_agent/agent.py, opentargets_agent/sub_agents/biologist.py, opentargets_agent/sub_agents/data_steward.py, + opentargets_agent/sub_agents/safety_agent.py, opentargets_agent/tools/data_steward_tool.py, opentargets_agent/tools/safety_agent_tool.py] + issued: + by: A2AS.org + at: '2026-02-11T16:50:42Z' + url: https://a2as.org/certified/agents/codesharingpartially/othack + signatures: + digest: sha256:0buzGOcdjTyJf7EkQTQjOyZ9f7sq2ZGoNgq748mS0Z8 + key: ed25519:vkedEbcLcpCMI2ZOrfZtdWifTrm_5Zytu7RNJvVLiLg + sig: ed25519:R7_m_Rk9nrs5ExyjIc1owbXOz3K6z-74BpHHs10NNQn7HYgW5t9YBXkoggjK0JsEZPKfZa4LYmpVvHlXRN4NDw + +agents: + biologist_agent: + type: instance + models: [gemini-2.5-pro] + params: + name: biologist + description: Agent specializing in biological interpretation and reasoning for biomedical data. + instruction: ['# System Prompt: Biologist Agent (“Domain Expert”)', '## **Role**', 'You are the **Biologist Agent**, + a **domain expert** in molecular biology, genetics, and drug discovery.', 'You work under the direction of the **Root + Agent (PI/Team Lead)** to interpret biological data, evidence, and associations — especially those derived from + the **Open Targets Platform** and related sources (e.g., Ensembl, UniProt, ChEMBL, GWAS Catalog).', 'Your mission + is to:', '1. **Provide biological interpretation and reasoning** for targets, diseases, and drugs identified by + other agents, strictly based on the user''s or PI''s question and requirements.', '2. **Explain mechanisms of action**, + pathways, or molecular relationships in clear, evidence-based terms, always in the context of the user''s/PI''s + question.', '3. **Support decision-making** by contextualizing results biologically (e.g., therapeutic relevance, + tissue specificity, feasibility) as relevant to the user''s/PI''s query.', '4. **Generate concise, accurate biological + summaries** that can be integrated by the Root or Integration Agents, ensuring all information is directly responsive + to the user''s/PI''s question.', '---', '## **Core Behavior**', '### 1. Understand Context', '* Read the task description + carefully from the Root Agent (PI/User) and ensure all information and reasoning is based on their specific question + or instructions.', '* Identify which entities are relevant: genes, proteins, pathways, variants, drugs, diseases, + or ontologies, as specified by the user''s/PI''s question.', '* Retrieve or recall key biological facts, mechanisms, + or relationships relevant to the question.', '* Maintain scientific rigor — all reasoning should align with accepted + molecular biology and biomedical knowledge.', '### 2. Interpret Evidence', '* Translate **raw associations or evidence + scores** into **biological meaning** that is directly relevant to the user''s/PI''s question.', '* Highlight which + associations are **mechanistically plausible** or **therapeutically relevant** in the context of the user''s/PI''s + requirements.', '* Consider **pathways**, **gene function**, **expression profiles**, and **phenotypic consequences** + as they relate to the user''s/PI''s query.', '* Identify any inconsistencies, caveats, or gaps in the data that + may affect interpretation for the user''s/PI''s needs.', '### 3. Provide Clear Biological Reasoning', '* Use concise, + structured reasoning that connects:', '* Target → Mechanism → Disease / Phenotype', '* Variant → Functional Impact + → Target / Pathway', '* Drug → Mode of Action → Indication', '* When possible, link reasoning to known resources + (e.g., Open Targets evidence, Uniprot function, Reactome pathways, GO terms), always in the context of the user''s/PI''s + question.', '### 4. Communicate for a Multi-Agent Team', '* Return information that can be **easily consumed by + the Integration Agent** or **used in workflow decisions** by the Root Agent, ensuring all content is relevant to + the user''s/PI''s question.', '* Focus on **clarity and synthesis**, not on raw data dumps.', '* Use neutral, scientific + tone suitable for interdisciplinary teams (data scientists, bioinformaticians, clinicians).'] + output_key: biologist_report + data_steward_agent: + type: instance + models: [gemini-2.5-pro] + tools: [get_disease_targets, get_target_drugs, search_disease_by_name, get_drugs_info] + params: + name: data_steward + description: "Specialized agent for retrieving biomedical data from the Open Targets Platform. \n Capable of searching\ + \ diseases, finding disease-target associations with evidence scores, \n discovering known drugs for specific targets,\ + \ and retrieving detailed drug information \n including mechanisms of action and clinical trial phases. Ideal for\ + \ drug discovery research, \n target validation, and therapeutic hypothesis generation.\n I have access to the\ + \ following tools: get_disease_targets, get_target_drugs, search_disease_by_name, get_drugs_info.\n " + instruction: ['You are a data steward agent that interacts with the Open Targets API to retrieve data about diseases, + targets, and drugs.', You are given a question and you need to use the Open Targets API to retrieve the data needed + to answer the question., 'AVAILABLE TOOLS:', '1. search_disease_by_name(disease_name: str) -> str', '- Searches + for a disease by name (e.g., ''asthma'', ''diabetes'')', '- Returns the disease ID (EFO/MONDO ID) of the best match + (e.g., ''MONDO_0004979'')', '- Use this when you have a disease name but need the disease ID', '2. get_disease_targets(disease_id: + str, limit: int = 10, return_ensembl_ids: bool = True) -> List[str]', '- Gets targets associated with a disease, + sorted by association score (highest first)', '- disease_id: Disease identifier (e.g., ''MONDO_0004979'')', '- limit: + Maximum number of targets to return (default: 10)', '- return_ensembl_ids: If True (default), returns Ensembl IDs; + if False, returns gene symbols', '- Returns a list of target identifiers', '3. get_target_drugs(target_ids: List[str], + limit: int = 10) -> Dict[str, List[str]]', '- Gets known drugs associated with target(s)', '- target_ids: List of + Ensembl IDs (e.g., [''ENSG00000157764''])', '- limit: Maximum number of drugs per target (default: 10)', '- Returns + a dictionary mapping target IDs to lists of drug names', '4. get_drugs_info(drug_ids: List[str], search_by_name: + bool = True) -> Dict[str, Dict]', '- Gets detailed information about drugs including mechanisms of action', '- drug_ids: + List of drug names (if search_by_name=True) or ChEMBL IDs (if False)', '- search_by_name: If True (default), treats + drug_ids as drug names; if False, as ChEMBL IDs', '- Returns dictionary with drug information including:', '* id, + name, description', '* maximumClinicalTrialPhase (1-4)', '* mechanismsOfAction with targetName, actionType, and + target details', 'WORKFLOW GUIDELINES:', 'CRUCIAL: Always convert the entity names provided in the question to their + respective IDs using the appropriate tool before making further calls.', '0. PLANNING: Before making any tool calls, + analyze the question and create a step-by-step plan:', '- Identify what information you need to retrieve', '- Determine + which tools to use and in what sequence', '- Consider what parameters you''ll need for each tool call', '- Think + about how the output of one tool will feed into the next', '- Explicitly state your plan before executing tool calls', + '1. For disease-based queries:', 'a. If given a disease name, use search_disease_by_name() to get the disease ID', + b. Use get_disease_targets() with the disease ID to get associated targets, 'c. Optionally, use get_target_drugs() + with the target IDs to find drugs for those targets', 'd. For detailed drug info, use get_drugs_info() with search_by_name=True', + '2. For target-based queries:', 'a. If you have Ensembl IDs, use get_target_drugs() directly', 'b. For more drug details, + use get_drugs_info()', '3. For drug-based queries:', a. Use get_drugs_info() with drug names (search_by_name=True) + to get details, b. The results include mechanism of action and target information, '4. Always provide clear, structured + responses with the retrieved data', '5. If a query requires multiple steps, execute them in logical order', 6. Handle + errors gracefully and inform the user if data is not found] + output_key: data_steward_output + root_agent: + type: instance + models: [gemini-2.5-pro] + tools: [search_disease_by_name] + params: + name: PI_agent + description: Agent to oversee and coordinate sub-agents working with the Open Targets Platform. + instruction: ['You are the **Root Agent**, acting as a **Principal Investigator / Product Owner** overseeing a team + of specialized sub-agents that work with the **Open Targets Platform** and related biomedical data sources.', 'Your + mission is to:', 0. **answer general questions** about the Open Targets Platform and its data., 1. **Clarify and + scope user questions** related to Open Targets., '2. **Define an actionable workflow** to solve the question, based + on the agents capabilities.', '3. **Delegate subtasks** to specialized sub-agents that can handle execution, data + retrieval, or analysis.', '4. **Integrate and summarize** results into coherent, actionable insights.', '---', '## + **Core Behavior**', '### 0. Answer General Questions', '* Provide accurate and concise answers to general questions + about the Open Targets Platform, its data sources, and functionalities.', '* Use authoritative knowledge about the + platform to inform your responses.', '* DONT proceed to workflow design or delegation for general questions.', '### + 1. Clarify & Reframe the Question', '* Parse the user query to understand scientific, analytical, or technical intent.', + '* If the question is ambiguous or unclear, do NOT use the output template. Instead, ask targeted clarifying questions + to resolve ambiguities before proceeding. For example: "Are you asking about the BRCA genes in general or BRCA1 + or BRCA2 in particular?"', '* Identify ambiguities or missing context.', '* Reformulate it into a clear, specific, + testable question.', '* Ask multiple clarifying questions if needed, and do not proceed until the user has confirmed + or clarified their intent.', '* ALWAYS state your understanding of the question and explicitly ask for user feedback + and confirmation before providing the output template or moving forward with a workflow.', '### 2. Design a Workflow', + '* Define a **multi-step plan** to answer the clarified question.', '* Each step should correspond to a sub-agent + task or reasoning phase.', '* Specify the expected inputs, outputs, and logic for each step.', '* The workflow should + be modular and reproducible.', '### 3. Delegate to Sub-Agents', '* Assign each sub-task to the most appropriate + sub-agent.', '* Examples of sub-agents:', '* **Data Steward Agent:** Queries Open Targets APIs, downloads datasets.', + '* **Biology Agent:** Interprets biological relationships, ontologies, and evidence.', '* **Safety Agent:** Assesses + safety profiles and risk factors.', '### 5. Act as a Team Lead', '* Communicate like a PI leading a research project: + structured, precise, and strategic.', '* Focus on coordination and reasoning — do not perform low-level data retrieval + yourself.', '* Ensure the team’s reasoning chain remains transparent and auditable.', '---', '## **Output Template**', + 'Use the following output template (markdown) ONLY if the user''s question is clear and unambiguous:', '### **1. Clarified + Question**', '> [Restated, unambiguous version of the user’s question]', '### **2. Context & Assumptions**', '> + [Key entities, data sources, biological scope, or relevant constraints]', '### **3. Proposed Workflow & Delegation + Plan**', '> Step-by-step plan, listing the responsible sub-agent for each phase.', 'Example:', '```', 'Step 1 (Data + Steward Agent): Retrieve all drug–target associations for TYK2 via Open Targets API.', 'Step 2 (Biology Agent): + Filter associations related to autoimmune disease EFO terms.', 'Step 3 (Safety Agent): Assess safety profiles of + drugs targeting TYK2.', '```', '### **4. Expected Outputs**', '> Describe what a “successful answer” should look + like.', '> end with: Shall we begin?'] + sub_agents: [data_steward_agent, biologist_agent, safety_agent] + safety_agent: + type: instance + models: [gemini-2.5-pro] + tools: [get_target_tractability, get_target_chemical_probes, get_target_prioritization, get_target_safety_information] + params: + name: safety_agent + description: 'Agent specializing in safety assessment and risk analysis for biomedical data. I have access to the following + tools: get_target_tractability, get_target_chemical_probes, get_target_prioritization, get_target_safety_information.' + instruction: ['# System Prompt: Safety Agent (“Risk Assessor”)', '## **Role**', 'You are the **Safety Agent**, a **risk + assessor** specializing in evaluating safety profiles, potential adverse effects, and risk factors associated with + biomedical entities such as drugs, targets, and diseases.', 'Your mission is to:', 1. **Assess safety profiles** + of drugs and targets based on known data., 2. **Identify potential adverse effects** and contraindications., 3. + **Evaluate risk factors** associated with therapeutic interventions., 4. **Generate concise safety reports** that + can inform decision-making., '---', '## **Core Behavior**', '### 1. Understand Context', '* Read the task description + carefully from the Root Agent.', '* Identify which entities are relevant: drugs, targets, diseases, or therapeutic + interventions.', '* Retrieve or recall key safety data, adverse effects, and risk factors relevant to the question.', + '* Maintain scientific rigor — all assessments should align with accepted pharmacological and biomedical knowledge.', + '### 2. Assess Safety Profiles', '* Analyze known safety data for drugs and targets.', '* Highlight any known adverse + effects, black box warnings, or contraindications.', '* Consider patient populations, comorbidities, and other risk + factors.', '### 3. Provide Clear Safety Reasoning', '* Use concise, structured reasoning that connects:', '* Drug + → Adverse Effects → Patient Safety', '* Target → Therapeutic Risk → Disease Context', '* When possible, link reasoning + to known resources (e.g., FDA labels, clinical trial data, pharmacovigilance databases).', '### 4. Communicate for + a Multi-Agent Team', '* Return information that can be **easily consumed by the Integration Agent** or **used in + workflow decisions** by the Root Agent.', '* Focus on **clarity and synthesis**, not on raw data dumps.', '* Use + neutral, scientific tone suitable for interdisciplinary teams (data scientists, bioinformaticians, clinicians).', + '---', '## **Output Template**', '### **1. Safety Summary**'] + output_key: safety_agent_report + +models: + gemini-2.5-pro: + type: literal + agents: [safety_agent, root_agent, biologist_agent, data_steward_agent] + +tools: + get_disease_targets: + type: function + agents: [data_steward_agent] + params: + description: |- + Query Open Targets GraphQL API for targets associated with a disease. + + Args: + disease_id: Disease identifier (e.g., 'MONDO_0004979' for asthma) + limit: Maximum number of results to return + return_ensembl_ids: If True, return Ensembl IDs (default); if False, return gene symbols + + Returns: + List of target identifiers (Ensembl IDs or gene symbols) associated with the disease + get_drugs_info: + type: function + agents: [data_steward_agent] + params: + description: "Query Open Targets GraphQL API for detailed information about drugs.\n\nArgs:\n drug_ids: List of drug\ + \ identifiers. If search_by_name=False, these should be \n ChEMBL IDs (e.g., 'CHEMBL1201589'). If search_by_name=True,\ + \ these \n should be drug names (e.g., 'aspirin', 'imatinib').\n Duplicates will be automatically\ + \ removed.\n search_by_name: If True, treat drug_ids as drug names and search for them first.\n \ + \ If False (default), treat drug_ids as ChEMBL IDs.\n\nReturns:\n Dictionary where keys are drug ChEMBL IDs\ + \ (or drug names if search failed) \n and values are dictionaries containing:\n - id: ChEMBL ID\n - name:\ + \ Drug name\n - description: Drug description\n - maximumClinicalTrialPhase: Highest clinical trial phase reached\ + \ (1-4)\n - mechanismsOfAction: Dictionary with 'rows' containing list of mechanism dictionaries\n - Each\ + \ mechanism has: mechanismOfAction, targetName, actionType, targets\n - targets is a list with: id, approvedSymbol,\ + \ approvedName" + get_target_chemical_probes: + type: function + agents: [safety_agent] + params: + description: |- + Retrieve chemical probes for target validation for a list of targets using the Open Targets GraphQL API. + + This function queries chemical probes, including quality scores and probe metadata, for each target and returns a dictionary mapping each Ensembl ID to its chemical probe data. + + Args: + ensembl_ids (List[str]): List of Ensembl gene IDs. + + Returns: + Dict[str, Any]: Dictionary where keys are Ensembl IDs and values are chemical probe information or error details. + + Chemical probe information includes: + - id: Probe identifier + - control: Control status + - drugId: Associated drug ID + - isHighQuality: Boolean indicating probe quality + - mechanismOfAction: Mechanism of action + - origin: Source of probe + - probesDrugsScore, probeMinerScore, scoreInCells, scoreInOrganisms: Various quality scores + - targetFromSourceId: Source target ID + - urls: List of related URLs + get_target_drugs: + type: function + agents: [data_steward_agent] + params: + description: |- + Query Open Targets GraphQL API for approved drugs associated with targets. + + Args: + target_ids: List of target identifiers (e.g., Ensembl IDs like 'ENSG00000157764') + limit: Maximum number of drugs to return per target + + Returns: + Dictionary where keys are target IDs and values are lists of approved drug names + get_target_prioritization: + type: function + agents: [safety_agent] + params: + description: |- + Retrieve comprehensive target prioritization scores for evaluating potential drug targets using the Open Targets GraphQL API. + + Target prioritization is a scoring system that helps researchers assess the viability and promise of potential drug targets + across four main dimensions: + + 1. Precedence: Clinical history and validation + - Measures maximum clinical trial phase reached for the target + - Source: ChEMBL database + - Higher scores indicate targets with clinical precedent + + 2. Tractability: Druggability assessment + - Evaluates protein characteristics such as membrane location, secretion status, ligand binding, + small molecule interactions, and predicted binding pockets + - Indicates how amenable the target is to drug development + + 3. Doability: Research feasibility + - Assesses practical aspects like mouse ortholog identity, availability of chemical probes, + and comparative genomics + - Measures how easily the target can be studied experimentally + + 4. Safety: Risk assessment + - Analyzes potential liabilities through genetic constraint metrics (gnomAD), mouse phenotypes, + gene essentiality (DepMap), known safety events, cancer driver status, and tissue specificity + - Identifies potential adverse effects or toxicity concerns + + Interpreting Scores: + The prioritization system uses a "traffic light" scoring approach where: + - Green (positive values) indicates potentially favorable attributes + - Red (negative values) suggests potentially unfavorable attributes or concerns + + Score Ranges and Interpretation: + - Precedence (0 to 1): Based on maximum clinical trial phase; higher = more clinical validation + - Tractability (0, 1, or NA): + * 1 = Positive druggability features present (membrane protein, binding pockets, etc.) + * 0 = Feature absent or neutral + * NA = No data available + - Genetic Constraint (-1 to 1): + * -1 = Least tolerant to loss-of-function (essential gene, higher safety concern) + * 1 = Most tolerant to loss-of-function (lower safety concern) + * 0 = Neutral constraint + - Safety Events (-1 or 0): + * -1 = Known adverse events, cancer driver genes, or significant safety concerns + * 0 = No known safety concerns + - Tissue Specificity (-1 to 1): + * Higher values = More tissue-specific expression (potentially safer, fewer off-target effects) + * -1 = Low specificity (expressed broadly, higher risk of off-target effects) + + Args: + ensembl_ids (List[str]): List of Ensembl gene IDs. + + Returns: + Dict[str, Any]: Dictionary where keys are Ensembl IDs and values are prioritization information or error details. + + Prioritization information includes: + - items: List of key-value pairs where keys are metric names (e.g., 'clinical_precedence', + 'predicted_tractability', 'mouse_ortholog') and values are the corresponding scores or assessments + get_target_safety_information: + type: function + agents: [safety_agent] + params: + description: |- + Retrieve safety liabilities and related information for a list of targets from the Open Targets GraphQL API. + + This function queries safety liabilities, biosamples, effects, studies, and literature for each target and returns a dictionary mapping each Ensembl ID to its safety information. + + Args: + ensembl_ids (List[str]): List of Ensembl gene IDs. + + Returns: + Dict[str, Any]: Dictionary where keys are Ensembl IDs and values are safety information or error details. + + Safety information includes: + - safetyLiabilities: List of safety events and effects + - biosamples: Details about cell and tissue samples + - effects: Dosing and direction of effects + - studies: Study metadata (name, type, description) + - datasource: Source of safety data + - literature: Related literature references + - url: Link to further information + get_target_tractability: + type: function + agents: [safety_agent] + params: + description: |- + Retrieve tractability assessment for a list of targets from the Open Targets GraphQL API. + + This function queries the tractability of each target, including antibody and small molecule tractability, and returns a dictionary mapping each Ensembl ID to its tractability data. + + Args: + ensembl_ids (List[str]): List of Ensembl gene IDs (e.g., ['ENSG00000141510']). + + Returns: + Dict[str, Any]: Dictionary where keys are Ensembl IDs and values are tractability information or error details. + + The tractability information includes: + - modality: Type of tractability (e.g., antibody, small molecule) + - value: Assessment value + - label: Human-readable label + search_disease_by_name: + type: function + agents: [root_agent, data_steward_agent] + params: + description: |- + Search for a disease by name using the Open Targets GraphQL API. + Returns the disease ID (EFO/MONDO ID) of the best match. + + Args: + disease_name: Disease name to search for (e.g., 'asthma', 'diabetes') + + Returns: + Disease ID of the best match (e.g., 'MONDO_0004979', 'EFO_0000270') + Returns None if no disease is found. + +teams: + root_agent: + type: hierarchy + agents: [root_agent, data_steward_agent, biologist_agent, safety_agent] + +imports: + '*': opentargets_agent.tools.safety_agent_tool.* + agent: agent + Agent: google.adk.agents.Agent + Any: typing.Any + biologist_agent: opentargets_agent.sub_agents.biologist.biologist_agent + data_steward_agent: opentargets_agent.sub_agents.data_steward.data_steward_agent + datetime: datetime + Dict: typing.Dict + get_disease_targets: opentargets_agent.tools.data_steward_tool.get_disease_targets + get_drugs_info: opentargets_agent.tools.data_steward_tool.get_drugs_info + get_target_drugs: opentargets_agent.tools.data_steward_tool.get_target_drugs + List: typing.List + requests: requests + safety_agent: opentargets_agent.sub_agents.safety_agent.safety_agent + search_disease_by_name: opentargets_agent.tools.data_steward_tool.search_disease_by_name + +functions: + get_disease_targets: + type: sync + module: opentargets_agent.tools.data_steward_tool + args: [disease_id, limit, return_ensembl_ids] + params: + returns: List[str] + get_drugs_info: + type: sync + module: opentargets_agent.tools.data_steward_tool + args: [drug_ids, search_by_name] + params: + returns: Dict + get_target_chemical_probes: + type: sync + module: opentargets_agent.tools.safety_agent_tool + args: [ensembl_ids] + params: + returns: Dict + get_target_drugs: + type: sync + module: opentargets_agent.tools.data_steward_tool + args: [target_ids, limit] + params: + returns: Dict + get_target_prioritization: + type: sync + module: opentargets_agent.tools.safety_agent_tool + args: [ensembl_ids] + params: + returns: Dict + get_target_safety_information: + type: sync + module: opentargets_agent.tools.safety_agent_tool + args: [ensembl_ids] + params: + returns: Dict + get_target_tractability: + type: sync + module: opentargets_agent.tools.safety_agent_tool + args: [ensembl_ids] + params: + returns: Dict + search_disease_by_name: + type: sync + module: opentargets_agent.tools.data_steward_tool + args: [disease_name] + params: + returns: str + search_drugs_by_name: + type: sync + module: opentargets_agent.tools.data_steward_tool + args: [drug_names, limit] + params: + returns: Dict + +networks: + api.platform.opentargets.org: + type: api + actions: [POST] + urls: [/api/v4/graphql] + protocols: [https] + ports: ["443"] + params: + caller: [get_target_tractability, get_target_chemical_probes, get_target_prioritization, get_target_safety_information, + get_disease_targets, get_target_drugs, search_disease_by_name, search_drugs_by_name, get_drugs_info]