Hi Phidata community!
I’m exploring ways to modify an agent’s system prompt after initialization but before the first user message. Here’s my current setup:
from phi.agent import Agent
from phi.model.anthropic import Claude
from phi.tools.duckduckgo import DuckDuckGo
web_agent = Agent(
name="Web Agent",
model=Claude(id=CLAUDE_MODEL_ID, api_key=ANTHROPIC_API_KEY, temperature=0.1),
tools=[DuckDuckGo()],
instructions=["Always include sources"],
show_tool_calls=True,
markdown=True,
)
I’ve tried adding instructions after initialization like this:
web_agent.instructions=["Always include sources", "New instruction added after init"]
However, I’m not sure if this is the correct approach or if there’s a better way to modify the system prompt before the first user interaction.