Fzkuji/OpenProgram
Self-Programming AI Assistant. Capture, automate, and refine all your workflows.
OpenProgram – Self‑Programming AI Assistant
What it is – OpenProgram is a Python‑based framework that lets you write agentic functions: ordinary Python functions whose docstrings become the system prompt for a large language model (LLM). The LLM is called via a tiny llm() helper, while the surrounding logic stays in deterministic Python. In this way the framework blends the flexibility of LLM reasoning with the safety and reproducibility of code.
Why it matters – The authors call the approach Agentic Programming: the LLM supplies judgment where you can’t script it, and Python supplies the hard‑coded, verifiable steps. The framework supplies four core mechanisms that together enable multi‑agent, self‑modifying workflows:
| Mechanism | What it gives you |
|---|---|
| Agentic Function | Turn any Python function into an LLM‑backed tool. The docstring is the prompt, arguments are inputs, and llm() makes the model call. |
| DAG Context | All users, LLM calls, and function executions are nodes on a single directed‑acyclic graph. You can spawn_branch, fork, or message_branch to run sub‑agents with isolated context, even in separate Git worktrees. |
| Agentic Workflow | Code‑level gates validate model output; if validation fails the model is forced to re‑decide. Agents can edit their own @agentic_function files, which are hot‑reloaded, enabling self‑evolution without special “create/fix” APIs. |
| Event Infrastructure | A process‑wide event bus (Event(type, payload, ts)) lets any subsystem (auth, memory, UI, etc.) publish and subscribe to events, making it easy to build proactive behaviours. |
How you get it – A one‑line installer pulls pre‑built binaries for macOS, Linux, and Windows (CLI/server + optional Web UI). Example:
curl -fsSL https://openprogram.io/install | sh # macOS / Linux
# or on Windows PowerShell
irm https://openprogram.io/install.ps1 | iex
After installation, running openprogram launches a provider‑setup wizard (choose Anthropic, OpenAI, Gemini, etc.) and drops you into a terminal chat. openprogram web starts the built‑in Web UI at http://localhost:18100.
Quick example – A ticket‑triage agent:
@agentic_function
def triage(ticket: str) -> str:
"""Classify the ticket as bug / feature / question and draft a reply."""
kind = llm(ticket, choices=["bug", "feature", "question"]) # LLM decides
if kind == "bug":
logs = search_logs(ticket) # ordinary Python
return llm(f"Reply using:\n{logs}")
return llm("Draft a short reply.")
The function reads like normal Python; the only LLM call is the llm() line, and the rest of the flow is fully testable.
Integrated harnesses – OpenProgram ships a small ecosystem of plug‑in “harnesses” that expose ready‑made agents:
- GUI‑Agent‑Harness – screenshot‑based desktop automation.
- Research‑Agent‑Harness – literature search, experiment orchestration, paper drafting.
- Scriptorium – persistent, source‑cited Markdown memory store.
You can install any of them with
openprogram programs install <owner>/<repo>.
Typical use‑cases
- Automating repetitive office workflows (email triage, ticket routing, report generation).
- Building self‑modifying assistants that can add new tools on the fly.
- Coordinating multiple agents that need isolated contexts (e.g., parallel research runs).
- Prototyping agentic software where you want strict validation of LLM output.
Status & community – The project is actively maintained (latest release includes a built‑in browser UI, multi‑agent spawning, and provider key rotation). It is open‑source under AGPL‑3.0, and contributions are welcomed via GitHub issues and pull requests.
Citation – If you use OpenProgram in research, cite the KDD 2026 workshop paper:
@inproceedings{qi2026llmascode,
title={LLM-as-Code: Agentic Programming for Agent Harness},
author={Qi, Junjia and Fu, Zichuan and Gao, Jingtong and Zhang, Wenlin and Yan, Hanyu and Wu, Xian and Zhao, Xiangyu},
booktitle={KDD 2026 Workshop on Agentic Software Engineering (AgenticSE)},
year={2026},
eprint={2606.15874},
archivePrefix={arXiv},
url={https://arxiv.org/abs/2606.15874}
}
License – AGPL‑3.0 (any derivative that is distributed or offered as a network service must also be AGPL‑licensed).
OpenProgram aims to give developers the best of both worlds: the creativity of LLMs and the reliability of code, all wrapped in a single, extensible Python framework.
Related
- Project
- Project
- Project
- Project
- Project