Skip to main content

SOFIA: Simple Orchestrated Flow Intelligence Agent

Project description

👩‍💼 SOFIA: Simple Orchestrated Flow Intelligence Agent

SOFIA is an open-source, configurable multi-step agent framework for building advanced LLM-powered assistants. Define your agent's persona, tools, and step-by-step flows in Python or YAML—perfect for conversational, workflow, and automation use cases.

Features

  • Step-based agent flows: Define agent behavior as a sequence of steps, each with its own tools and transitions.
  • Persona-driven: Easily set the agent's persona for consistent, branded responses.
  • Tool integration: Register Python functions as tools for the agent to call.
  • YAML or Python config: Configure agents via code or declarative YAML.
  • OpenAI and custom LLM support
  • Session management: Save and resume conversations.
  • Extensible: Build your own tools, steps, and integrations.
  • Interactive CLI: Bootstrap new agents with sofia init (install with [cli] extra).

Installation

From PyPI (coming soon)

pip install sofia-agent

With CLI support

pip install sofia-agent[cli]

From Source

git clone https://github.com/chandralegend/sofia.git
cd sofia
poetry install

Usage

CLI: Bootstrap a New Agent

sofia init

This will interactively guide you to create a config YAML and starter Python file for your agent.

Python API Example

from sofia.core import Sofia
from sofia.llms import OpenAIChatLLM
from sofia.models.flow import Step, Route

def get_time():
    from datetime import datetime
    return f"Current time: {datetime.now()}"

steps = [
    Step(
        step_id="start",
        description="Greet and offer to tell the time.",
        available_tools=["get_time"],
        routes=[Route(target="end", condition="User is done")],
    ),
    Step(
        step_id="end",
        description="Say goodbye.",
    ),
]

llm = OpenAIChatLLM()
agent = Sofia(
    name="clockbot",
    llm=llm,
    steps=steps,
    start_step_id="start",
    tools=[get_time],
    persona="You are a friendly clock assistant.",
)
sess = agent.create_session()
# ... interact with sess.next(user_input)

YAML Config Example

See examples/config.barista.yaml for a full-featured barista agent.

Configuration

  • Persona: Set in YAML or Python for consistent agent style.
  • Steps: Each step defines available tools, description, and routes to other steps.
  • Tools: Python functions registered with the agent.

Example: Barista Agent

A full example is provided in examples/barista.py and examples/config.barista.yaml.

Contributing

Contributions are welcome! Please open issues or pull requests on GitHub.

License

MIT License. See LICENSE.

Acknowledgements

  • Inspired by the open-source LLM community.
  • Built with ❤️ by contributors.

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

sofia_agent-0.1.3.tar.gz (10.1 kB view details)

Uploaded Source

Built Distribution

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

sofia_agent-0.1.3-py3-none-any.whl (12.8 kB view details)

Uploaded Python 3

File details

Details for the file sofia_agent-0.1.3.tar.gz.

File metadata

  • Download URL: sofia_agent-0.1.3.tar.gz
  • Upload date:
  • Size: 10.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for sofia_agent-0.1.3.tar.gz
Algorithm Hash digest
SHA256 edade2e8f655da92d63b456b6df22ac84c46c5edc89d3f4a5095e5535c8da37c
MD5 f66024800ae64fa2d9b24203871bf25e
BLAKE2b-256 ad9324e1b803aa807bdf3484cb7b3f556fe9058ad04b0106568a8b1664516d8f

See more details on using hashes here.

Provenance

The following attestation bundles were made for sofia_agent-0.1.3.tar.gz:

Publisher: publish.yml on chandralegend/sofia

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

File details

Details for the file sofia_agent-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: sofia_agent-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 12.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for sofia_agent-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 4f73ee731f017c3c3921b63443db8b3aafc8ffa2e3a0679e7335a182d1de23b7
MD5 3114ba9e42d46d3347378a936fb6d2e1
BLAKE2b-256 8998e6f9c8ac757f7d0a0a2dd97324bb5b0c879b122d59e8e5146b6881d7c2e1

See more details on using hashes here.

Provenance

The following attestation bundles were made for sofia_agent-0.1.3-py3-none-any.whl:

Publisher: publish.yml on chandralegend/sofia

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