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

Metadata

Release files for fabricatio-thinking 0.2.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for fabricatio-thinking 0.2.4
File
fabricatio_thinking-0.2.4-cp314-cp314-win_amd64.whl CPython 3.14 CPython 3.14 Windows x86-64 Details
fabricatio_thinking-0.2.4-cp314-cp314-manylinux_2_34_x86_64.whl CPython 3.14 CPython 3.14 Linux glibc 2.34+ x86-64 Details
fabricatio_thinking-0.2.4-cp314-cp314-manylinux_2_34_aarch64.whl CPython 3.14 CPython 3.14 Linux glibc 2.34+ ARM64 Details
fabricatio_thinking-0.2.4-cp314-cp314-macosx_11_0_arm64.whl CPython 3.14 CPython 3.14 macOS 11.0+ ARM64 Details
fabricatio_thinking-0.2.4-cp313-cp313-win_amd64.whl CPython 3.13 CPython 3.13 Windows x86-64 Details
fabricatio_thinking-0.2.4-cp313-cp313-manylinux_2_34_x86_64.whl CPython 3.13 CPython 3.13 Linux glibc 2.34+ x86-64 Details
fabricatio_thinking-0.2.4-cp313-cp313-manylinux_2_34_aarch64.whl CPython 3.13 CPython 3.13 Linux glibc 2.34+ ARM64 Details
fabricatio_thinking-0.2.4-cp313-cp313-macosx_11_0_arm64.whl CPython 3.13 CPython 3.13 macOS 11.0+ ARM64 Details
fabricatio_thinking-0.2.4-cp312-cp312-win_amd64.whl CPython 3.12 CPython 3.12 Windows x86-64 Details
fabricatio_thinking-0.2.4-cp312-cp312-manylinux_2_34_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.34+ x86-64 Details
fabricatio_thinking-0.2.4-cp312-cp312-manylinux_2_34_aarch64.whl CPython 3.12 CPython 3.12 Linux glibc 2.34+ ARM64 Details
fabricatio_thinking-0.2.4-cp312-cp312-macosx_11_0_arm64.whl CPython 3.12 CPython 3.12 macOS 11.0+ ARM64 Details

Total release size: 14.7 MB

Release files / fabricatio_thinking-0.2.4-cp314-cp314-win_amd64.whl

Download URL fabricatio_thinking-0.2.4-cp314-cp314-win_amd64.whl
Size 1.1 MB
Tags CPython 3.14 Windows x86-64
SHA-256 checksum
How to use checksums
5c6713b85966d5c264eea350e2cbfb0cbe005bca628fc37956eb0d7b7cef7706
BLAKE2b-256 checksum
How to use checksums
9e9be103a5bbd7dc0096edde687e69c5b02378bc714cc18753247840c93fa646
Upload date
Uploaded using Trusted Publishing?
What is 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}

Release files / fabricatio_thinking-0.2.4-cp314-cp314-manylinux_2_34_x86_64.whl

Download URL fabricatio_thinking-0.2.4-cp314-cp314-manylinux_2_34_x86_64.whl
Size 1.4 MB
Tags CPython 3.14 Linux glibc 2.34+ x86-64
SHA-256 checksum
How to use checksums
cbaa53c7b30a09d6baaa472f20555a7425de343f7ae2f5df7eb2e3685a112581
BLAKE2b-256 checksum
How to use checksums
9f61e2bc4a0fdd9d1878d924dd964534821a760a83fc15c416bd2af217874df9
Upload date
Uploaded using Trusted Publishing?
What is 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}

Release files / fabricatio_thinking-0.2.4-cp314-cp314-manylinux_2_34_aarch64.whl

Download URL fabricatio_thinking-0.2.4-cp314-cp314-manylinux_2_34_aarch64.whl
Size 1.2 MB
Tags CPython 3.14 Linux glibc 2.34+ ARM64
SHA-256 checksum
How to use checksums
57d402b03f0cb35c3bfb91ec18b9435a457fdd5588a5831ae2b067a4ed6b1257
BLAKE2b-256 checksum
How to use checksums
9494bae5d2df60858e9f2390c9b420a8cca1a758c18672a4e40c5b201971e289
Upload date
Uploaded using Trusted Publishing?
What is 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}

Release files / fabricatio_thinking-0.2.4-cp314-cp314-macosx_11_0_arm64.whl

Download URL fabricatio_thinking-0.2.4-cp314-cp314-macosx_11_0_arm64.whl
Size 1.2 MB
Tags CPython 3.14 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
4840cd3f44d5cc1ca99af401b6854d504eec885a99e67b8c6a6cf88a1d8d9894
BLAKE2b-256 checksum
How to use checksums
51c0845a3cded1560fdefd641140bb8de849d56a0f5ba08be0cff83b0a0cf95c
Upload date
Uploaded using Trusted Publishing?
What is 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}

Release files / fabricatio_thinking-0.2.4-cp313-cp313-win_amd64.whl

Download URL fabricatio_thinking-0.2.4-cp313-cp313-win_amd64.whl
Size 1.1 MB
Tags CPython 3.13 Windows x86-64
SHA-256 checksum
How to use checksums
ba24c234f63ad2c86b80f186052b088a00c17759c6327b4cd36360d521efd471
BLAKE2b-256 checksum
How to use checksums
2eff1bb776a37055ee4853a1bbbf00b26a5364d09dac7b57274879a6488f438c
Upload date
Uploaded using Trusted Publishing?
What is 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}

Release files / fabricatio_thinking-0.2.4-cp313-cp313-manylinux_2_34_x86_64.whl

Download URL fabricatio_thinking-0.2.4-cp313-cp313-manylinux_2_34_x86_64.whl
Size 1.4 MB
Tags CPython 3.13 Linux glibc 2.34+ x86-64
SHA-256 checksum
How to use checksums
7b0f73326e0b7ec4c4b860d7e581f3b80c4cc517741a751fdc7c7d17450313cc
BLAKE2b-256 checksum
How to use checksums
801587202d2843de043a02acd393035a140af85a71623509e5fbe02ff0a39489
Upload date
Uploaded using Trusted Publishing?
What is 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}

Release files / fabricatio_thinking-0.2.4-cp313-cp313-manylinux_2_34_aarch64.whl

Download URL fabricatio_thinking-0.2.4-cp313-cp313-manylinux_2_34_aarch64.whl
Size 1.2 MB
Tags CPython 3.13 Linux glibc 2.34+ ARM64
SHA-256 checksum
How to use checksums
85957a3f9b8ba1f0b787404670bdd56e0518701196031d945d969b414286915a
BLAKE2b-256 checksum
How to use checksums
b1a4291700c6a3458ca7d85769b9558abf37b8b520a8db90e4c2dbffc75e5813
Upload date
Uploaded using Trusted Publishing?
What is 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}

Release files / fabricatio_thinking-0.2.4-cp313-cp313-macosx_11_0_arm64.whl

Download URL fabricatio_thinking-0.2.4-cp313-cp313-macosx_11_0_arm64.whl
Size 1.2 MB
Tags CPython 3.13 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
30d0cbd98886afa605ed095554371abfabb5b59ce71ec8c511676fcd68b8e628
BLAKE2b-256 checksum
How to use checksums
ab6d5b57eaabdf95e67eed8f39c1a2270328c9e895e64e825b3dbc920403a7cf
Upload date
Uploaded using Trusted Publishing?
What is 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}

Release files / fabricatio_thinking-0.2.4-cp312-cp312-win_amd64.whl

Download URL fabricatio_thinking-0.2.4-cp312-cp312-win_amd64.whl
Size 1.1 MB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
9f9af139ae0f2982925c26623d800ef6bd81a426674cc4ef0bb75770ff27e0f0
BLAKE2b-256 checksum
How to use checksums
0df7630e85d8a4d5b79bf084e062487973b1c0446d578316ddf7a0e4bed99ef4
Upload date
Uploaded using Trusted Publishing?
What is 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}

Release files / fabricatio_thinking-0.2.4-cp312-cp312-manylinux_2_34_x86_64.whl

Download URL fabricatio_thinking-0.2.4-cp312-cp312-manylinux_2_34_x86_64.whl
Size 1.4 MB
Tags CPython 3.12 Linux glibc 2.34+ x86-64
SHA-256 checksum
How to use checksums
50d8d591398b9c2019620e9cb174d68abb317bde1b014ad62a787c3fdc349b5f
BLAKE2b-256 checksum
How to use checksums
e491bd329d6f413ae78635eba7461f9aec550df77eb6436bf5fcbb40950c5655
Upload date
Uploaded using Trusted Publishing?
What is 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}

Release files / fabricatio_thinking-0.2.4-cp312-cp312-manylinux_2_34_aarch64.whl

Download URL fabricatio_thinking-0.2.4-cp312-cp312-manylinux_2_34_aarch64.whl
Size 1.2 MB
Tags CPython 3.12 Linux glibc 2.34+ ARM64
SHA-256 checksum
How to use checksums
65aa7c477c939496e9c183c5f323e1ccd7237aa31149ec395979af1df8481345
BLAKE2b-256 checksum
How to use checksums
d060150fc786d65e0302d844bab94caf0d94e755dd53aa3501cc28c7b10ac66e
Upload date
Uploaded using Trusted Publishing?
What is 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}

Release files / fabricatio_thinking-0.2.4-cp312-cp312-macosx_11_0_arm64.whl

Download URL fabricatio_thinking-0.2.4-cp312-cp312-macosx_11_0_arm64.whl
Size 1.2 MB
Tags CPython 3.12 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
2d4b83b1e3c1d92e8b61f3c73827e4a7ff33f25ef7f6f3db31b8897a0de29d68
BLAKE2b-256 checksum
How to use checksums
5f8ffd1d09d04f7091107ac96fc74be5ffdc55227e0dc51589b8b9254a9c1e8b
Upload date
Uploaded using Trusted Publishing?
What is 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}
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page