Skip to content

About

Fibona Agent is a minimal, general-purpose, self-improving agent that writes its own code as it runs.

Topics

Resources

Stars

94 stars

Watchers

1 watching

Forks

Repository files navigation

Fibona Agent

Website X GitHub YouTube

Fibona Agent is a minimal, general-purpose, self-improving agent that writes its own code as it runs.

It starts with only a tiny, general-purpose core, which we define as its "self." From this core, it can build its entire system step by step, becoming whatever it needs to be to get the task done. When something goes wrong, it can repair itself and return to a working state autonomously.

Project Page · Video Intro · Tech Report · Online Demo

Demos

Try the online demo in your browser.

iPhone GR21 Console to desktop Trading terminal
iOS.mp4
Desktop.mp4
Trading.mp4

iOS source and build instructions

Fibona Agent in Chrome: extension source and installation

Quick start

Requires Python 3.12+ and uv.

  1. Create a .env file in the project root:

    FIBONA_API_KEY=your-api-key
    FIBONA_BASE_URL=https://api.openai.com/v1
    FIBONA_MODEL=gpt-6-astra

    Set FIBONA_MODEL to your model ID; it defaults to gpt-6-astra. Set FIBONA_BASE_URL to use an OpenAI-compatible gateway. call_me uses the OpenAI Responses API in stateless mode: it sends the full context each round with store=False. Returned usage sums the API-reported tokens, cache details, and provider-reported cost across requests. To continue across calls, include the earlier input and returned r.output in the next input; previous_response_id is not supported. To receive encrypted reasoning for replay, pass include=["reasoning.encrypted_content"]. The agent is given that reference's URL and looks it up when needed; the reference also documents stateful features that call_me does not support.

  2. Choose a startup mode and run it from the project root:

    • Start the terminal UI from the project root:

      uv run --env-file .env fibona.py --boot-mode terminal

      See the terminal bootstrap README for its design and controls.

    • Or start in the minimal mode and let the agent build its own chat TUI:

      uv run --env-file .env fibona.py --boot-mode minimal \
        "Build and launch a premium chat TUI in this terminal.
        I want to use it to chat with you.
        The TUI should feature refined dark colors, generous spacing, elegant rendering,
        clear activity status, and multiline input. Press Enter to send messages.
        Keep me updated as you build it."

      Omit the task to enter it interactively.

    • To define your own startup behavior, write your bootstrap cell in ./your_custom_bootstrap.py, then run:

      uv run --env-file .env fibona.py --boot-mode ./your_custom_bootstrap.py

Use --reasoning-effort high to set the default for call_me, and --lowest-reasoning-effort medium to set its minimum. Both default to medium and accept none, minimal, low, medium, high, xhigh, or max. Requests below the minimum are raised to it, including the default. The selected model must support the chosen effort.

Each run automatically records cells and every model request, response, or error (including intermediate tool calls) in logs/<timestamp>-<run-id>.jsonl.

Use the core as a library

From another uv project, add a local checkout:

uv add /path/to/fibona-agent

Core executes the Python source supplied to Agent.run as the bootstrap cell in a persistent session. Cells share variables and call call_me when they need the model to choose the next cell. Configure the client, model, working directory and input/output in your application:

import os
import sys

from openai import OpenAI
from core.agent import Agent, Mind, INSTRUCTIONS
from core.env import IPythonEnv

bootstrap_cell = """
task = input("Your task: ")
call_me(input=task)
"""

with OpenAI(
    api_key=os.environ["FIBONA_API_KEY"],
    base_url=os.getenv("FIBONA_BASE_URL", "https://api.openai.com/v1"),
) as client:
    mind = Mind(client=client, model=os.getenv("FIBONA_MODEL", "gpt-6-astra"), instructions=INSTRUCTIONS)
    env = IPythonEnv(stdout=sys.stdout, stderr=sys.stderr, read_input=input)
    Agent(mind, cwd=".").run(bootstrap_cell, env=env)

Development

Enable Ruff checks before each commit:

uv run pre-commit install

The hooks run Ruff lint and format checks on staged files. Errors block the commit.

To check all tracked files manually:

uv run pre-commit run --all-files

Citation

If you use Fibona Agent in your research, please cite it as follows:

@misc{fibonaagent2026,
  title        = {{Fibona Agent: Self-Improving Agent Writing Itself From Scratch}},
  author       = {{FibonaAI Team}},
  year         = {2026},
  howpublished = {GitHub repository},
  url          = {https://github.com/FibonaAI/fibona-agent}
}

License

This project is licensed under the MIT License.

About

Fibona Agent is a minimal, general-purpose, self-improving agent that writes its own code as it runs.

Topics

Resources

Stars

94 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages