single-file-agents  by disler

Single-file agents for specific tasks

created 5 months ago
388 stars

Top 75.0% on sourcepulse

GitHubView on GitHub
Project Summary

This repository provides a collection of single-file Python agents designed for specific tasks, leveraging modern GenAI models from OpenAI, Anthropic, and Gemini. It targets developers and researchers looking for practical, prompt-engineered AI solutions that are easy to deploy and integrate. The primary benefit is the ability to quickly utilize powerful, focused AI capabilities without complex project setups.

How It Works

The agents are built as self-contained Python files, utilizing the uv package installer for efficient dependency management. Each agent focuses on a single task, such as querying databases (DuckDB, SQLite), processing JSON with jq, generating meta-prompts, editing files and executing bash commands, or performing web scraping. The design emphasizes precise prompt engineering and leverages the function-calling or tool-use capabilities of various LLMs to achieve specific outcomes.

Quick Start & Requirements

  • Install uv: curl -LsSf https://astral.sh/uv/install.sh | sh
  • Clone repo: git clone <repository-url>
  • Set API Keys: export GEMINI_API_KEY='...', export OPENAI_API_KEY='...', export ANTHROPIC_API_KEY='...', export FIRECRAWL_API_KEY='...'
  • Prerequisites: Python 3.8+, uv, jq (macOS: brew install jq), DuckDB CLI (macOS: brew install duckdb).
  • Example Usage: uv run sfa_jq_gemini_v1.py --exe "..." or uv run sfa_duckdb_openai_v2.py -d ./data/analytics.db -p "..."
  • Documentation: README.md, CLAUDE.md, ai_docs/*

Highlighted Details

  • Self-contained agents in single Python files.
  • Support for Gemini, OpenAI, and Anthropic LLMs.
  • Demonstrates precise prompt engineering for practical tasks.
  • Utilizes uv for fast dependency resolution and execution.

Maintenance & Community

The project is maintained by IndyDevDan, with shout-outs to the uv team and Simon Willison for inspiration. Further resources and related projects are linked in the README.

Licensing & Compatibility

MIT License. Permissive for use in other projects, with a request for a shout-out to the author's YouTube channel.

Limitations & Caveats

Some agents are noted as "buggy but usually works" (e.g., sfa_duckdb_gemini_v2.py). The term "agent" is used loosely for some scripts, which may represent prompt chains rather than full agents.

Health Check
Last commit

3 months ago

Responsiveness

Inactive

Pull Requests (30d)
0
Issues (30d)
1
Star History
69 stars in the last 90 days

Explore Similar Projects

Feedback? Help us improve.