A sample specialized agent implementation demonstrating how to integrate with oqtopus - the AI agent orchestration platform.
This project serves as a reference implementation for developers who want to create their own specialized agents that work with the oqtopus orchestrator. The example agent is a Movie Agent that answers movie-related queries using Google Gemini LLM.
┌────────────────────────────────────────────────────────────────────────┐
│ oqtopus.dev │
│ (Central Orchestrator Platform) │
└───────────────────────────────┬────────────────────────────────────────┘
│
JWT-Signed Request (via rotagent)
│
▼
┌────────────────────────────────────────────────────────────────────────┐
│ Example Agent │
│ ┌─────────────────────────────────────────────────────────────────┐ │
│ │ @auth.require_auth ← rotagent package verifies JWT signature │ │
│ │ /agent endpoint │ │
│ └─────────────────────────────────────────────────────────────────┘ │
│ │
│ ┌─────────────────────────────────────────────────────────────────┐ │
│ │ movie_agent_package/ │ │
│ │ ├── repository_layer/ → Data access (movies) │ │
│ │ └── service_layer/ → LLM integration (Gemini) │ │
│ └─────────────────────────────────────────────────────────────────┘ │
└────────────────────────────────────────────────────────────────────────┘
- Python 3.9+
- Google Gemini API Key (Get one here)
- rotagent package
git clone https://gitlab.com/yaruchyk.o/agent-example.git
cd example-agent
# Create virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install dependencies
pip install -r requrements.txt
pip install rotagentCreate a .env file in the project root:
# Required
GEMINI_API_KEY=your_gemini_api_key_here
# Data source - specifies which CSV file to load from static folder
FILE_NAME=movies.csv
# Optional: Set to 'development' to disable security checks during testing
APP_ENV=developmentThe agent's knowledge base is powered by CSV files stored in the static folder. You can easily customize what data your agent uses:
Place your CSV file in the movie_agent_package/static/ folder:
movie_agent_package/
└── static/
├── movies.csv # Default movie database
├── rental.csv # Alternative: rental properties data
└── your_data.csv # Your custom data file
CSV Format Requirements:
- Use semicolon (
;) as delimiter - First row should contain headers
- UTF-8 encoding recommended
Example CSV structure:
Title;Year;Genre;Rating
The Matrix;1999;Sci-Fi;8.7
Inception;2010;Thriller;8.8Change the FILE_NAME environment variable in your .env file:
# Use movie data
FILE_NAME=movies.csv
# Or switch to rental property data
FILE_NAME=rental.csv
# Or use your custom data
FILE_NAME=your_data.csvThe new data will be loaded and displayed on the home page, and the agent will use this data as context when answering queries.
💡 Tip: This makes it easy to repurpose this example agent for different domains - just swap the CSV file and update the
FILE_NAMEvariable!
python app.pyThe agent will start on http://127.0.0.1:5001
The agent uses JWT-based authentication powered by the rotagent library.
You can add a custom development key for local testing without registering on oqtopus:
Create a simple Python script or run in the Python REPL:
from rotagent import DevTools
# This will:
# 1. Create an 'authorized_keys' folder
# 2. Save the public key to 'authorized_keys/dev_postman.pem'
# 3. Print the private key to add to your .env file
DevTools.setup_persistent_keys(
keys_dir="authorized_keys",
issuer_id="dev_postman"
)Copy the printed DEV_PRIVATE_KEY=... line to your .env file.
from rotagent import DevTools
# Generate a Bearer token for testing
token, body = DevTools.generate_bearer_token(query="What are the best action movies?")Use this token in Postman, curl, or any HTTP client:
curl -X POST http://127.0.0.1:5001/agent \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_TOKEN_HERE" \
-d '{"query":"What are the best action movies?"}'- Register your agent at www.oqtopus.dev
- Download the
.pemfile provided after registration - Place the
.pemfile in yourauthorized_keys/directory
The filename will be {orchestrator_id}.pem, matching the issuer ID from oqtopus.
example_agent/
├── app.py # Flask application entry point
├── authorized_keys/ # Store public keys here (.pem files)
│ └── {issuer_id}.pem # Downloaded from oqtopus or generated locally
├── movie_agent_package/
│ ├── repository_layer/ # Data access layer
│ │ └── get_movies.py # Loads data from static folder
│ ├── service_layer/
│ │ └── gemini_llm.py # LLM wrapper for Gemini
│ └── static/ # 📊 YOUR DATA GOES HERE
│ ├── movies.csv # Movie database (default)
│ └── rental.csv # Real estate data (example)
├── templates/
│ └── index.html # Web UI - displays data from static folder
├── requrements.txt # Python dependencies
└── .env # Environment variables (not committed)
# ↳ FILE_NAME=movies.csv (controls which data to use)
Protected endpoint that processes queries from the orchestrator.
Headers:
Authorization: Bearer <JWT_TOKEN>(Required)Content-Type: application/json
Request Body:
{
"query": "What are the best sci-fi movies of 2023?",
"output_structure": "{\"found_answer\": bool, \"details\": {...}}" // Optional
}Response:
{
"result": {
"found_answer": true,
"details": {
"title": "Dune: Part Two",
"year": 2024,
"genre": "Science Fiction"
}
}
}Simple web UI to view movie data (no authentication required).
- Copy this repository as a template
- Replace
movie_agent_package/with your domain logic - Update the
/agentendpoint to process queries relevant to your domain - Register your agent at www.oqtopus.dev
The key requirement is implementing a /agent POST endpoint protected with @auth.require_auth from rotagent.
flask- Web frameworkrotagent- JWT authentication for agent-orchestrator communicationgoogle-genai- Google Gemini LLMpython-dotenv- Environment variable management
| Project | Description |
|---|---|
| oqtopus | The AI agent orchestration platform |
| rotagent | Authentication library for agents |
MIT License - See LICENSE for details.
Built for oqtopus.dev - The AI Agent Orchestration Platform