Skip to main content

A easy way to create structured AI agents

Project description

Flo: Composable AI Agents

Flo gives you a composable framework for creating agentic AI architectures. What we intent to do here is to create an easy framework for AI app developers to compose apps using pre-implemented architectural components, at the same time providing the flexibilty to create their own components.

What is composibility ?

Composility is the ability to use smaller components to build bigger apps. In a composible architecture, you will be given smaller building blocks which you can use to build a bigger applications. It is every similar to how legos work, you are given smaller lego blocks which when put together creates a whole structure.

What are the building blocks in Flo ?

In flo, we tried to put togther a system where we have small micro components like vector store, or simple LLM prompts, and then higher components/arhictectures made of these mico components like RAGs, Agentic Teams etc.

Flo vs langraph/langchain

Flo is built with langraph under the stood. So everything that works in langraph still works here, including all tools and architectures. The following makes flo easy to implement:

  1. Langraph needs good understanding of underlying graph and states, its more of a raw tool and asks developers to implement the required artitectures. While flo is more usecase friendly and components can be easily used by using the flo classes, which has lot of internal abstraction for ease of use.

  2. In every AI component that has gone in production their are lot of nuances that needs to be implemented to get production quality output, flo inherently implements the best architecutures and gives then out of the box, you can enable and disable as you wish. This not only reduces the complexity but also improves the time to iterate solutions

  3. Every component in flo is combosable meaning you can easily put them together and flo takes care of routing between the components where as in langraph the developer has to tie these up.

How to use

Flo supports two ways to set up and run the components, first is through code. This is much more flexible. This can help you write your own tools and add them to the flo.

Second way it to use yaml. You can write an yaml to define your agentic workflow or RAG and it compiles into a application. See examples below

Building your first agent by structured yaml

To create a small team of researcher + blogger for writing blogs

# This yaml defines a team of 2 agents + 1 supervisor
yaml_data = """
apiVersion: flo/alpha-v1
kind: FloRoutedTeam
name: blogging-team
team:
    name: BloggingTeam
    router:
        name: TeamLead
        kind: supervisor
    agents:
      - name: Researcher
        prompt: Do a research on the internet and find articles of relevent to the topic asked by the user, always try to find the latest information on the same
        tools:
        - name: TavilySearchResults
      - name: Blogger
        prompt: From the documents provider by the researcher write a blog of 300 words with can be readily published, make in engaging and add reference links to original blogs
        tools:
        - name: TavilySearchResults
"""

input_prompt = """
Question: Write me an interesting blog about latest advancements in agentic AI
"""

llm = ChatOpenAI(temperature=0, model_name='gpt-4o')

# Register all the tools at some place and use everywhere in the yaml
session = FloSession(llm).register_tool(
    name="TavilySearchResults", 
    tool=TavilySearchResults()
)

# Build the final flow and run it
flo: Flo = Flo.build_with_yaml(session, yaml=yaml_data)

# call invoke or stream
for s in flo.stream(input_prompt)

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

flo_ai-0.0.1.tar.gz (14.1 kB view details)

Uploaded Source

Built Distribution

flo_ai-0.0.1-py3-none-any.whl (18.9 kB view details)

Uploaded Python 3

File details

Details for the file flo_ai-0.0.1.tar.gz.

File metadata

  • Download URL: flo_ai-0.0.1.tar.gz
  • Upload date:
  • Size: 14.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.4 Darwin/22.6.0

File hashes

Hashes for flo_ai-0.0.1.tar.gz
Algorithm Hash digest
SHA256 77a494c0d59e17028c343381fa298dafb060daf8bb3e90c4d88eac1a57233444
MD5 a204ffbd5ac7381edb4747a42ce2db44
BLAKE2b-256 59fb67226f1c4cd6f13b7503c6b20061f6f6c2ded0a48e3cd5d59b1274dac7e9

See more details on using hashes here.

File details

Details for the file flo_ai-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: flo_ai-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 18.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.4 Darwin/22.6.0

File hashes

Hashes for flo_ai-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2a32db3d7920825b6f5992d9d527b822d0be74d54c2d6ccbe1160fd2afa29877
MD5 e30ce34a9b34adf58094cfacadf97be5
BLAKE2b-256 79406a0fbd2e4ee1a46acde1df6a5ba8a12a403a85a48213366f6b01675a2a4b

See more details on using hashes here.

Supported by

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