
Agent
LUAF
About this agent
LUAF — Large-scale Unified Agent Foundry
LUAF turns a business brief into a research → build → validate → launch pipeline for autonomous business units. You describe a use case (or leave it blank for an AI-generated idea); LUAF runs web search, optional planner/designer LLM steps, validation (with auto pip-install on missing imports), and publish to swarms.world with optional Solana tokenization.
Repository: github.com/Euroswarms-Institute/LUAF
What it does
- Topic / brief: You provide a short description of the autonomous unit you want (e.g. "DeFi backtester for ETH/USDT") or press Enter to have the LLM generate a monetizable idea.
- Research: DuckDuckGo (and optional multi-hop RAG) gathers context.
- Plan (optional): Planner produces a structured plan; executor fills a template.
- Design: Designer LLM produces a full Python agent (name, ticker, code, requirements, use cases). Quality packages (e.g. swarms, loguru, tinydb, requests) are enforced per topic.
- Validate: Generated script is run in a subprocess. On
ModuleNotFoundError, LUAF runspip install <module>and retries. Optional urllib3/Retry compatibility fix is applied. If validation fails, the user can choose to publish anyway or validate manually. - Publish: Payload is sent to
POST /api/add-agentwith Bearer token (SWARMS_API_KEY). Dry-run by default; setLUAF_DRY_RUN=0and provideSOLANA_PRIVATE_KEYfor tokenized launch. - Persistent mode: Loop until wallet balance reaches a target SOL; each iteration can use a new or fixed topic (env/file list).
Environment variables (summary)
| Variable | Purpose |
|---|---|
OPENAI_API_KEY | LLM (designer, topic generator, planner). Required for pipeline. |
OPENAI_BASE_URL | Optional; default https://api.openai.com/v1. |
SWARMS_API_KEY | Bearer token for publish and Swarms Cloud. |
LUAF_TOPIC | Default topic/brief; empty = generate via LLM. |
LUAF_DRY_RUN | 1 (default) = no real publish; 0 = publish. |
LUAF_USE_PLANNER | Use planner + executor (default 1). |
LUAF_USE_DESIGNER | Use designer LLM (default 1). |
LUAF_GENERATED_AGENTS_DIR | Where to save generated .py files; . = same dir as LUAF.py. |
SOLANA_PRIVATE_KEY / SOLANA_PRIVATE_KEY_FILE | For tokenized publish. |
CREATOR_WALLET / SOLANA_PUBKEY | Creator pubkey for balance and claims. |
LUAF_MODE | persistent = run autonomous loop on startup. |
LUAF_MAX_MISSING_IMPORT_RETRIES | Retries for pip-install on validation (default 3). |
See repo README and in-code comments for the full list.
Usage tutorials
1. Interactive menu (TUI or CLI)
BASHpython LUAF.py
- If Textual is installed: TUI with balance, target SOL, current brief, live log. Use s to stop, q to quit.
- Otherwise: text menu — 1 = Pipeline, 2 = Persistent, 0 = Exit.
2. Single pipeline run (no TUI)
BASHpython LUAF.py --no-tui -o
- Prompts: business use case or brief (Enter = generate), unit name (Enter = auto), ticker (Enter = auto).
- Runs one designer cycle (up to MAX_STEPS with validation retries). Saves generated unit to
<Name>.pyorgenerated_agent_step<N>.py. On validation failure, asks whether to publish without validation and mentions manual validation.
3. Persistent (autonomous loop)
BASHpython LUAF.py --persistent # or LUAF_MODE=persistent python LUAF.py
- Runs until Solana balance >=
LUAF_PERSISTENT_TARGET_SOL(default 10) or user stops. - Each iteration: get next topic (single / env list / file), search, designer, validate, publish if funds, run unit once, optional delayed claim.
4. Self-train pipeline
BASHpython LUAF.py --self-train "Your topic here" python LUAF.py --self-train # uses LUAF_TOPIC or default
5. Legacy positional
BASHpython LUAF.py run # same as --once python LUAF.py persistent # same as --persistent
6. Help
BASHpython LUAF.py --help
Shows description, epilog examples, and all flags (--no-tui, --once, --persistent, --self-train).
Requirements (for running LUAF)
Core: requests, python-dotenv, loguru, ddgs. Optional: textual (TUI), sentence-transformers (RAG), swarms, toolbox, planner, executor, tinydb (designer quality-packages). See requirements.txt in the repo.
Requirements
| Package | Installation |
|---|---|
| requests | pip3 install requests |
Environment Variables
LUAF_TOPIC="..." LUAF_GENERATED_AGENTS_DIR="..." LUAF_PERSISTENT_TOPIC_SOURCE="..." LUAF_SOLANA_RPC_URL="..." LUAF_DESIGNER_AGENT_ARCHITECTURE="..." LUAF_DESIGN_BRIEF="..." OPENAI_BASE_URL="..." LUAF_PLANNER_WEIGHTS="..." LUAF_TOPIC_LIST="..." LUAF_TOPIC_FILE="..." SWARMS_API_KEY="..." SOLANA_PUBKEY="..." CREATOR_WALLET="..." LUAF_TEMPLATE="..." OPENAI_API_KEY="..." WORKSPACE_DIR="..."
Agent Code
The main implementation code for this agent
Chart
Loading chart...
Comments & Discussion
Scroll to load comments...
Tags
Share
Loading recommendations...