Skip to main content

Frank brings order and helps you build complex LLM workflows using scalable, testable, and reusable components.

Project description

🧟 frankstate

CI pypi license downloads versions

frankstate is a lightweight pattern layer for assembling LangGraph workflows with clearer structure, stronger boundaries, and less duplicated graph wiring.

It does not replace LangGraph and it does not introduce a separate runtime. The compiled result is still a native LangGraph graph built with official LangGraph primitives.

What The Package Provides

The published package focuses on reusable workflow assembly contracts:

  • WorkflowBuilder to compile a graph from a layout class.
  • GraphLayout to separate runtime dependency construction from graph declaration.
  • SimpleNode, CommandNode, ToolGraphNode, SimpleEdge, and ConditionalEdge to model graph structure.
  • StateEnhancer, StateEvaluator, and StateCommander to keep node and routing logic aligned with LangGraph concepts.
  • NodeManager and EdgeManager to normalize layout declarations into LangGraph registration calls.

Public API

The package root intentionally exports only:

from frankstate import WorkflowBuilder

All other reusable contracts should be imported from subpackages, usually from their concrete modules:

from frankstate.entity.graph_layout import GraphLayout
from frankstate.entity.node import SimpleNode, CommandNode, ToolGraphNode
from frankstate.entity.edge import SimpleEdge, ConditionalEdge
from frankstate.entity.statehandler import StateEnhancer, StateEvaluator, StateCommander
from frankstate.entity.runnable_builder import RunnableBuilder
from frankstate.managers.node_manager import NodeManager
from frankstate.managers.edge_manager import EdgeManager

Installation

With pip:

pip install frankstate

With uv:

uv pip install frankstate

Optional example dependencies:

pip install frankstate[examples]

The published wheel contains only frankstate. Repository-level reference code, service integrations, notebooks, and tests are not part of the base package.

Minimal Example

from frankstate import WorkflowBuilder
from my_project.layouts.simple_graph import SimpleGraphLayout
from my_project.state import GraphState

workflow_builder = WorkflowBuilder(
    config=SimpleGraphLayout,
    state_schema=GraphState,
)

graph = workflow_builder.compile()

LangGraph Alignment

frankstate keeps the official LangGraph execution model:

  • StateEnhancer wraps node logic that returns partial state updates.
  • StateEvaluator wraps the callable used by conditional edges.
  • StateCommander wraps nodes that return official LangGraph Command objects.

The compiled graph still relies on LangGraph's own StateGraph, add_node(), add_edge(), add_conditional_edges(), and Command.

Repository Boundaries

If you are browsing the repository instead of the published package:

  • src/frankstate is the reusable package.
  • src/core_examples is the repository reference layer.
  • src/services contains repository integrations and deployment entrypoints.

Those repository layers help demonstrate how frankstate can be consumed, but they are not the stable public API of the base wheel.

Runnable Builders

The following structure

RunnableBuilder is a recommended way to organize LangChain LCEL builders inside a layout. Optional capabilities can be added through cooperative multiple inheritance using mixins:

Mixin Adds
PromptMixin Enforces a _build_prompt(**kwargs) hook
RetrieverMixin Lazily initialized retriever from a vectordb or pre-built retriever

Mix and match to get exactly the capability each builder needs — no base class carries attributes it does not use:

ChatBuilder   → PromptMixin, RunnableBuilder                   # prompt + model
RAGBuilder    → RetrieverMixin, PromptMixin, RunnableBuilder   # retriever + prompt + model
AgentBuilder  → PromptMixin, RunnableBuilder                   # prompt + tools (tools stored in subclass)

Working examples live in src/core_examples/components/runnables/.

Project details


Download files

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

Source Distribution

frankstate-0.2.1.tar.gz (22.2 kB view details)

Uploaded Source

Built Distribution

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

frankstate-0.2.1-py3-none-any.whl (18.4 kB view details)

Uploaded Python 3

File details

Details for the file frankstate-0.2.1.tar.gz.

File metadata

  • Download URL: frankstate-0.2.1.tar.gz
  • Upload date:
  • Size: 22.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for frankstate-0.2.1.tar.gz
Algorithm Hash digest
SHA256 c0678a73ff15ce223fc86872ae4ee5bc497caac0170d742d62ec21b1387300e2
MD5 a2c2318f5dc453a57b496b78a9cc44a7
BLAKE2b-256 2333b5d33029227a72553d04476a9999c2c88dcc46fd4eb98531eb83bbbe3c4a

See more details on using hashes here.

Provenance

The following attestation bundles were made for frankstate-0.2.1.tar.gz:

Publisher: release.yml on aamaragones/frankenst-ai

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file frankstate-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: frankstate-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 18.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for frankstate-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 93d04cce12014036e9e586f901cb2c98a61b60f5e309d8ba16fc1b71a876b78a
MD5 f3684774011c0420b33fbb4a797790b2
BLAKE2b-256 a48a6bc32c61b4885c5fdf6f3d8475a7db4e594f7a76b4529b1481a3a01c2cb8

See more details on using hashes here.

Provenance

The following attestation bundles were made for frankstate-0.2.1-py3-none-any.whl:

Publisher: release.yml on aamaragones/frankenst-ai

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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