Define the Agent
guava.Agent is our starting point for building Guava agents. We’ll start by creating one with some basic background details.
Guava discourages long system prompts that try to cover every scenario. The
purpose is intentionally short and designed to orient the agent.Set up DocumentQA
Next, we initialize aDocumentQA instance with the policy document. DocumentQA is a built-in RAG that covers a lot of simple use cases. It’s a fully pluggable component
and we expect many users will bring their own RAG system.
Handle questions with on_question
Whenever the caller asks something the agent cannot answer from context alone, Guava invokes theon_question callback with the question in natural language. We forward it to DocumentQA and return the answer.
on_question implementation.
Bring your own RAG. The
on_question callback receives a plain string and expects a plain string back — you can plug in any knowledge base, vector store, or model you prefer.Start the agent
Finally, we attach the agent to a channel so that we can actually talk to it.No web servers required. Guava does not require a public web server to receive inbound calls. All Guava agents can be hosted behind firewalls and NATs.