How it Works
The agent is built using the following components, which you can find in thecookbook/clinical_trials directory:
`trialsagent.py`
The main script that creates and runs the agent. It initializes the
a1facts tool, which acts as the bridge between the agent and the knowledge graph.`trials.yaml`
This file defines the schema of our knowledge graph. It specifies the types of entities (e.g.,
ClinicalTrial, Drug, Condition) and the relationships between them.`sources.yaml`
This file configures the external data sources that the agent can query for information about clinical trials.
trialsagent.py, it initializes an agent with the a1facts tool. The agent is then asked a complex query about clinical trials. The a1facts tool uses the information from trials.yaml and sources.yaml to understand the query, fetch relevant data, and then synthesize a precise answer.
Running the Example
1
Set up your environment
Create a
.env file in the a1facts/cookbook/clinical_trials directory and add your API keys:.env
2
Run the agent
Navigate to the
a1facts/cookbook/clinical_trials directory and run the following command:3
Expected Output
The agent will run the query and print a detailed answer to the console, consolidating information from the knowledge graph and external sources to address the complex query about clinical trials.