Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

Repository files navigation

super-handoff

Triage incoming natural-language prompts to the best-suited specialist agent, then execute with automatic web search support. Prompts are sourced from a curated list and converted into runnable agents; a lightweight triage agent decides which specialist to hand off to.

Highlights

  • Automatic prompt catalog: Uses prompts.csv (downloaded on first run from the Hugging Face dataset fka/awesome-chatgpt-prompts).
  • Agent handoffs: Builds a set of specialist agents and triages to the right one via handoff.
  • Web search tool: Agents can search the web for up-to-date context.
  • Session persistence: Uses a SQLite-backed session for continuity during a run.

Requirements

  • Python 3.13+
  • An OpenAI API key
  • Internet access (first run downloads the prompt catalog; web search requires network)

Install (with uv)

We recommend using uv for dependency management.

  1. Install uv (Windows PowerShell):
irm https://astral.sh/uv/install.ps1 | iex
  1. Sync dependencies:
uv sync

This reads pyproject.toml and installs:

  • openai-agents (agent runtime, tools, runner)
  • pandas, fsspec, fastparquet (data utilities)
  • huggingface-hub (to fetch the prompt dataset)

Configuration

Create a .env file in the project root with your keys:

OPENAI_API_KEY=sk-...
# Optional: depending on your configured web search provider/tooling
# TAVILY_API_KEY=...
# SERPAPI_API_KEY=...

The app loads environment variables via python-dotenv.

Run

From the project root:

uv run python .\main.py

You will be prompted to type a task or question. The system will triage it, execute the selected agent (with web search when useful), and print the final output.

On first run, if prompts.csv is not present, it will be downloaded automatically and saved locally.

How it works

  • Loads (or downloads) prompts.csv describing “acts” and their instructions.
  • Creates a specialist agent for each row using openai-agents with the WebSearchTool enabled.
  • Wraps each specialist in a handoff target with an on_handoff callback and an input schema.
  • Creates a triage agent that chooses which handoff to invoke for the user’s prompt.
  • Uses Runner.run_sync to execute and prints final_output.

Data sources

  • Prompts: Hugging Face dataset fka/awesome-chatgpt-prompts

Troubleshooting

  • No output or auth errors: ensure OPENAI_API_KEY is set in .env and your shell session.
  • Download issues on first run: ensure internet access; try running again.
  • Web search errors: set a supported search API key if required by your environment.
  • Python version: ensure you are on Python 3.13+ (see .python-version).

Notes

  • Running the model and web search may incur costs with your API provider(s).
  • The CLI loop runs until you press Ctrl+C.

Acknowledgements

  • Prompt dataset by the community via fka/awesome-chatgpt-prompts on Hugging Face.
  • Agent runtime and tools via the openai-agents Python package.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages