<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: octopus inc</title>
    <description>The latest articles on DEV Community by octopus inc (@octopus_inc_3b25ac16c5131).</description>
    <link>https://dev.to/octopus_inc_3b25ac16c5131</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2077267%2F7df06d2a-f7ee-43fb-b34a-a2ffa72a1d59.png</url>
      <title>DEV Community: octopus inc</title>
      <link>https://dev.to/octopus_inc_3b25ac16c5131</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/octopus_inc_3b25ac16c5131"/>
    <language>en</language>
    <item>
      <title>Create agentic systems by just describing what you want.</title>
      <dc:creator>octopus inc</dc:creator>
      <pubDate>Sun, 10 Nov 2024 18:45:38 +0000</pubDate>
      <link>https://dev.to/octopus_inc_3b25ac16c5131/create-agentic-systems-by-just-describing-what-you-want-bic</link>
      <guid>https://dev.to/octopus_inc_3b25ac16c5131/create-agentic-systems-by-just-describing-what-you-want-bic</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Agentic AI is a growing trend among developers and companies wanting to get the most out of intelligent machines. There is a growing list of impacful use cases, from marketing automation to customer support and beyond. &lt;/p&gt;

&lt;p&gt;However, building agentic systems today is still a cumbersome process, even for seasoned AI engineers. Most frameworks, like langchain, crewAI introduce unnecessary abstrations that make debugging difficult. In fact, many people prefer to write their code from scratch after a few frustated attempts. &lt;/p&gt;

&lt;p&gt;But can LLMs themselves help to write code for agentic systems, and hence reduce the pain of development? In principle yes, like any other code. But current frameworks are not optimized for that: because they are excessively verbose, the LLM spends an unnecessary amount of tokens and brainpower generating classes, calling methods, which are needed for the framework itself, while beign unrelated to the workflow logic.&lt;/p&gt;

&lt;h2&gt;
  
  
  GenSphere: a programming language designed for LLMs to use while coding
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://github.com/octopus2023-inc/gensphere" rel="noopener noreferrer"&gt;GenSphere is an open-source&lt;/a&gt;, python-based project that enables developers to define AI workflows using simple YAML files, outlining the tasks and their connections without delving into the procedural complexities. Each node in the workflow represents a high-level operation — be it a function call, an LLM API request, or another nested workflow. By abstracting the execution logic, GenSphere lets you focus on orchestrating sophisticated AI applications declaratively.&lt;/p&gt;

&lt;p&gt;Because the YAML files are an economical description of workflow logic, which abstract away the execution code, one can use LLMs themselves to generate those files from high-level prompts. The LLM will spend their output tokens and brainpower fully on implementing the workflow logic instead of writing code. This opens the possibility of building full-fledged text-to-agents workflows.&lt;/p&gt;

&lt;h2&gt;
  
  
  How GenSphere works
&lt;/h2&gt;

&lt;p&gt;On GenSphere, you build LLM applications with YAML files, that define an execution graph. Nodes can be either LLM API calls, regular function executions or other graphs themselves.&lt;/p&gt;

&lt;p&gt;Because you can nest graphs easily, building complex applications is not an issue, but at the same time you don’t lose control. The YAML basically states what are the tasks that need to be done and how they connect. Other than that, you only write individual python functions to be called during the execution. No new classes and abstractions to learn.&lt;/p&gt;

&lt;h2&gt;
  
  
  Generate agentic systems by prompting
&lt;/h2&gt;

&lt;p&gt;As GenSphere projects are defined by simple YAML files (and their associated functions and schemas) one can &lt;strong&gt;use LLMs themselves to generate those files&lt;/strong&gt;. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/octopus2023-inc/gensphere/blob/main/examples/agentic_workflows_from_prompts.ipynb" rel="noopener noreferrer"&gt;This Google Colab example shows how to&lt;/a&gt; use a GenSphere project from the public Hub to take a task.txt file as input and output another GenSphere project that accomplishes that task. You can then run that GenSphere project to get your final output. &lt;/p&gt;

&lt;p&gt;The example in the notebook uses the following task as input:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Your task is to generate script for 10 YouTube videos, about 5 minutes long each.
Our aim is to generate content for YouTube in an ethical way, while also ensuring we will go viral.
You should discover which are the topics with the highest chance of going viral today by searching the web.
Divide this search into multiple granular steps to get the best out of it. You can use Tavily and Firecrawl_scrape
to search the web and scrape URL contents, respectively. Then you should think about how to present these topics in order to make the video go viral.
Your script should contain detailed text (which will be passed to a text-to-speech model for voiceover),
as well as visual elements which will be passed to as prompts to image AI models like MidJourney.
You have full autonomy to create highly viral videos following the guidelines above. 
Be creative and make sure you have a winning strategy.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It outputs a full workflow with 12 nodes, multiple rounds of searching and scraping the web, LLM API calls, (attaching tools and using structured outputs autonomously in some of the nodes) and function calls.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7ped6pkzlqyih0rhuhpk.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7ped6pkzlqyih0rhuhpk.jpg" alt="Image description" width="800" height="461"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Learn more about GenSphere
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;GitHub Repository: &lt;a href="//github.com/octopus2023-inc/gensphere"&gt;Explore the code and contribute&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Documentation: Dive deeper into the &lt;a href="https://gensphere.readthedocs.io/en/latest/" rel="noopener noreferrer"&gt;GenSphere Documentation&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Tutorial: Follow the &lt;a href="https://github.com/octopus2023-inc/gensphere/blob/main/examples/gensphere_tutorial.ipynb" rel="noopener noreferrer"&gt;tutorial Google Colab notebook&lt;/a&gt; to get hands-on experience.&lt;/li&gt;
&lt;li&gt;Prompt-to-agent example: Follow this &lt;a href="https://github.com/octopus2023-inc/gensphere/blob/main/examples/agentic_workflows_from_prompts.ipynb" rel="noopener noreferrer"&gt;Google Colab notebook&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;Community: Connect with other developers on the &lt;a href="https://discord.gg/qvgEaR3E" rel="noopener noreferrer"&gt;Discord Server&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>genai</category>
      <category>opensource</category>
      <category>llm</category>
      <category>ai</category>
    </item>
    <item>
      <title>Community-driven development of LLM applications — introducing GenSphere</title>
      <dc:creator>octopus inc</dc:creator>
      <pubDate>Wed, 06 Nov 2024 21:14:50 +0000</pubDate>
      <link>https://dev.to/octopus_inc_3b25ac16c5131/community-driven-development-of-llm-applications-introducing-gensphere-1mh4</link>
      <guid>https://dev.to/octopus_inc_3b25ac16c5131/community-driven-development-of-llm-applications-introducing-gensphere-1mh4</guid>
      <description>&lt;h2&gt;
  
  
  &lt;strong&gt;Introduction&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;In the rapidly evolving world of artificial intelligence, Large Language Models (LLMs) have unlocked unprecedented possibilities. However, building complex LLM applications remains a daunting task, riddled with unnecessary abstractions and steep learning curves. Enter GenSphere — a declarative framework that’s set to redefine how we develop, share, and scale AI applications.&lt;/p&gt;

&lt;h2&gt;
  
  
  How genAI-based applications are built today — and what is missing
&lt;/h2&gt;

&lt;p&gt;In recent years, we’ve witnessed impressive use cases of Generative AI (GenAI) and Large Language Models (LLMs) delivering tangible value across various domains. From virtual assistants that understand natural language to AI systems that automate complex tasks requiring common sense reasoning and processing unstructured data, the potential is enormous.&lt;/p&gt;

&lt;p&gt;However, despite these advancements, most GenAI applications today are built as monoliths — end-to-end systems developed in isolation. There is minimal reuse of components across the community. This lack of collaboration stems from several challenges:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Fragmented Ecosystem: Different frameworks are written in various programming languages, making integration difficult. For instance, combining a Python-based NLP module with a Java-based data processing tool requires significant effort.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Lack of Community-First Approach: Existing frameworks weren’t designed with collaboration in mind. They don’t optimize for easy combination of systems, leading to siloed development.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Complexity of Integration: Even when components are available, the absence of standardized interfaces and protocols makes it hard to plug them into new applications seamlessly.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The Missing Piece: Collaborative, Modular Development
&lt;/h2&gt;

&lt;p&gt;Imagine a world where building GenAI applications is akin to assembling Lego blocks — each piece optimized, reusable, and designed to fit perfectly with others. This is where the potential of GenSphere truly shines.&lt;/p&gt;

&lt;h3&gt;
  
  
  Accelerating Development Through Reusability:
&lt;/h3&gt;

&lt;p&gt;Let’s consider the process of automating a content creation platform using AI. Traditionally, you’d need to develop:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Data Extraction Pipelines: Scraping and gathering information from various sources.&lt;/li&gt;
&lt;li&gt;Content Generation Modules: Using LLMs to create articles, videos, or social media posts.&lt;/li&gt;
&lt;li&gt;Visual Enhancement Tools: Adding images, graphics, or interactive elements.&lt;/li&gt;
&lt;li&gt;SEO Optimization Processes: Ensuring the content ranks well on search engines.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Developing each component from scratch is time-consuming and inefficient.&lt;/p&gt;

&lt;p&gt;But what if you could:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Leverage a Community of Optimized Building Blocks&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Access modules crafted and refined by experts.&lt;/li&gt;
&lt;li&gt;Utilize pre-built workflows for data extraction, content generation, and SEO optimization.&lt;/li&gt;
&lt;li&gt;Benefit from continuous improvements as the community enhances these components.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Use a Framework That Simplifies Integration&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Imagine having a declarative approach to assemble these blocks effortlessly.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Contribute Back to the Ecosystem&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Imagine being able to trigger a positive feedback loop, where every element from a platform of reusable blocks is using to create new blocks, which are then fed back to the platform. This would make the process of community-driven development progressively better and more powerful.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  GenSphere, a declarative framework for LLM applications
&lt;/h2&gt;

&lt;p&gt;GenSphere is an open-source, python-based project that enables developers to define AI workflows using simple YAML files, outlining the tasks and their connections without delving into the procedural complexities. Each node in the workflow represents a high-level operation — be it a function call, an LLM API request, or another nested workflow. By abstracting the execution logic, GenSphere lets you focus on orchestrating sophisticated AI applications declaratively.&lt;/p&gt;

&lt;h3&gt;
  
  
  What is a declarative framework?
&lt;/h3&gt;

&lt;p&gt;At its core, a declarative framework allows developers to specify what the program should accomplish without dictating how to achieve it. This contrasts with imperative programming, where the focus is on explicit instructions. Declarative frameworks emphasize the desired outcome, leaving the execution details to the underlying system.&lt;/p&gt;

&lt;p&gt;Having a declarative paradigm at its root allows GenSphere to tackle the challenges described before, by making the process of combining, sharing and building LLM applications much easier, all at the same time.&lt;/p&gt;

&lt;h2&gt;
  
  
  How GenSphere works
&lt;/h2&gt;

&lt;p&gt;On GenSphere, you build LLM applications with YAML files, that define an execution graph. Nodes can be either LLM API calls, regular function executions or other graphs themselves.&lt;/p&gt;

&lt;p&gt;Because you can nest graphs easily, building complex applications is not an issue, but at the same time you don’t lose control. The YAML basically states what are the tasks that need to be done and how they connect. Other than that, you only write individual python functions to be called during the execution. No new classes and abstractions to learn.&lt;/p&gt;

&lt;p&gt;By providing a standardized, declarative way to build and share AI applications, GenSphere:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Eliminates Unnecessary Abstractions: Gain low-level control without the overhead of convoluted frameworks.&lt;/li&gt;
&lt;li&gt;Enhances Portability: Share and deploy AI workflows effortlessly across different environments.&lt;/li&gt;
&lt;li&gt;Fosters Community Growth: Leverage the collective intelligence of developers worldwide by sharing and reusing workflows.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  New possibilities unlocked by GenSphere
&lt;/h2&gt;

&lt;p&gt;GenSphere’s ability to nest workflows means you can build specialized agents for specific tasks and then combine them to tackle more complex challenges. This modularity is a game-changer, specially when community collaboration drives further enhancement and specialization of modules.&lt;/p&gt;

&lt;p&gt;Example 1: Automated Financial Analysis&lt;/p&gt;

&lt;p&gt;Components:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Data Scraper Workflow: Extracts financial data from enterprise reports.&lt;/li&gt;
&lt;li&gt;Data Structuring Workflow: Organizes raw data into structured formats.&lt;/li&gt;
&lt;li&gt;RAG Workflow: Retrieves relevant information as needed.&lt;/li&gt;
&lt;li&gt;Combined Application: An automated stock trading agent that analyzes market trends and executes trades based on real-time data.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Example 2: Intelligent Content Creation&lt;/p&gt;

&lt;p&gt;Components:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Keyword Research Workflow: Uses LLMs to identify trending topics.&lt;/li&gt;
&lt;li&gt;Content Generator Workflow: Produces high-quality articles.&lt;/li&gt;
&lt;li&gt;SEO Optimizer Workflow: Enhances content for search engine visibility.&lt;/li&gt;
&lt;li&gt;Combined Application: A content creation engine that generates SEO-optimized blog posts tailored to current trends.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Example 3: Personalized Education Platforms&lt;/p&gt;

&lt;p&gt;Components:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Curriculum Designer Workflow: Creates personalized learning paths.&lt;/li&gt;
&lt;li&gt;Assessment Generator Workflow: Develops custom quizzes and tests.&lt;/li&gt;
&lt;li&gt;Feedback Analyzer Workflow: Uses LLMs to interpret student performance.&lt;/li&gt;
&lt;li&gt;Combined Application: An adaptive learning system that personalizes education at scale.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Example 4: Advanced Customer Support Bots&lt;/p&gt;

&lt;p&gt;Components:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Intent Recognition Workflow: Understands customer queries.&lt;/li&gt;
&lt;li&gt;Knowledge Base Access Workflow: Retrieves solutions from documentation.&lt;/li&gt;
&lt;li&gt;Response Generator Workflow: Crafts coherent and helpful replies.&lt;/li&gt;
&lt;li&gt;Combined Application: An intelligent support bot that provides instant, accurate assistance to customers.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Community-Driven Development
&lt;/h2&gt;

&lt;p&gt;By pushing your workflows to the GenSphere hub, you contribute to a growing repository of AI capabilities. This collective resource accelerates innovation, as developers can:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Reuse and Remix: Combine existing workflows to create new applications.&lt;/li&gt;
&lt;li&gt;Collaborate Globally: Work alongside a community passionate about advancing AI.&lt;/li&gt;
&lt;li&gt;Gain Recognition: Track the popularity of your workflows through pull counts.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;As an ambitious open-source movement, GenSphere aims to create foundational AI-agents and applications that can be reused across many different use cases. Leveraging community collaboration will allow achieving what no other team could do alone. If you would like to join this movement, reach out at the GitHub repo and Discord server.&lt;/p&gt;

&lt;h2&gt;
  
  
  Quick Start Example: Building with GenSphere
&lt;/h2&gt;

&lt;p&gt;Step 1: Installation&lt;br&gt;
Install GenSphere using pip:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pip install gensphere

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Step 2: Import Modules and Set API Key&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;from gensphere.genflow import GenFlow
from gensphere.hub import Hub
import os

os.environ['OPENAI_API_KEY'] = "YOUR_OPENAI_API_KEY"
Step 3: Pull an Existing Workflow from the GenSphere Hub

hub = Hub()
hub.pull(
    push_id='2c03079c-0e33-489e-bbbe-777da744d56f',
    yaml_filename='simple_examples.yaml',
    functions_filename='simple_examples_functions.py',
    save_to_disk=True
)

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Step 4: Execute the Workflow&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;flow = GenFlow('simple_examples.yaml', 'simple_examples_functions.py')
flow.parse_yaml()
flow.run()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Step 5: Access Outputs&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;print(flow.outputs)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Step 6: Visualize Your Workflow&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;from gensphere.visualizer import Visualizer

viz = Visualizer('simple_examples.yaml', 'simple_examples_functions.py')
viz.start_visualization()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Get Started Today
&lt;/h2&gt;

&lt;p&gt;Ready to join ? Here are your next steps:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;GitHub Repository: Explore the code and contribute at github.com/octopus2023-inc/gensphere.&lt;/li&gt;
&lt;li&gt;Documentation: Dive deeper with the &lt;a href="https://gensphere.readthedocs.io/" rel="noopener noreferrer"&gt;GenSphere Documentation&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Tutorial: &lt;a href="https://github.com/octopus2023-inc/gensphere/blob/main/examples/gensphere_tutorial.ipynb" rel="noopener noreferrer"&gt;Follow the 5-Minute Tutorial Notebook to get hands-on experience&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Community: Connect with other developers on our &lt;a href="https://discord.gg/DZFWMXJv" rel="noopener noreferrer"&gt;Discord Server&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>genai</category>
      <category>opensource</category>
      <category>llm</category>
      <category>ai</category>
    </item>
  </channel>
</rss>
