This example demonstrates how to use a1facts
to build a simple financial analyst agent that can answer questions about companies.
cookbook/stock_analysis
directory:
a1facts
tool, which acts as the bridge between the agent and the knowledge graph.Company
, Product_Service
) and the relationships between them (e.g., competes_with
).infoagent.py
, it initializes an agent with the a1facts
tool. The agent is then asked a question: "what do you know about how UnitedHealth competes with CVS?"
. The a1facts
tool uses the information from company.yaml
and sources.yaml
to understand the query, fetch relevant data from the external APIs, and then provide a precise answer.
Set up your environment
.env
file in the a1facts/cookbook/stock_analysis
directory and add your API keys:Run the agent
a1facts/cookbook/stock_analysis
directory and run the following command:Expected Output