Find answers from the community

Updated 3 months ago

Sys prompt

At a glance

The community member is asking how to control the SYS prompt of the ReAct Agent. Another community member suggests that the prompt is large due to the React loop instructions, but it can be viewed and overridden with caution. They recommend injecting extra context into the existing system prompt instead. Another community member notes that the agent doesn't do well at outlining the output format, and they tried passing in a model schema but it was ignored. They want to know if there are any known best practices or benchmarks for using the context. The original community member clarifies that they are trying to use the ReActAgent, as it has proven to be the most reliable at calling the right tools. They need to pass instructions based on the context where the agent is being initialized, such as "Return the financial metric and its unit" or "return a single line response". A final community member recommends using the FunctionCallingAgent instead, as it allows setting an actual system prompt and doesn't rely on large prompting instructions.

Useful resources
Hi @Logan M! Is there an easy way to control the ReAct Agent's SYS prompt?
L
b
8 comments
It's pretty big because it has all the react loop instructions, but you can view it and override it (override with caution though, if you remove the instructions completely, it wont work very lol)

https://docs.llamaindex.ai/en/stable/examples/agent/react_agent/#view-prompts

What you probably really want is to just inject some extra context into the existing system prompt
ReActAgent.from_tools(...., context="some context")
Seems like it doesn't do very well on outlining the output format. I tried passing in a model schema but it seems to ignore it altogether. Wanted to see if there are any known unknowns or benchmarks on how to best make use of this context?
What are you trying to tell it to do?
(and which LLM class? You might not need react tbh)
I am trying to use ReActAgent. It has as of now proved the most reliable with calling the right tools.

What do you recommend?
I have a set of tools and based on when the context where the agent is being initialized I need to pass instructions, e.g. "Return the financial metric and its unit", "return a single line response"
Depending on the LLM class you are using, I would use FunctionCallingAgent. You can set an actual system prompt then too, since it doesn't rely on giant prompting instructions to generate an output
Thanks @Logan M you are the best!
Add a reply
Sign up and join the conversation on Discord