Building a Financial Conversational Agent with Agno and Maxim
Learn how to build a multi-agent financial conversational assistant using Agno for agent orchestration and Maxim for observability and tracing.
In this cookbook, you’ll learn how to build a multi-agent financial conversational assistant using
Agno for agent orchestration and
Maxim for observability and tracing. The agent can answer questions
about stocks, companies, and financial data by leveraging both web search and financial data tools,
with all interactions traced in Maxim.
This agent uses an LLM and Google Search tools to fetch financial information from the web.
Copy
Ask AI
web_search_agent = Agent( name="Web Agent", role="Search the web for information", # model=Gemini(id="gemini-2.0-flash-001"), model=OpenAIChat(id="gpt-4o"), tools=[GoogleSearchTools()], instructions="Always include sources", show_tool_calls=True, markdown=True,)
Combine both agents into a multi-agent system that can answer user questions by leveraging both web
search and financial data tools.
Copy
Ask AI
multi_ai_agent = Agent( team=[web_search_agent, finance_agent], # model=Gemini(id="gemini-2.0-flash-001"), model=OpenAIChat(id="gpt-4o"), instructions="You are a helpful financial assistant. Answer user questions about stocks, companies, and financial data.", show_tool_calls=True, markdown=True)
6. Interactive Loop for the Financial Conversational Agent
This loop allows users to input queries and receive responses from the multi-agent system.
Copy
Ask AI
if __name__ == "__main__": print("Welcome to the Financial Conversational Agent! Type 'exit' to quit.") messages = [] while True: print("********************************") user_input = input("You: ") if user_input.strip().lower() in ["exit", "quit"]: print("Goodbye!") break messages.append({"role": "user", "content": user_input}) conversation = "\n".join([ ("User: " + m["content"]) if m["role"] == "user" else ("Agent: " + m["content"]) for m in messages ]) response = multi_ai_agent.run( f"Conversation so far:\n{conversation}\n\nRespond to the latest user message." ) agent_reply = getattr(response, "content", response) print("---------------------------------") print("Agent:", agent_reply) messages.append({"role": "agent", "content": str(agent_reply)})
All agent interactions, tool calls, and responses are automatically traced and can be visualized in
your Maxim dashboard. This provides deep insights into agent reasoning,
tool usage, and user interactions.For more details, see the Agno documentation and the
Maxim Python SDK documentation.