1"use strict";(self.webpackChunkinnovation_labs=self.webpackChunkinnovation_labs||[]).push([[1434],{99768:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>l,contentTitle:()=>c,default:()=>p,frontMatter:()=>r,metadata:()=>s,toc:()=>o});const s=JSON.parse('{"id":"concepts-ai-agents/team-based-architectures","title":"Team Based Artchitectures","description":"Multi-Agent Architectures","source":"@site/versioned_docs/version-1.0.2/concepts-ai-agents/team-based-architectures.md","sourceDirName":"concepts-ai-agents","slug":"/concepts-ai-agents/team-based-architectures","permalink":"/resources/docs/1.0.2/concepts-ai-agents/team-based-architectures","draft":false,"unlisted":false,"tags":[],"version":"1.0.2","frontMatter":{"id":"team-based-architectures","title":"Team Based Artchitectures"},"sidebar":"tutorialSidebar","previous":{"title":"Understanding Agentic Systems","permalink":"/resources/docs/1.0.2/concepts-ai-agents/understanding-agentic-systems"},"next":{"title":"Microservices and AI Agents","permalink":"/resources/docs/1.0.2/concepts-ai-agents/agent-comparison"}}');var i=t(74848),a=t(28453);const r={id:"team-based-architectures",title:"Team Based Artchitectures"},c=void 0,l={},o=[{value:"Multi-Agent Architectures",id:"multi-agent-architectures",level:3},{value:"Team-Based Agent Architecture",id:"team-based-agent-architecture",level:3},{value:"Implementing a Team-Based System",id:"implementing-a-team-based-system",level:3},{value:"1. Supervisor Agent Implementation",id:"1-supervisor-agent-implementation",level:4},{value:"2. Specialist Agent Implementation",id:"2-specialist-agent-implementation",level:4},{value:"3. State Management",id:"3-state-management",level:4},{value:"Building the Team Graph",id:"building-the-team-graph",level:3}];function d(e){const n={code:"code",h3:"h3",h4:"h4",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,a.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.h3,{id:"multi-agent-architectures",children:"Multi-Agent Architectures"}),"\n",(0,i.jsx)(n.p,{children:"Multi-agent systems distribute complex tasks across specialized agents, each with distinct roles and capabilities. This architecture provides several advantages:"}),"\n",(0,i.jsxs)(n.ol,{children:["\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.strong,{children:"Specialization"})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:"Agents can focus on specific domains"}),"\n",(0,i.jsx)(n.li,{children:"Reduced prompt complexity per agent"}),"\n",(0,i.jsx)(n.li,{children:"Clear separation of concerns"}),"\n"]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.strong,{children:"Scalability"})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:"Parallel processing capabilities"}),"\n",(0,i.jsx)(n.li,{children:"Distributed decision making"}),"\n",(0,i.jsx)(n.li,{children:"Independent scaling of components"}),"\n"]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.strong,{children:"Robustness"})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:"Graceful degradation"}),"\n",(0,i.jsx)(n.li,{children:"Fault isolation"}),"\n",(0,i.jsx)(n.li,{children:"Easier maintenance"}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(n.h3,{id:"team-based-agent-architecture",children:"Team-Based Agent Architecture"}),"\n",(0,i.jsx)(n.p,{children:"A team-based architecture typically consists of three main components:"}),"\n",(0,i.jsxs)(n.ol,{children:["\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.strong,{children:"Supervisor Agent"})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:"Coordinates team activities"}),"\n",(0,i.jsx)(n.li,{children:"Makes routing decisions"}),"\n",(0,i.jsx)(n.li,{children:"Ensures task completion"}),"\n"]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.strong,{children:"Specialist Agents"})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:"Handle domain-specific tasks"}),"\n",(0,i.jsx)(n.li,{children:"Maintain focused expertise"}),"\n",(0,i.jsx)(n.li,{children:"Provide detailed analysis"}),"\n"]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.strong,{children:"State Management System"})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:"Maintains conversation context"}),"\n",(0,i.jsx)(n.li,{children:"Tracks team progress"}),"\n",(0,i.jsx)(n.li,{children:"Manages shared resources"}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(n.h3,{id:"implementing-a-team-based-system",children:"Implementing a Team-Based System"}),"\n",(0,i.jsx)(n.h4,{id:"1-supervisor-agent-implementation",children:"1. Supervisor Agent Implementation"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-python",children:'def create_supervisor_agent
1(llm: ChatOpenAI):\n """\n Create a supervisor agent that coordinates team activities.\n \n Key responsibilities:\n - Task decomposition\n - Agent selection\n - Progress monitoring\n - Final response synthesis\n """\n supervisor_prompt = """\n Core responsibilities:\n 1. Analyze incoming queries\n 2. Determine required information\n 3. Select appropriate specialist\n 4. Monitor progress\n 5. Decide when to conclude\n """\n \n return create_team_supervisor(\n llm=llm,\n system_prompt=supervisor_prompt,\n members=["SpecialistA", "SpecialistB"]\n )\n'})}),"\n",(0,i.jsx)(n.h4,{id:"2-specialist-agent-implementation",children:"2. Specialist Agent Implementation"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-python",children:'def create_specialist_agent(\n llm: ChatOpenAI,\n domain: str,\n tools: List[Tool]\n):\n """\n Create a specialist agent with domain-specific capabilities.\n \n Key features:\n - Focused expertise\n - Specific tool access\n - Clear output format\n """\n system_prompt = f"""\n You are specialized in {domain}.\n When responding:\n 1. Use domain-specific tools\n 2. Provide structured output\n 3. Request missing information\n """\n \n return create_agent(\n llm=llm,\n tools=tools,\n system_prompt=system_prompt\n )\n'})}),"\n",(0,i.jsx)(n.h4,{id:"3-state-management",children:"3. State Management"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-python",children:'class TeamState(TypedDict):\n """\n Manage team-wide state and context.\n \n Components:\n - Message history\n - Team composition\n - Current status\n - Required information\n """\n messages: List[BaseMessage]\n team_members: List[str]\n next: str\n information_needed: List[str]\n reasoning: str\n'})}),"\n",(0,i.jsx)(n.h3,{id:"building-the-team-graph",children:"Building the Team Graph"}),"\n",(0,i.jsx)(n.p,{children:"The team graph defines how agents interact and how information flows:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-python",children:'def create_team_graph():\n """\n Create a coordinated team of agents with defined interactions.\n \n Structure:\n 1. Initialize components\n 2. Define connections\n 3. Set workflow rules\n 4. Establish entry points\n """\n # Initialize agents\n specialist_a = create_specialist_agent(...)\n specialist_b = create_specialist_agent(...)\n supervisor = create_supervisor_agent(...)\n \n # Create graph\n graph = StateGraph(TeamState)\n \n # Add nodes\n graph.add_node("SpecialistA", specialist_a)\n graph.add_node("SpecialistB", specialist_b)\n graph.add_node("supervisor", supervisor)\n \n # Define workflows\n graph.add_edge("SpecialistA", "supervisor")\n graph.add_edge("SpecialistB", "supervisor")\n \n # Add conditional routing\n graph.add_conditional_edges(\n "supervisor",\n lambda x: x["next"],\n {\n "SpecialistA": "SpecialistA",\n "SpecialistB": "SpecialistB",\n "FINISH": END\n }\n )\n \n return graph.compile()\n'})})]})}function p(e={}){const{wrapper:n}={...(0,a.R)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(d,{...e})}):d(e)}},28453:(e,n,t)=>{t.d(n,{R:()=>r,x:()=>c});var s=t(96540);const i={},a=s.createContext(i);function r(e){const n=s.useContext(a);return s.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function c(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:r(e.components),s.createElement(a.Provider,{value:n},e.children)}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.