# Fibona Agent

> A minimal, open-source, self-improving agent that writes its own code as it runs and repairs itself after errors.

Fibona Agent is an open-source agent from Fibona AI that starts from a tiny general-purpose core and builds the rest of its system by writing Python code as it runs. The project page describes the core as about 200 lines of Python, and the repository is MIT licensed. It can be run from a terminal, used as a library, or tried in an online browser demo.

## What It Is

Fibona Agent is a minimal, general-purpose, self-improving agent. Instead of a host loop that picks one pre-registered tool per turn, the model writes Python "Cells" in a persistent session. Each Cell can register the next Cell to run, or call the model again with only the context it chooses to pass along. The project page contrasts this with the typical ReAct pattern, where the host owns the loop and the full history grows every turn.

## How the Loop Works

The host only executes code: when a Cell finishes, it runs the Cell that was registered next. Cells share variables, and a `call_me` function hands control back to the model to choose the next Cell. According to the project page, the model has two host tools plus the whole interpreter, and when errors occur it runs recovery Cells until three fail in a row. The run ends only when the user asks to quit.

## Setup Path

The quick start requires Python 3.12+ and `uv`, with an OpenAI-compatible API key and optional custom base URL and model name set in a `.env` file. There are several startup modes:

- A terminal UI boot mode.
- A minimal mode where the agent is given a task, such as building its own chat TUI.
- A custom bootstrap cell supplied by the user.

The core can also be added to another `uv` project and driven through `Agent.run` with an IPython-based environment. The repository additionally references iOS and Chrome extension experiments and demos including an iPhone GR21 demo, a console-to-desktop demo and a trading terminal.

## Features
- Self-writing agent that builds its system from a minimal core
- Self-repair with recovery Cells after errors
- Model-written Python Cells executed in a persistent session
- Terminal UI, minimal, and custom bootstrap modes
- Usable as a Python library via Agent.run
- Configurable OpenAI-compatible model and API endpoint
- Online browser demo
- Chrome extension and iOS experiments

## Integrations
OpenAI API, uv, IPython

## Platforms
IOS, WEB, API, DEVELOPER_SDK, CLI

## Pricing
Open Source

## Links
- Website: https://fibona.ai/projects/fibona-agent
- Documentation: https://github.com/FibonaAI/fibona-agent
- Repository: https://github.com/FibonaAI/fibona-agent
- EveryDev.ai: https://www.everydev.ai/tools/fibona-agent
