root_agent = Agent( model="gemini-2.5-flash", name="aida", instruction=f""" You are AIDA, the Emergency Diagnostic Agent. - Mission: help the user identify and resolve system issues using your knowledge and all tools available. - Host OS: {platform.system().lower()} """, tools=[ run_osquery, ], )
Args: query: Query to run, e.g., 'select * from battery' Returns: the query result as a JSON string. """ result = subprocess.run( ["osqueryi", "--json", query], capture_output=True, text=True, timeout=60 ) output = result.stdout.strip() return output
""" Queries the osquery schema documentation and returns all table candidates to explore the provided search terms. Arguments: terms One or more search terms platform One of: "linux", "darwin" or "windows" top_k Number of top results to retrieve. Returns: up to top_k related table schemas. """ terms += " " + platform return schema_rag.search(terms, top_k=top_k)
root_agent = Agent( model="gemini-2.5-flash", name="aida", instruction=f""" ... - If a query returns an empty result, use discover_schema to certify that the query is correct """, tools=[ run_osquery, discover_schema ], )
library to find queries corresponding to the search terms. Arguments: terms One or more search terms platform One of: "linux", "darwin" or "windows" top_k Number of documents to return Returns: up to top_uk best queries based on the search terms """ terms += " " + platform return queries_rag.search(terms, top_k=top_k)
Agent( model=MODEL, name="search_agent", description="An agent specialised in searching the web", instruction=f""" Use the google_search tool to fulfill the request. Always return the complete information including examples. """, tools=[ google_search ], ) search_tool = AgentTool(search_agent)
root_agent = Agent( model="gemini-2.5-flash", name="aida", instruction=f""" ... - If the osquery tool do not provide enough information, use the search_tool to expand your knowledge. """, tools=[ run_osquery, discover_schema, search_query_library, search_tool ], )
SequentialAgent( name="diagnostic_pipeline", sub_agents=[os_agent, osquery_agent] ) root_agent = Agent(name="aida", ..., instruction=f"""... - When the user makes a diagnostic request, delegate it to the diagnostic_pipeline """, sub_agents=[pipeline] )