Skip to main content

fabricatio-thinking

MIT Python Versions PyPI Version PyPI Downloads PyPI Downloads Bindings: PyO3 Build Tool: uv + maturin

Sequential Chain-of-Thought reasoning for fabricatio agents, backed by a Rust-implemented version control system for thought management.


Installation

pip install fabricatio[thinking]
# or
uv pip install fabricatio[thinking]

For a full monorepo installation:

pip install fabricatio[full]

Overview

fabricatio-thinking provides structured, multi-step reasoning through a version-controlled thought process. Agents iterate through a chain of thoughts, with built-in support for revising past steps, branching into alternative reasoning paths, and managing the entire thought history via a lightweight VCS written in Rust.

Components

Capabilities

Name Description
Thinking ABC mixin (extends Propose) that adds the thinking() coroutine to any role.

Models

Name Description
Thought Pydantic model for a single reasoning step. Fields: thought (content), end (stop flag), serial (step number), estimated (expected total steps), revision, revises_thought, checkout, branch. Extends fabricatio_core.models.generic.SketchedAble.

Rust Bindings

Name Description
ThoughtVCS In-memory version control for thought chains. Each branch is an ordered list of commits.

Configuration

All options below are read through the fabricatio configuration chain (see the Configuration Guide). Set them under the [ext.thinking] table in fabricatio.toml, equivalently under [tool.fabricatio.ext.thinking] in pyproject.toml, or via FABRICATIO_EXT__THINKING__<FIELD_UPPER> environment variables.

[ext.thinking]

The ThinkingConfig schema currently defines no options and is reserved for future use.

Access at runtime: from fabricatio_thinking.config import thinking_config.

Usage

from fabricatio_thinking.capabilities.thinking import Thinking
from fabricatio_thinking.rust import ThoughtVCS
from fabricatio_core.capabilities.propose import Propose

class MyAgent(Propose, Thinking):
    """An agent that can reason step-by-step."""

async def reason():
    agent = MyAgent()
    vcs = ThoughtVCS()

    # Run a thinking process for up to 10 steps
    result_vcs = await agent.thinking(
        question="Explain the difference between TCP and UDP.",
        vcs=vcs,
        max_steps=10,
    )

    # Export the final chain as a list of strings
    chain = result_vcs.export_branch()
    for commit in chain:
        print(commit)

    # Or as a single formatted string
    print(result_vcs.export_branch_string())

How thinking() works

  1. The LLM proposes a Thought for the current step.
  2. If the thought requests a revision (revision=True + revises_thought), the VCS updates that prior commit.
  3. If the thought requests a checkout (checkout + branch), the VCS truncates the branch at the given step.
  4. Otherwise, the thought is committed to the current branch.
  5. The loop repeats until end=True or max_steps is reached.

ThoughtVCS API

Method Description
commit(content, serial, estimated, branch=None) Append a thought to a branch, creating the branch if it does not exist.
revise(content, serial, branch=None) Replace the content of an existing commit.
checkout(branch, serial) Truncate a branch to a specific commit (used for branching).
export_branch(branch=None) Return all commits as a list[str].
export_branch_string(branch=None) Return all commits as a single formatted string.

Dependencies

  • fabricatio-core — core interfaces (Propose, SketchedAble, CONFIG, loggers)

License

MIT — see LICENSE

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

fabricatio_thinking-0.2.4-cp314-cp314-win_amd64.whl (1.1 MB view details)

Uploaded CPython 3.14Windows x86-64

fabricatio_thinking-0.2.4-cp314-cp314-manylinux_2_34_x86_64.whl (1.4 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.34+ x86-64

fabricatio_thinking-0.2.4-cp314-cp314-manylinux_2_34_aarch64.whl (1.2 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.34+ ARM64

fabricatio_thinking-0.2.4-cp314-cp314-macosx_11_0_arm64.whl (1.2 MB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

fabricatio_thinking-0.2.4-cp313-cp313-win_amd64.whl (1.1 MB view details)

Uploaded CPython 3.13Windows x86-64

fabricatio_thinking-0.2.4-cp313-cp313-manylinux_2_34_x86_64.whl (1.4 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.34+ x86-64

fabricatio_thinking-0.2.4-cp313-cp313-manylinux_2_34_aarch64.whl (1.2 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.34+ ARM64

fabricatio_thinking-0.2.4-cp313-cp313-macosx_11_0_arm64.whl (1.2 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

fabricatio_thinking-0.2.4-cp312-cp312-win_amd64.whl (1.1 MB view details)

Uploaded CPython 3.12Windows x86-64

fabricatio_thinking-0.2.4-cp312-cp312-manylinux_2_34_x86_64.whl (1.4 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.34+ x86-64

fabricatio_thinking-0.2.4-cp312-cp312-manylinux_2_34_aarch64.whl (1.2 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.34+ ARM64

fabricatio_thinking-0.2.4-cp312-cp312-macosx_11_0_arm64.whl (1.2 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

File details

Details for the file fabricatio_thinking-0.2.4-cp314-cp314-win_amd64.whl.

File metadata

  • Download URL: fabricatio_thinking-0.2.4-cp314-cp314-win_amd64.whl
  • Upload date:
  • Size: 1.1 MB
  • Tags: CPython 3.14, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for fabricatio_thinking-0.2.4-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 5c6713b85966d5c264eea350e2cbfb0cbe005bca628fc37956eb0d7b7cef7706
MD5 1d8be034014867ad9e1c69e31d1dae7a
BLAKE2b-256 9e9be103a5bbd7dc0096edde687e69c5b02378bc714cc18753247840c93fa646

See more details on using hashes here.

File details

Details for the file fabricatio_thinking-0.2.4-cp314-cp314-manylinux_2_34_x86_64.whl.

File metadata

  • Download URL: fabricatio_thinking-0.2.4-cp314-cp314-manylinux_2_34_x86_64.whl
  • Upload date:
  • Size: 1.4 MB
  • Tags: CPython 3.14, manylinux: glibc 2.34+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for fabricatio_thinking-0.2.4-cp314-cp314-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 cbaa53c7b30a09d6baaa472f20555a7425de343f7ae2f5df7eb2e3685a112581
MD5 536dba11434b73bc47588e9fad2c1c7d
BLAKE2b-256 9f61e2bc4a0fdd9d1878d924dd964534821a760a83fc15c416bd2af217874df9

See more details on using hashes here.

File details

Details for the file fabricatio_thinking-0.2.4-cp314-cp314-manylinux_2_34_aarch64.whl.

File metadata

  • Download URL: fabricatio_thinking-0.2.4-cp314-cp314-manylinux_2_34_aarch64.whl
  • Upload date:
  • Size: 1.2 MB
  • Tags: CPython 3.14, manylinux: glibc 2.34+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for fabricatio_thinking-0.2.4-cp314-cp314-manylinux_2_34_aarch64.whl
Algorithm Hash digest
SHA256 57d402b03f0cb35c3bfb91ec18b9435a457fdd5588a5831ae2b067a4ed6b1257
MD5 6c7b053fb8c42426c9442bfc20fa780d
BLAKE2b-256 9494bae5d2df60858e9f2390c9b420a8cca1a758c18672a4e40c5b201971e289

See more details on using hashes here.

File details

Details for the file fabricatio_thinking-0.2.4-cp314-cp314-macosx_11_0_arm64.whl.

File metadata

  • Download URL: fabricatio_thinking-0.2.4-cp314-cp314-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 1.2 MB
  • Tags: CPython 3.14, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for fabricatio_thinking-0.2.4-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 4840cd3f44d5cc1ca99af401b6854d504eec885a99e67b8c6a6cf88a1d8d9894
MD5 7c23572a17bfd1df24d330680466d0c0
BLAKE2b-256 51c0845a3cded1560fdefd641140bb8de849d56a0f5ba08be0cff83b0a0cf95c

See more details on using hashes here.

File details

Details for the file fabricatio_thinking-0.2.4-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: fabricatio_thinking-0.2.4-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 1.1 MB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for fabricatio_thinking-0.2.4-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 ba24c234f63ad2c86b80f186052b088a00c17759c6327b4cd36360d521efd471
MD5 a0c5677bff898e6db0768c7c9ecc5e37
BLAKE2b-256 2eff1bb776a37055ee4853a1bbbf00b26a5364d09dac7b57274879a6488f438c

See more details on using hashes here.

File details

Details for the file fabricatio_thinking-0.2.4-cp313-cp313-manylinux_2_34_x86_64.whl.

File metadata

  • Download URL: fabricatio_thinking-0.2.4-cp313-cp313-manylinux_2_34_x86_64.whl
  • Upload date:
  • Size: 1.4 MB
  • Tags: CPython 3.13, manylinux: glibc 2.34+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for fabricatio_thinking-0.2.4-cp313-cp313-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 7b0f73326e0b7ec4c4b860d7e581f3b80c4cc517741a751fdc7c7d17450313cc
MD5 f87ed6e4ad683e7ef63a5366d7176675
BLAKE2b-256 801587202d2843de043a02acd393035a140af85a71623509e5fbe02ff0a39489

See more details on using hashes here.

File details

Details for the file fabricatio_thinking-0.2.4-cp313-cp313-manylinux_2_34_aarch64.whl.

File metadata

  • Download URL: fabricatio_thinking-0.2.4-cp313-cp313-manylinux_2_34_aarch64.whl
  • Upload date:
  • Size: 1.2 MB
  • Tags: CPython 3.13, manylinux: glibc 2.34+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for fabricatio_thinking-0.2.4-cp313-cp313-manylinux_2_34_aarch64.whl
Algorithm Hash digest
SHA256 85957a3f9b8ba1f0b787404670bdd56e0518701196031d945d969b414286915a
MD5 25d4a1cdd37857202074f566560ac7ee
BLAKE2b-256 b1a4291700c6a3458ca7d85769b9558abf37b8b520a8db90e4c2dbffc75e5813

See more details on using hashes here.

File details

Details for the file fabricatio_thinking-0.2.4-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

  • Download URL: fabricatio_thinking-0.2.4-cp313-cp313-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 1.2 MB
  • Tags: CPython 3.13, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for fabricatio_thinking-0.2.4-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 30d0cbd98886afa605ed095554371abfabb5b59ce71ec8c511676fcd68b8e628
MD5 db15b17d33987fdb2435a6b4003f4d69
BLAKE2b-256 ab6d5b57eaabdf95e67eed8f39c1a2270328c9e895e64e825b3dbc920403a7cf

See more details on using hashes here.

File details

Details for the file fabricatio_thinking-0.2.4-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: fabricatio_thinking-0.2.4-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 1.1 MB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for fabricatio_thinking-0.2.4-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 9f9af139ae0f2982925c26623d800ef6bd81a426674cc4ef0bb75770ff27e0f0
MD5 c36bf312394f64d07172f77212ef7703
BLAKE2b-256 0df7630e85d8a4d5b79bf084e062487973b1c0446d578316ddf7a0e4bed99ef4

See more details on using hashes here.

File details

Details for the file fabricatio_thinking-0.2.4-cp312-cp312-manylinux_2_34_x86_64.whl.

File metadata

  • Download URL: fabricatio_thinking-0.2.4-cp312-cp312-manylinux_2_34_x86_64.whl
  • Upload date:
  • Size: 1.4 MB
  • Tags: CPython 3.12, manylinux: glibc 2.34+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for fabricatio_thinking-0.2.4-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 50d8d591398b9c2019620e9cb174d68abb317bde1b014ad62a787c3fdc349b5f
MD5 60cd662cfd96024fef3d0191723a18a7
BLAKE2b-256 e491bd329d6f413ae78635eba7461f9aec550df77eb6436bf5fcbb40950c5655

See more details on using hashes here.

File details

Details for the file fabricatio_thinking-0.2.4-cp312-cp312-manylinux_2_34_aarch64.whl.

File metadata

  • Download URL: fabricatio_thinking-0.2.4-cp312-cp312-manylinux_2_34_aarch64.whl
  • Upload date:
  • Size: 1.2 MB
  • Tags: CPython 3.12, manylinux: glibc 2.34+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for fabricatio_thinking-0.2.4-cp312-cp312-manylinux_2_34_aarch64.whl
Algorithm Hash digest
SHA256 65aa7c477c939496e9c183c5f323e1ccd7237aa31149ec395979af1df8481345
MD5 95928f54af1b6815a208c02dca57d5c2
BLAKE2b-256 d060150fc786d65e0302d844bab94caf0d94e755dd53aa3501cc28c7b10ac66e

See more details on using hashes here.

File details

Details for the file fabricatio_thinking-0.2.4-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

  • Download URL: fabricatio_thinking-0.2.4-cp312-cp312-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 1.2 MB
  • Tags: CPython 3.12, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for fabricatio_thinking-0.2.4-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 2d4b83b1e3c1d92e8b61f3c73827e4a7ff33f25ef7f6f3db31b8897a0de29d68
MD5 02ec35087a08827e90c560ebcfa454bf
BLAKE2b-256 5f8ffd1d09d04f7091107ac96fc74be5ffdc55227e0dc51589b8b9254a9c1e8b

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.2.4 This release

12 files

0.2.3

12 files

0.2.2

12 files

0.2.1

12 files

0.2.0

12 files

0.1.3

12 files

0.1.2

8 files

0.1.1

8 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page