An extension of fabricatio, provide capablitities for thinking.
Project description
fabricatio-thinking
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
| Name | Description |
|---|---|
ThinkingConfig |
Frozen dataclass loaded via fabricatio_core.CONFIG.load("thinking", …). |
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
- The LLM proposes a
Thoughtfor the current step. - If the thought requests a revision (
revision=True+revises_thought), the VCS updates that prior commit. - If the thought requests a checkout (
checkout+branch), the VCS truncates the branch at the given step. - Otherwise, the thought is committed to the current branch.
- The loop repeats until
end=Trueormax_stepsis 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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file fabricatio_thinking-0.2.3-cp314-cp314-win_amd64.whl.
File metadata
- Download URL: fabricatio_thinking-0.2.3-cp314-cp314-win_amd64.whl
- Upload date:
- Size: 1.2 MB
- Tags: CPython 3.14, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8fa3aabc95ca5e8891d399bfdae3ab5163e9dbeff1a2c7825e7cd8c4471bf3e1
|
|
| MD5 |
01f4b6c11dc5f0053c3b97400ff714e3
|
|
| BLAKE2b-256 |
bcad9902ba798ac1b6db343ce1d1b180fefac2c84b2ab07f6da56b53dca93fd2
|
File details
Details for the file fabricatio_thinking-0.2.3-cp314-cp314-manylinux_2_34_x86_64.whl.
File metadata
- Download URL: fabricatio_thinking-0.2.3-cp314-cp314-manylinux_2_34_x86_64.whl
- Upload date:
- Size: 1.5 MB
- Tags: CPython 3.14, manylinux: glibc 2.34+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8a92443e03fef23c337a23d2cf8a208079fe1e6b2a76eed750e775dbbecd9bec
|
|
| MD5 |
06dcb40d7469afbe8d5832bccc9b2357
|
|
| BLAKE2b-256 |
5904c9df854e28f1355852fe8ffd47fd57a16fe74cd518fabedefc9fa31fef4a
|
File details
Details for the file fabricatio_thinking-0.2.3-cp314-cp314-manylinux_2_34_aarch64.whl.
File metadata
- Download URL: fabricatio_thinking-0.2.3-cp314-cp314-manylinux_2_34_aarch64.whl
- Upload date:
- Size: 1.4 MB
- Tags: CPython 3.14, manylinux: glibc 2.34+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
62fb1831b5f5a45b0e057b226b9ea2ac2dba9920331c9f603b1b97ab8cb773c9
|
|
| MD5 |
f63dce29cb8dd672f99c8c1757e894ac
|
|
| BLAKE2b-256 |
9c6cbde8fd004f7baf4e4b9c61da29269e37eca91b7c143561868962ce6aad94
|
File details
Details for the file fabricatio_thinking-0.2.3-cp314-cp314-macosx_11_0_arm64.whl.
File metadata
- Download URL: fabricatio_thinking-0.2.3-cp314-cp314-macosx_11_0_arm64.whl
- Upload date:
- Size: 1.3 MB
- Tags: CPython 3.14, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6ac3ad1769807c7ddeaa0b772009a125c019226b03fe3e7cc77127be89d670d9
|
|
| MD5 |
5f14e9b57324693a99c508d50bbc2571
|
|
| BLAKE2b-256 |
59948a1af823f99356f9c4b4b30ceb5d4861548ce7e513a8f3f8b22fcfc4801d
|
File details
Details for the file fabricatio_thinking-0.2.3-cp313-cp313-win_amd64.whl.
File metadata
- Download URL: fabricatio_thinking-0.2.3-cp313-cp313-win_amd64.whl
- Upload date:
- Size: 1.2 MB
- Tags: CPython 3.13, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d173100dab977937d80e5713816eba5f5e46c766af3f909a05c0db1fc464385e
|
|
| MD5 |
794af5efa114cb71c5ffd3ec9ea917a2
|
|
| BLAKE2b-256 |
7f442425a764a322957b1a1cfb6e875cfa9d07b925ab32931aeae022663a8cb4
|
File details
Details for the file fabricatio_thinking-0.2.3-cp313-cp313-manylinux_2_34_x86_64.whl.
File metadata
- Download URL: fabricatio_thinking-0.2.3-cp313-cp313-manylinux_2_34_x86_64.whl
- Upload date:
- Size: 1.5 MB
- Tags: CPython 3.13, manylinux: glibc 2.34+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a431392c1b7c63b5fe81132a8ec1d5b6c236eefdcec9dd06a7a202ea1a0f0b60
|
|
| MD5 |
bd880475e2779e5f0c29266bddd41f3b
|
|
| BLAKE2b-256 |
4023108117eb4dac0724e66c1adb804aece136589836dc030272e8e1743887de
|
File details
Details for the file fabricatio_thinking-0.2.3-cp313-cp313-manylinux_2_34_aarch64.whl.
File metadata
- Download URL: fabricatio_thinking-0.2.3-cp313-cp313-manylinux_2_34_aarch64.whl
- Upload date:
- Size: 1.4 MB
- Tags: CPython 3.13, manylinux: glibc 2.34+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2c63f7963458869b73f2f9301b2af381b8d2b6c429e1e2e026ac84ce2f3ae663
|
|
| MD5 |
5d84a25e65865a329d92ad50e2cf4af5
|
|
| BLAKE2b-256 |
80b1674452480c1a485305782bdb04606dc194e5058ce12125823cdfebbe682c
|
File details
Details for the file fabricatio_thinking-0.2.3-cp313-cp313-macosx_11_0_arm64.whl.
File metadata
- Download URL: fabricatio_thinking-0.2.3-cp313-cp313-macosx_11_0_arm64.whl
- Upload date:
- Size: 1.3 MB
- Tags: CPython 3.13, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bd40a122c3074377be83cfed75541e018190cd44be055ce0ae40f1864005ad25
|
|
| MD5 |
8b6158644235518097f520e71a977226
|
|
| BLAKE2b-256 |
1631e6fd552fc150d128eaf65af31f8ba681f3735a955336f8081e2ac344697c
|
File details
Details for the file fabricatio_thinking-0.2.3-cp312-cp312-win_amd64.whl.
File metadata
- Download URL: fabricatio_thinking-0.2.3-cp312-cp312-win_amd64.whl
- Upload date:
- Size: 1.2 MB
- Tags: CPython 3.12, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6cf3711f1fb43f63636ecf2a5c77276a92636e24bc2e4072f84c9c78f77b4c43
|
|
| MD5 |
b8ee59d238a5ca2a7d6e96ad3226374f
|
|
| BLAKE2b-256 |
f4cacfcf79168beb34b9e57e2659d567c80d2408f204370dd9153dba6ef40265
|
File details
Details for the file fabricatio_thinking-0.2.3-cp312-cp312-manylinux_2_34_x86_64.whl.
File metadata
- Download URL: fabricatio_thinking-0.2.3-cp312-cp312-manylinux_2_34_x86_64.whl
- Upload date:
- Size: 1.5 MB
- Tags: CPython 3.12, manylinux: glibc 2.34+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
03d3b9ae9ddf5d01282c95b3479ddaa8197750903e37f0cd75f91ac27cfc81a1
|
|
| MD5 |
4b152ef162ec9ce7e958f80cc580133c
|
|
| BLAKE2b-256 |
5784e17550407b79162e466ac4aa27312af4b17bcc1fab4adf88a9130cfe0c23
|
File details
Details for the file fabricatio_thinking-0.2.3-cp312-cp312-manylinux_2_34_aarch64.whl.
File metadata
- Download URL: fabricatio_thinking-0.2.3-cp312-cp312-manylinux_2_34_aarch64.whl
- Upload date:
- Size: 1.4 MB
- Tags: CPython 3.12, manylinux: glibc 2.34+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6d90d7569b5e72daedc28c8c8b28764b8e1380f6f3f0625b74598413f7470d68
|
|
| MD5 |
6ce6619611676d8455bc10bf66564929
|
|
| BLAKE2b-256 |
7661948316d0fe7f8fa70f87f89b8c6feff5e699ec9baf183b77923bf912c77a
|
File details
Details for the file fabricatio_thinking-0.2.3-cp312-cp312-macosx_11_0_arm64.whl.
File metadata
- Download URL: fabricatio_thinking-0.2.3-cp312-cp312-macosx_11_0_arm64.whl
- Upload date:
- Size: 1.3 MB
- Tags: CPython 3.12, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
32ef7bdbcd8d732ca1cf0ffb37547a9210fecec712dfdde5411fccd02f247f7e
|
|
| MD5 |
5fe56b85258881ad6c0266b3125d243b
|
|
| BLAKE2b-256 |
759405b324ee14ba7de15e72b5a62dc81b49833e65815147c1e9f2565bb2aaa3
|