Skip to content

Python bindings via PyO3 (import flowcat) #12

Description

@sathish-mg

Summary

In-process Python bindings via PyO3import flowcat, build a Pipeline in Python, and pass Python callables/objects as the AgentBrain (and tools) — so you can use Flowcat from Python in a single process, with no service to host.

This is on the roadmap (status: not yet started). Opening it as a tracking issue to gauge interest before prioritizing.

Today vs. this

Python can already drive Flowcat out-of-process: the RemoteBrain HTTP adapter (brain-http) runs your conversation policy as a small Python service, and the mcp client exposes Python functions as tools. That's the supported path today.

This issue is the in-process step — pip install flowcat, no HTTP hop for the control path, just Python objects.

Design intent

The binding keeps Python at turn granularity — conversation decisions and tool calls, never the per-audio-frame path — and releases the GIL during the Rust media loop, so the single-process tail-latency profile (no GC/GIL on the hot path) is preserved. The Rust media loop stays Rust; Python just decides what to say and when.

What it would unlock

  • import flowcat → build a pipeline and run a call from pure Python.
  • Pass a Python function/class as the brain; expose Python tools directly.
  • A low-friction migration path for teams coming from Python voice stacks.

👍 Vote / weigh in

We prioritize by demand:

  • React 👍 on this issue if you'd use Python bindings — that's the vote.
  • Comment with what you'd build and the API shape you'd want (sync vs async, callable brain vs subclass, how tools should be registered).
  • Want to help build it? Say so — it's well-scoped and high-leverage.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions