ANTHROPIC_API_KEY
.
Setup your virtual environment
Install dependencies
Export your Anthropic key
Run the agent
yfinance
library.
Install new dependencies
Run the agent
debug_mode=True
or export pinax_DEBUG=true
to see the system prompt, user messages and tool calls.ReasoningTools
is one of the best “hacks” to improve the Agents’s response quality.
Dynamic Few-Shot Learning: Text2Sql Agent
UrlKnowledge
will download the Pinaxai documentation and load it into a LanceDB vector database, using OpenAI for embeddingsReasoningTools
to reason about the user’s question.OPENAI_API_KEY
and run the Agent
Install new dependencies
Run the agent
Storage
drivers will help you save Agent sessions and state in a database. Model APIs are stateless and storage enables us to continue conversations from where they left off, by storing chat history and state in a database.
In this example, we’ll use the SqliteStorage
driver to save the Agent’s session history and state in a database.
We’ll also set the session_id
to a fixed value to demo persistence. Run this example multiple times to see the conversation continue from where it left off.
Install new dependencies
Run the agent
Memory
drivers enable Agents to store and recall information about users from previous interactions, allowing them to learn user preferences and personalize their responses.
In this example, we’ll use the v2 Memory driver to store user memories in a Sqlite database.
Because memories are tied to a user, we’ll set the user_id
to a fixed value to build a persona for the user.
route
, coordinate
and collaborate
.
In this example, we’ll build a team of 2 agents to analyze the semiconductor market performance, reasoning step by step.
Install dependencies
Run the agent
debug_mode=True
on any agent or set pinax_DEBUG=true
in your environment.