This example demonstrates how to create and use an Upsonic Agent to research AI governance terms and provide structured educational content. The example showcases how to leverage Upsonic’s web search integration to gather authoritative information and generate comprehensive explanations with FAQs.Documentation Index
Fetch the complete documentation index at: https://docs.upsonic.ai/llms.txt
Use this file to discover all available pages before exploring further.
Overview
Upsonic framework provides seamless integration for AI agents with web search capabilities. This example showcases:- Agent Integration — Using Upsonic Agent with specialized system prompts for educational content
- Web Research — Using DuckDuckGo for real-time AI governance term research
- Structured Output — Pydantic schemas for consistent, machine-readable responses
- Educational Content — Generating detailed explanations and FAQs for complex terms
- FastAPI Server — Running the agent as a production-ready API server
- Researches AI governance terms using web search
- Provides comprehensive, accessible explanations
- Generates relevant FAQs with detailed answers
- Returns structured, validated output
Project Structure
Environment Variables
You can configure the model using environment variables:Installation
Managing Dependencies
api, streamlit, development
Usage
Option 1: Run Directly
Option 2: Run as API Server
http://localhost:8000. API documentation at /docs.
Example API call:
How It Works
| Component | Description |
|---|---|
| Agent | Upsonic Agent configured as AI Governance Lexicon Expert |
| Web Search Tool | DuckDuckGo integration for researching terms |
| System Prompt | Specialized prompt for educational content generation |
| Output Schema | Pydantic model ensuring structured responses |
| Task Execution | Research → Synthesis → Structured Output |
Example Output
Query:Complete Implementation
main.py
agent.py
tools.py
schemas.py
upsonic_configs.json
Key Features
Agent Configuration
The agent is configured with a specialized system prompt that guides it to:- Research terms using web search tools
- Provide comprehensive, accessible explanations
- Generate relevant FAQs with detailed answers
- Ensure accuracy through authoritative sources
Web Search Integration
Uses DuckDuckGo search tool to:- Find current definitions and frameworks
- Gather best practices and real-world applications
- Verify information from authoritative sources
- Stay up-to-date with industry practices
Structured Output
Pydantic schemas ensure:- Consistent response format
- Type validation
- Machine-readable output
- Clear documentation of expected structure
Educational Focus
The agent is designed to:- Explain complex terms in accessible language
- Provide practical examples and applications
- Generate relevant FAQs for learning
- Cover both technical and non-technical aspects
Example Queries
- “Gap analysis for AI governance”
- “Model interpretability techniques”
- “EU AI Act compliance requirements”
- “AI safety frameworks”
- “Algorithmic bias mitigation”

