This example demonstrates how to use a1facts
to build an agent that can answer questions about clinical trials from various sources.
cookbook/clinical_trials
directory:
a1facts
tool, which acts as the bridge between the agent and the knowledge graph.ClinicalTrial
, Drug
, Condition
) and the relationships between them.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.
Set up your environment
.env
file in the a1facts/cookbook/clinical_trials
directory and add your API keys:Run the agent
a1facts/cookbook/clinical_trials
directory and run the following command:Expected Output