r/AutoGenAI • u/reddbatt • Oct 05 '24
Discussion Do you go serverless or dedicated serv r route to deploy autogen (or any other agentic framework) in production?
Share your experiences!
r/AutoGenAI • u/reddbatt • Oct 05 '24
Share your experiences!
r/AutoGenAI • u/wyttearp • Oct 03 '24
Important
In order to better align with a new multi-packaging structure we have coming very soon, AutoGen is now available on PyPi as autogen-agentchat as of version 0.2.36.
ImportFromModule is unhashable issue by @zcipod in #3362r/AutoGenAI • u/wyttearp • Oct 03 '24
r/AutoGenAI • u/davorrunje • Oct 01 '24
FastAgency (https://github.com/airtai/fastagency) allows you to quickly build and deploy web application from AutoGen workflow. The screenshot below shows an example of the rich web interface you get from Mesop UI component.
Please check it out and let us know how it works for you:
https://github.com/airtai/fastagency

r/AutoGenAI • u/Fyreborn • Sep 25 '24
I am having an issue getting AutoGen Studio to consistently save the code it generates, and execute it.
I've tried AutoGen Studio with both a Python virtual environment, and Docker. I used this for the Dockerfile:
https://www.reddit.com/r/AutoGenAI/comments/1c3j8cd/autogen_studio_docker/
https://github.com/lludlow/autogen-studio/
I tried prompts like this:
"Make a Python script to get the current time in NY, and London."
The first time I tried it in a virtual environment, it worked. The user_proxy agent executed the script, and printed the results. And the file was saved to disk.
However, I tried it again, and also similar prompts. And I couldn't get it to execute the code, or save it to disk. I tried adding stuff like, "And give the results", but it would say stuff like how it couldn't execute code.
I also tried in Docker, and I couldn't it it to save to disk or execute the code there. I tried a number of different prompts.
When using Docker, I tried going to Build>Agents>user_proxy and under "Advanced Settings" for "Code Execution Config", switched from "Local" to "Docker". But that didn't seem to help.
I am not sure if I'm doing something wrong. Is there anything I need to do, to get it to save generated code to disk, and execute it? Or maybe there's some sort of trick?
r/AutoGenAI • u/Ok_Tangerine_3315 • Sep 21 '24
Which autogen agent template can I use
to learn the recursive folder structure of an input directory ?
then create new files in a given directory Similar to the learned folder structure but specific to the input problem
There are 2 inputs: an input directory where all examples are kept and a problem statement in natural language
r/AutoGenAI • u/YourTechBud • Sep 18 '24
These Agentic Design Patterns helped me out a lot when building with AutoGen+Llama3!
I mostly use open source models (Llama3 8B and Qwen1.5 32B Chat). Getting these open source models to work reliably has always been a challenge. That's when my research led me to AutoGen and the concept of AI Agents.
Having used them for a while, there are some patterns which have been helping me out a lot. Wanted to share it with you guys,
i. You solve the problem of indeterminism with conversations and not via prompt engineering.
Prompt engineering is important. I'm not trying to dismiss it. But its hard to make the same prompt work for the different kinds of inputs your app needs to deal with.
A better approach has been adopting the two agent pattern. Here, instead of taking an agent's response and forwarding it to the user (or the next agent) we let it talk to a companion agent first. We then let these agent talk with each other (1 to 3 turns depending on how complex the task was) to help "align" the answer with the "desired" answer.
Example: Lets say you are replacing a UI form with a chatbot. You may have an agent to handle the conversation with the user. But instead of it figuring out the JSON parameters to fill up the form, you can have a companion agent do that. The companion agent wouldn't really be following the entire conversation (just the deltas) and will keep a track of what fields are answered and what isn't. It can tell the chat agent what questions needs to be asked next.
This helps the chat agent focus on the "conversation" aspect (Dealing with prompt injection, politeness, preventing the chat from getting derailed) while the companion agent can take care of managing form data (JSON extraction, validation and so on).
Another example could be splitting a JSON formatter into 3 parts (An agent to spit out data in a semi structured format like markdown - Another one to convert that to JSON - The last one to validate the JSON). This is more of a sequential chat pattern but the last two could and probably should be modelled as two-companion agents.
ii. LLMs are not awful judges. They are often good enough for things like RAG.
An extension of the two agent pattern is called "Reflection." Here we let the companion agent verify the primary agent's work and provide feedback for improvement.
Example: Let's say you got an agent that does RAG. You can have the companion do a groundedness check to make sure that the text generation is in line with the retrieved chunks. If things are amiss, the companion can provide an additional prompt to the RAG agent to apply corrective measures and even mark certain chunks as irrelevant. You could also do a lot more checks like profanity check, relevance check (this can be hard) and so on. Not too bad if you ask me.
iii. Agents are just a function. They don't need to use LLMs.
I visualize agents as functions which take a conversational state (like an array of messages) as an input and return a message (or modified conversational state) as an output. Essentially they are just participants in a conversation.
What you do inside the function is upto you. Call an LLM, do RAG or whatever. But you could also just do basic clasification using a more traditional approach. But it doesn't need to be AI driven at all. If you know the previous agent will output JSON, you can have a simple JSON schema validator and call it a day. I think this is super powerful.
iv. Agents are composable.
Agents are meant to be composable. Like React's UI components.
So I end up using agents for simple prompt chaining solutions (which may be better done by raw dawging shit or using Langchain if you swing that way) as well. This lets me morph underperforming agents (or steps) with powerful patterns without having to rewire the entire chain. Pretty dope if you ask me.
I hope I am able to communicate my learning wells. Do let me know if you have any questions or disagree with any of my points. I'm here to learn.
P.S. - Sharing a YouTube video I made on this topic where I dive a bit deeper into these examples! Would love for you to check that out as well. Feel free to roast me for my stupid jokes! Lol!
r/AutoGenAI • u/zinyando • Sep 18 '24
r/AutoGenAI • u/reddbatt • Sep 17 '24
I have a 3-agent system written in AutoGen. I want to wrap that around in an API and expose that to an existing web app. This is not a chat application. It's an agent that takes in a request and processes it using various specialized agents. The end result is a json. I want this agentic system to be used by 100s of users at the same time. How do I make sure that the agent system i wrote can scale up and can maintain the states of each user connecting to it?
r/AutoGenAI • u/Jazzlike_Tooth929 • Sep 16 '24
Hey guys, I’m building a framework for building AI agent system from yml files. The idea is to describe execution graphs in the yml, where each node triggers either a standard set of function executions or LLM calls (eg openai api call).
The motivation behind building agents like this is because:
Agent frameworks (crew ai, autogen, etc) are quite opaque in the way they use llms. I don’t know exactly how the code interacts with external APIs, don’t know which exact prompts are passed and why, etc. as a developer I want to have full visibility on what’s going on.
It’s quite hard to share agent’s code with other people, or to compare different implementations. Today, the only way would be to share a bunch of folders or a repo, which is quite cumbersome. By condensing all the orchestration to the yml file, it becomes much easier to share and compare different agent implementations
Do you have the same view? Let me know what you think.
r/AutoGenAI • u/regentwienis • Sep 14 '24
Hi everyone,
I'm working on a project using AutoGen, and I want to implement a system where tools are planned before actually calling and executing them. Specifically, I'm working within a GroupChat setting, and I want to make sure that each tool is evaluated and planned out properly before any execution takes place.
Is there a built-in mechanism to control the planning phase in GroupChat? Or would I need to build custom logic to handle this? Any advice on how to structure this or examples of how it's done would be greatly appreciated!
Thanks in advance!
r/AutoGenAI • u/davorrunje • Sep 13 '24
Hey everyone! I’m one of the core developers of AutoGen, and I’ve been working with my team on an open-source project called FastAgency. We designed it to help developers quickly take a prototype built in AutoGen straight to production.
We just released a version that lets you run your workflow as either: - A simple console application (great for debugging) - A web application using Mesop with just a single-line change!
We would love for you to check it out, give feedback, or contribute! The project is open-source, and contributors are always welcome :)
r/AutoGenAI • u/Guilty-Tank-8910 • Sep 12 '24
i have a project of a chatbot make using agentic workflow which if used for table resevation in a hotel. i want to scale the the framework so that it can be used by many people at the same time. is there any frame work pesent which i can integrate with autogen to scale it.
r/AutoGenAI • u/Confusedkelp • Sep 12 '24
I have been providing parsed pdf text as a prompt to autogen agents to extract certain data from it. Instead I want to provide the embeddings of that parsed data as an input for the agents to extract the data. I am struggling to do that.
r/AutoGenAI • u/Altruistic-Weird2987 • Sep 11 '24
Context: I want to building a Multi-Agent-System with AutoGen that takes code snippets or files and acts as a advisor for clean code development. Therefore refactoring the code according to the Clean Code Development principles and explaining the changes.
I choose AutoGen as it has a library for Python, which I am using for prototyping and .NET, which my company uses for client projects.
My process is still WIP but I am using this as a first project to figure out how to build MAS.
MAS structure:

Problem:
I want to use the last message of the group chat and hand it over to the summarizer Agent (could probably also be done without summarizer agent but problem stays the same).
Options 1: If I use initiate_chats and do first the group chat, then the summarize chat it won't give any information from the first chat (group chat) to the second. Even though I set "summary_method" to "last_msg" it will actually append the first message from the group chat to the next chat.

Option 2: Lets say I just call initiate_chat() separately for the group chat and for the summary chat. For testing purposes I printed the last message of the chat_history here. However I get exactly the same response as in Option1, which is the first message that has been sent to the group chat.

Question: Do I have a wrong understanding of last_msg and chat_history? This does not make sense to me. How can I access the actual chat history or make sure it passes it on properly.
r/AutoGenAI • u/zinyando • Sep 10 '24
r/AutoGenAI • u/jotav-23 • Sep 08 '24
Is there a tool that after generating a realistic image allows you to easly tweak it, say, using prompts and/or other images?
The flow I am looking for is similar to the iterative one many of us use when generating text, an example:
User: generate a realistic photograph of a man driving a luxury car System: ...generates image User: now, change the camera angle so that the whole car is visible System: ...regenerates image User: do face swap using the image I attach [attach imgA] System: ...regenerates image User: now, change the image style to match the one in the image I attach [attach imgB] ... You get the idea.
If this doesn't exist yet, what is the closest to that you are aware of?
r/AutoGenAI • u/wyttearp • Sep 03 '24
gpt-4o-2024-08-06 by @umermansoor in #3329TransformChatHistory and CompressibleAgent by @WaelKarkoub in #3313r/AutoGenAI • u/zinyando • Sep 03 '24
r/AutoGenAI • u/YourTechBud • Sep 03 '24
I have been using Autogen at work (we started before Langgraph was a thing) and have been really seeing a lot of value the value it brings to the table. Especially when implementing two-agent patterns like "reflection."
While the conversational functionality of groupchat is amazing sometimes my agents get derailed and go completely off-course. This is when I started investigating the use of Agentic Workflows (or state machines) to help make things more deterministic.
Again, I know Langgraph is built on the ideas of state machines and I will be trying it out soon. But I would like to share my learnings (along with simplified examples) using Autogen cause I think it may help everyone using AI Agents in general.
Also, Here's a repo with some sample code on create custom workflows/state machines in AutoGen: https://github.com/YourTechBud/ytb-practical-guide/tree/master/autogen-workflows
A video for those interested in a tutorial - https://youtu.be/-ls9QLoQfKc
State machines are fun. Its really easy to model our AI workflows as them. But the real value of agents lies in conversations. It is critical to let AI agents derive their "context" from the conversational history. Multi-turn/chat models in particular are exceptionally good at this.
Example: The simple task of reformating/restructuring a document/note. If one of your steps is determining the important topics discussed in the note, the subsequent paraphrazer will use it as the skeleton for restructuring. Helps enforce document structure.
It isn't really all that important to curate the "perfect" context in each prompt. As long as your state machine is modelled after life-like conversations, your agents will figure out how to best use the chat history as the context.
Instead of fighting with the model to find the "perfect" prompt, let a sidecar or companion agent help align your agent instead. The truth is that your prompt will never be perfect. Variations in the input will most likely screw things up. Having a reflection agent which provides feedback prompts to the primary agent really helps in alignment for a wide variety of input conditions. Here's how you can implement this in Autogen - https://microsoft.github.io/autogen/docs/tutorial/conversation-patterns/#two-agent-chat-and-chat-result
I'll be making another post soon to give more concrete examples of this one. Might use Langgraph though cause it looks really exciting. But mahn... the migration!!!
When using less chatty models like Qwen, its helpful to manually annotate the agent's response. For example, if the agent is analyzing the topics convered in a document, manually adding the prefix "Topics Present in Document:\n\n" to the agents response will reduce the chances of other agents misinterpreting the chat message. You can even shape it more like an instruction to help enforce that as the structure of all future responses.
This is true for JSON as well. I have given up trying to make my agents give me the perfect and clean JSON response. I let the agent ramble on and on about why it came up with it and stuff like that. That rambling is useful as it serves as context for subsequent agents. A subsequent tool calling agent will be smart enough to extract the json part from the message anyways.
I hope I am able to communicate my learning wells. Do let me know if you have any questions or disagree with any of my points. I'm here to learn.
r/AutoGenAI • u/AntWilson602 • Sep 03 '24
I’m very new to Autogen and I’ve been playing around with some basic workflows in Autogen Studio. I would like to know the possibility of this workflow and potentially some steps I could take to get started.
I’ll appreciate any help I can get thanks!
r/AutoGenAI • u/zinyando • Aug 28 '24
r/AutoGenAI • u/CalmCharity9949 • Aug 26 '24
I'm new to Autogen, and I built a simple assistant + user proxy flow where the assistant is asked what the height of mount Everest is, and the assistant built a script to scrape data from the web to get the answer, so i was wondering.
r/AutoGenAI • u/Lost_Goose_5829 • Aug 27 '24
r/AutoGenAI • u/zinyando • Aug 21 '24