[{"data":1,"prerenderedAt":1218},["ShallowReactive",2],{"docs:/docs/agents/getting-started":3},{"id":4,"title":5,"body":6,"description":1212,"extension":1213,"meta":1214,"navigation":218,"path":40,"seo":1215,"stem":1216,"__hash__":1217},"docs/docs/agents/getting-started.md","Getting Started with AI Agents",{"type":7,"value":8,"toc":1200},"minimark",[9,13,17,22,45,49,96,115,119,149,153,160,174,177,181,184,544,548,551,867,871,874,1121,1125,1131,1135,1151,1154,1162,1166,1196],[10,11,5],"h1",{"id":12},"getting-started-with-ai-agents",[14,15,16],"p",{},"Build your first multi-agent workflow in minutes.",[18,19,21],"h2",{"id":20},"prerequisites","Prerequisites",[23,24,25,35,42],"ul",{},[26,27,28,29,34],"li",{},"A NoLag account (",[30,31,33],"a",{"href":32},"/pricing","free tier available",")",[26,36,37,38],{},"A project with an agents app created in the ",[30,39,41],{"href":40},"/docs/agents/getting-started","portal",[26,43,44],{},"Node.js 18+ (JavaScript) or Python 3.10+ (Python)",[18,46,48],{"id":47},"step-1-install","Step 1: Install",[50,51,52,81],"code-tabs",{},[53,54,60],"pre",{"className":55,"code":56,"filename":57,"language":58,"meta":59,"style":59},"language-bash shiki shiki-themes github-light github-dark","npm install @nolag/agents @nolag/js-sdk\n","npm","bash","",[61,62,63],"code",{"__ignoreMap":59},[64,65,68,71,75,78],"span",{"class":66,"line":67},"line",1,[64,69,57],{"class":70},"sScJk",[64,72,74],{"class":73},"sZZnC"," install",[64,76,77],{"class":73}," @nolag/agents",[64,79,80],{"class":73}," @nolag/js-sdk\n",[53,82,85],{"className":55,"code":83,"filename":84,"language":58,"meta":59,"style":59},"pip install nolag-agents\n","pip",[61,86,87],{"__ignoreMap":59},[64,88,89,91,93],{"class":66,"line":67},[64,90,84],{"class":70},[64,92,74],{"class":73},[64,94,95],{"class":73}," nolag-agents\n",[14,97,98,99,103,104,107,108,103,111,114],{},"The agents SDK is available for ",[100,101,102],"strong",{},"JavaScript/TypeScript"," (",[61,105,106],{},"@nolag/agents",") and ",[100,109,110],{},"Python",[61,112,113],{},"nolag-agents","). Both provide the same six coordination patterns.",[18,116,118],{"id":117},"step-2-create-an-agents-app","Step 2: Create an Agents App",[120,121,122,129,140,146],"ol",{},[26,123,124,125,128],{},"Open the ",[100,126,127],{},"NoLag Portal"," and navigate to your project",[26,130,131,132,135,136,139],{},"Click ",[100,133,134],{},"Create App"," and select the ",[100,137,138],{},"Agents"," blueprint",[26,141,142,143,34],{},"Give your app a slug (e.g. ",[61,144,145],{},"my-agents",[26,147,148],{},"The app is pre-configured with the topics and QoS settings needed for agent coordination",[18,150,152],{"id":151},"step-3-create-actor-tokens","Step 3: Create Actor Tokens",[14,154,155,156,159],{},"Each agent in your system connects as an ",[100,157,158],{},"actor",". Create at least two actors in the portal:",[120,161,162,168],{},[26,163,164,167],{},[100,165,166],{},"Orchestrator"," - the agent that dispatches tasks and coordinates the workflow",[26,169,170,173],{},[100,171,172],{},"Worker"," - the agent that receives and completes tasks",[14,175,176],{},"Copy the access token for each actor. You'll use these tokens to connect.",[18,178,180],{"id":179},"step-4-connect-the-orchestrator","Step 4: Connect the Orchestrator",[14,182,183],{},"The orchestrator dispatches tasks and listens for results:",[50,185,186,445],{},[53,187,192],{"className":188,"code":189,"filename":190,"language":191,"meta":59,"style":59},"language-typescript shiki shiki-themes github-light github-dark","import { NoLagAgents, Handoff } from \"@nolag/agents\";\n\nconst agents = new NoLagAgents(ORCHESTRATOR_TOKEN, {\n  appName: \"my-agents\",\n  presence: { name: \"orchestrator\", role: \"orchestrator\", capabilities: [\"dispatch\"] },\n});\nawait agents.connect();\n\nconst room = agents.room(\"default-workflow\");\nconst handoff = new Handoff(room);\n\n// Dispatch a task to any worker with the \"summarize\" capability\nconst result = await handoff.dispatch(\"summarize\",\n  { url: \"https://example.com/article\" },\n  { waitForResult: true, timeout: 30000 }\n);\n\nconsole.log(\"Result:\", result.payload);\n","TypeScript","typescript",[61,193,194,213,220,248,260,283,289,304,309,332,350,355,362,388,400,418,423,428],{"__ignoreMap":59},[64,195,196,200,204,207,210],{"class":66,"line":67},[64,197,199],{"class":198},"szBVR","import",[64,201,203],{"class":202},"sVt8B"," { NoLagAgents, Handoff } ",[64,205,206],{"class":198},"from",[64,208,209],{"class":73}," \"@nolag/agents\"",[64,211,212],{"class":202},";\n",[64,214,216],{"class":66,"line":215},2,[64,217,219],{"emptyLinePlaceholder":218},true,"\n",[64,221,223,226,230,233,236,239,242,245],{"class":66,"line":222},3,[64,224,225],{"class":198},"const",[64,227,229],{"class":228},"sj4cs"," agents",[64,231,232],{"class":198}," =",[64,234,235],{"class":198}," new",[64,237,238],{"class":70}," NoLagAgents",[64,240,241],{"class":202},"(",[64,243,244],{"class":228},"ORCHESTRATOR_TOKEN",[64,246,247],{"class":202},", {\n",[64,249,251,254,257],{"class":66,"line":250},4,[64,252,253],{"class":202},"  appName: ",[64,255,256],{"class":73},"\"my-agents\"",[64,258,259],{"class":202},",\n",[64,261,263,266,269,272,274,277,280],{"class":66,"line":262},5,[64,264,265],{"class":202},"  presence: { name: ",[64,267,268],{"class":73},"\"orchestrator\"",[64,270,271],{"class":202},", role: ",[64,273,268],{"class":73},[64,275,276],{"class":202},", capabilities: [",[64,278,279],{"class":73},"\"dispatch\"",[64,281,282],{"class":202},"] },\n",[64,284,286],{"class":66,"line":285},6,[64,287,288],{"class":202},"});\n",[64,290,292,295,298,301],{"class":66,"line":291},7,[64,293,294],{"class":198},"await",[64,296,297],{"class":202}," agents.",[64,299,300],{"class":70},"connect",[64,302,303],{"class":202},"();\n",[64,305,307],{"class":66,"line":306},8,[64,308,219],{"emptyLinePlaceholder":218},[64,310,312,314,317,319,321,324,326,329],{"class":66,"line":311},9,[64,313,225],{"class":198},[64,315,316],{"class":228}," room",[64,318,232],{"class":198},[64,320,297],{"class":202},[64,322,323],{"class":70},"room",[64,325,241],{"class":202},[64,327,328],{"class":73},"\"default-workflow\"",[64,330,331],{"class":202},");\n",[64,333,335,337,340,342,344,347],{"class":66,"line":334},10,[64,336,225],{"class":198},[64,338,339],{"class":228}," handoff",[64,341,232],{"class":198},[64,343,235],{"class":198},[64,345,346],{"class":70}," Handoff",[64,348,349],{"class":202},"(room);\n",[64,351,353],{"class":66,"line":352},11,[64,354,219],{"emptyLinePlaceholder":218},[64,356,358],{"class":66,"line":357},12,[64,359,361],{"class":360},"sJ8bj","// Dispatch a task to any worker with the \"summarize\" capability\n",[64,363,365,367,370,372,375,378,381,383,386],{"class":66,"line":364},13,[64,366,225],{"class":198},[64,368,369],{"class":228}," result",[64,371,232],{"class":198},[64,373,374],{"class":198}," await",[64,376,377],{"class":202}," handoff.",[64,379,380],{"class":70},"dispatch",[64,382,241],{"class":202},[64,384,385],{"class":73},"\"summarize\"",[64,387,259],{"class":202},[64,389,391,394,397],{"class":66,"line":390},14,[64,392,393],{"class":202},"  { url: ",[64,395,396],{"class":73},"\"https://example.com/article\"",[64,398,399],{"class":202}," },\n",[64,401,403,406,409,412,415],{"class":66,"line":402},15,[64,404,405],{"class":202},"  { waitForResult: ",[64,407,408],{"class":228},"true",[64,410,411],{"class":202},", timeout: ",[64,413,414],{"class":228},"30000",[64,416,417],{"class":202}," }\n",[64,419,421],{"class":66,"line":420},16,[64,422,331],{"class":202},[64,424,426],{"class":66,"line":425},17,[64,427,219],{"emptyLinePlaceholder":218},[64,429,431,434,437,439,442],{"class":66,"line":430},18,[64,432,433],{"class":202},"console.",[64,435,436],{"class":70},"log",[64,438,241],{"class":202},[64,440,441],{"class":73},"\"Result:\"",[64,443,444],{"class":202},", result.payload);\n",[53,446,450],{"className":447,"code":448,"filename":110,"language":449,"meta":59,"style":59},"language-python shiki shiki-themes github-light github-dark","from nolag_agents import NoLagAgents, NoLagAgentsOptions, AgentPresenceData\nfrom nolag_agents.patterns import Handoff\n\nagents = NoLagAgents(ORCHESTRATOR_TOKEN, NoLagAgentsOptions(\n    app_name=\"my-agents\",\n    presence=AgentPresenceData(name=\"orchestrator\", role=\"orchestrator\", capabilities=[\"dispatch\"]),\n))\nawait agents.connect()\n\nroom = await agents.room(\"default-workflow\")\nhandoff = Handoff(room)\n\n# Dispatch a task to any worker with the \"summarize\" capability\nresult = await handoff.dispatch(\"summarize\",\n    {\"url\": \"https://example.com/article\"},\n    wait_for_result=True, timeout=30000,\n)\n\nprint(\"Result:\", result.payload)\n","python",[61,451,452,457,462,466,471,476,481,486,491,495,500,505,509,514,519,524,529,534,538],{"__ignoreMap":59},[64,453,454],{"class":66,"line":67},[64,455,456],{},"from nolag_agents import NoLagAgents, NoLagAgentsOptions, AgentPresenceData\n",[64,458,459],{"class":66,"line":215},[64,460,461],{},"from nolag_agents.patterns import Handoff\n",[64,463,464],{"class":66,"line":222},[64,465,219],{"emptyLinePlaceholder":218},[64,467,468],{"class":66,"line":250},[64,469,470],{},"agents = NoLagAgents(ORCHESTRATOR_TOKEN, NoLagAgentsOptions(\n",[64,472,473],{"class":66,"line":262},[64,474,475],{},"    app_name=\"my-agents\",\n",[64,477,478],{"class":66,"line":285},[64,479,480],{},"    presence=AgentPresenceData(name=\"orchestrator\", role=\"orchestrator\", capabilities=[\"dispatch\"]),\n",[64,482,483],{"class":66,"line":291},[64,484,485],{},"))\n",[64,487,488],{"class":66,"line":306},[64,489,490],{},"await agents.connect()\n",[64,492,493],{"class":66,"line":311},[64,494,219],{"emptyLinePlaceholder":218},[64,496,497],{"class":66,"line":334},[64,498,499],{},"room = await agents.room(\"default-workflow\")\n",[64,501,502],{"class":66,"line":352},[64,503,504],{},"handoff = Handoff(room)\n",[64,506,507],{"class":66,"line":357},[64,508,219],{"emptyLinePlaceholder":218},[64,510,511],{"class":66,"line":364},[64,512,513],{},"# Dispatch a task to any worker with the \"summarize\" capability\n",[64,515,516],{"class":66,"line":390},[64,517,518],{},"result = await handoff.dispatch(\"summarize\",\n",[64,520,521],{"class":66,"line":402},[64,522,523],{},"    {\"url\": \"https://example.com/article\"},\n",[64,525,526],{"class":66,"line":420},[64,527,528],{},"    wait_for_result=True, timeout=30000,\n",[64,530,531],{"class":66,"line":425},[64,532,533],{},")\n",[64,535,536],{"class":66,"line":430},[64,537,219],{"emptyLinePlaceholder":218},[64,539,541],{"class":66,"line":540},19,[64,542,543],{},"print(\"Result:\", result.payload)\n",[18,545,547],{"id":546},"step-5-connect-a-worker","Step 5: Connect a Worker",[14,549,550],{},"Workers register their capabilities and handle incoming tasks:",[50,552,553,772],{},[53,554,556],{"className":188,"code":555,"filename":190,"language":191,"meta":59,"style":59},"import { NoLagAgents, Handoff } from \"@nolag/agents\";\n\nconst agents = new NoLagAgents(WORKER_TOKEN, {\n  appName: \"my-agents\",\n  presence: { name: \"worker-1\", role: \"agent\", capabilities: [\"summarize\"] },\n});\nawait agents.connect();\n\nconst room = agents.room(\"default-workflow\");\nconst handoff = new Handoff(room);\n\n// Handle incoming tasks filtered by capability\nhandoff.onTask([\"summarize\"], async (task, respond) => {\n  console.log(\"Received task:\", task.capability);\n\n  const summary = await summarizeUrl(task.payload.url);\n  respond(\"success\", { summary });\n});\n",[61,557,558,570,574,593,601,619,623,633,637,655,669,673,678,718,733,737,755,768],{"__ignoreMap":59},[64,559,560,562,564,566,568],{"class":66,"line":67},[64,561,199],{"class":198},[64,563,203],{"class":202},[64,565,206],{"class":198},[64,567,209],{"class":73},[64,569,212],{"class":202},[64,571,572],{"class":66,"line":215},[64,573,219],{"emptyLinePlaceholder":218},[64,575,576,578,580,582,584,586,588,591],{"class":66,"line":222},[64,577,225],{"class":198},[64,579,229],{"class":228},[64,581,232],{"class":198},[64,583,235],{"class":198},[64,585,238],{"class":70},[64,587,241],{"class":202},[64,589,590],{"class":228},"WORKER_TOKEN",[64,592,247],{"class":202},[64,594,595,597,599],{"class":66,"line":250},[64,596,253],{"class":202},[64,598,256],{"class":73},[64,600,259],{"class":202},[64,602,603,605,608,610,613,615,617],{"class":66,"line":262},[64,604,265],{"class":202},[64,606,607],{"class":73},"\"worker-1\"",[64,609,271],{"class":202},[64,611,612],{"class":73},"\"agent\"",[64,614,276],{"class":202},[64,616,385],{"class":73},[64,618,282],{"class":202},[64,620,621],{"class":66,"line":285},[64,622,288],{"class":202},[64,624,625,627,629,631],{"class":66,"line":291},[64,626,294],{"class":198},[64,628,297],{"class":202},[64,630,300],{"class":70},[64,632,303],{"class":202},[64,634,635],{"class":66,"line":306},[64,636,219],{"emptyLinePlaceholder":218},[64,638,639,641,643,645,647,649,651,653],{"class":66,"line":311},[64,640,225],{"class":198},[64,642,316],{"class":228},[64,644,232],{"class":198},[64,646,297],{"class":202},[64,648,323],{"class":70},[64,650,241],{"class":202},[64,652,328],{"class":73},[64,654,331],{"class":202},[64,656,657,659,661,663,665,667],{"class":66,"line":334},[64,658,225],{"class":198},[64,660,339],{"class":228},[64,662,232],{"class":198},[64,664,235],{"class":198},[64,666,346],{"class":70},[64,668,349],{"class":202},[64,670,671],{"class":66,"line":352},[64,672,219],{"emptyLinePlaceholder":218},[64,674,675],{"class":66,"line":357},[64,676,677],{"class":360},"// Handle incoming tasks filtered by capability\n",[64,679,680,683,686,689,691,694,697,699,703,706,709,712,715],{"class":66,"line":364},[64,681,682],{"class":202},"handoff.",[64,684,685],{"class":70},"onTask",[64,687,688],{"class":202},"([",[64,690,385],{"class":73},[64,692,693],{"class":202},"], ",[64,695,696],{"class":198},"async",[64,698,103],{"class":202},[64,700,702],{"class":701},"s4XuR","task",[64,704,705],{"class":202},", ",[64,707,708],{"class":701},"respond",[64,710,711],{"class":202},") ",[64,713,714],{"class":198},"=>",[64,716,717],{"class":202}," {\n",[64,719,720,723,725,727,730],{"class":66,"line":390},[64,721,722],{"class":202},"  console.",[64,724,436],{"class":70},[64,726,241],{"class":202},[64,728,729],{"class":73},"\"Received task:\"",[64,731,732],{"class":202},", task.capability);\n",[64,734,735],{"class":66,"line":402},[64,736,219],{"emptyLinePlaceholder":218},[64,738,739,742,745,747,749,752],{"class":66,"line":420},[64,740,741],{"class":198},"  const",[64,743,744],{"class":228}," summary",[64,746,232],{"class":198},[64,748,374],{"class":198},[64,750,751],{"class":70}," summarizeUrl",[64,753,754],{"class":202},"(task.payload.url);\n",[64,756,757,760,762,765],{"class":66,"line":425},[64,758,759],{"class":70},"  respond",[64,761,241],{"class":202},[64,763,764],{"class":73},"\"success\"",[64,766,767],{"class":202},", { summary });\n",[64,769,770],{"class":66,"line":430},[64,771,288],{"class":202},[53,773,775],{"className":447,"code":774,"filename":110,"language":449,"meta":59,"style":59},"from nolag_agents import NoLagAgents, NoLagAgentsOptions, AgentPresenceData\nfrom nolag_agents.patterns import Handoff\n\nagents = NoLagAgents(WORKER_TOKEN, NoLagAgentsOptions(\n    app_name=\"my-agents\",\n    load_balance=True,  # Share tasks with other workers\n    presence=AgentPresenceData(name=\"worker-1\", role=\"agent\", capabilities=[\"summarize\"]),\n))\nawait agents.connect()\n\nroom = await agents.room(\"default-workflow\")\nhandoff = Handoff(room)\n\n# Handle incoming tasks filtered by capability\ndef handle_task(task, respond):\n    print(\"Received task:\", task.capability)\n    summary = summarize_url(task.payload[\"url\"])\n    asyncio.ensure_future(respond(\"success\", {\"summary\": summary}))\n\nhandoff.on_task([\"summarize\"], handle_task)\n",[61,776,777,781,785,789,794,798,803,808,812,816,820,824,828,832,837,842,847,852,857,861],{"__ignoreMap":59},[64,778,779],{"class":66,"line":67},[64,780,456],{},[64,782,783],{"class":66,"line":215},[64,784,461],{},[64,786,787],{"class":66,"line":222},[64,788,219],{"emptyLinePlaceholder":218},[64,790,791],{"class":66,"line":250},[64,792,793],{},"agents = NoLagAgents(WORKER_TOKEN, NoLagAgentsOptions(\n",[64,795,796],{"class":66,"line":262},[64,797,475],{},[64,799,800],{"class":66,"line":285},[64,801,802],{},"    load_balance=True,  # Share tasks with other workers\n",[64,804,805],{"class":66,"line":291},[64,806,807],{},"    presence=AgentPresenceData(name=\"worker-1\", role=\"agent\", capabilities=[\"summarize\"]),\n",[64,809,810],{"class":66,"line":306},[64,811,485],{},[64,813,814],{"class":66,"line":311},[64,815,490],{},[64,817,818],{"class":66,"line":334},[64,819,219],{"emptyLinePlaceholder":218},[64,821,822],{"class":66,"line":352},[64,823,499],{},[64,825,826],{"class":66,"line":357},[64,827,504],{},[64,829,830],{"class":66,"line":364},[64,831,219],{"emptyLinePlaceholder":218},[64,833,834],{"class":66,"line":390},[64,835,836],{},"# Handle incoming tasks filtered by capability\n",[64,838,839],{"class":66,"line":402},[64,840,841],{},"def handle_task(task, respond):\n",[64,843,844],{"class":66,"line":420},[64,845,846],{},"    print(\"Received task:\", task.capability)\n",[64,848,849],{"class":66,"line":425},[64,850,851],{},"    summary = summarize_url(task.payload[\"url\"])\n",[64,853,854],{"class":66,"line":430},[64,855,856],{},"    asyncio.ensure_future(respond(\"success\", {\"summary\": summary}))\n",[64,858,859],{"class":66,"line":540},[64,860,219],{"emptyLinePlaceholder":218},[64,862,864],{"class":66,"line":863},20,[64,865,866],{},"handoff.on_task([\"summarize\"], handle_task)\n",[18,868,870],{"id":869},"step-6-monitor-with-observe","Step 6: Monitor with Observe",[14,872,873],{},"Use the observe pattern to watch everything that happens in your workflow:",[50,875,876,1066],{},[53,877,879],{"className":188,"code":878,"filename":190,"language":191,"meta":59,"style":59},"import { NoLagAgents, Observe } from \"@nolag/agents\";\n\nconst agents = new NoLagAgents(MONITOR_TOKEN, { appName: \"my-agents\" });\nawait agents.connect();\n\nconst room = agents.room(\"default-workflow\");\nconst observe = new Observe(room, \"monitor\");\n\n// Watch all events in the workflow\nobserve.on((event) => {\n  console.log(`[${event.category}] ${event.severity}: ${JSON.stringify(event.payload)}`);\n});\n",[61,880,881,894,898,923,933,937,955,977,981,986,1006,1062],{"__ignoreMap":59},[64,882,883,885,888,890,892],{"class":66,"line":67},[64,884,199],{"class":198},[64,886,887],{"class":202}," { NoLagAgents, Observe } ",[64,889,206],{"class":198},[64,891,209],{"class":73},[64,893,212],{"class":202},[64,895,896],{"class":66,"line":215},[64,897,219],{"emptyLinePlaceholder":218},[64,899,900,902,904,906,908,910,912,915,918,920],{"class":66,"line":222},[64,901,225],{"class":198},[64,903,229],{"class":228},[64,905,232],{"class":198},[64,907,235],{"class":198},[64,909,238],{"class":70},[64,911,241],{"class":202},[64,913,914],{"class":228},"MONITOR_TOKEN",[64,916,917],{"class":202},", { appName: ",[64,919,256],{"class":73},[64,921,922],{"class":202}," });\n",[64,924,925,927,929,931],{"class":66,"line":250},[64,926,294],{"class":198},[64,928,297],{"class":202},[64,930,300],{"class":70},[64,932,303],{"class":202},[64,934,935],{"class":66,"line":262},[64,936,219],{"emptyLinePlaceholder":218},[64,938,939,941,943,945,947,949,951,953],{"class":66,"line":285},[64,940,225],{"class":198},[64,942,316],{"class":228},[64,944,232],{"class":198},[64,946,297],{"class":202},[64,948,323],{"class":70},[64,950,241],{"class":202},[64,952,328],{"class":73},[64,954,331],{"class":202},[64,956,957,959,962,964,966,969,972,975],{"class":66,"line":291},[64,958,225],{"class":198},[64,960,961],{"class":228}," observe",[64,963,232],{"class":198},[64,965,235],{"class":198},[64,967,968],{"class":70}," Observe",[64,970,971],{"class":202},"(room, ",[64,973,974],{"class":73},"\"monitor\"",[64,976,331],{"class":202},[64,978,979],{"class":66,"line":306},[64,980,219],{"emptyLinePlaceholder":218},[64,982,983],{"class":66,"line":311},[64,984,985],{"class":360},"// Watch all events in the workflow\n",[64,987,988,991,994,997,1000,1002,1004],{"class":66,"line":334},[64,989,990],{"class":202},"observe.",[64,992,993],{"class":70},"on",[64,995,996],{"class":202},"((",[64,998,999],{"class":701},"event",[64,1001,711],{"class":202},[64,1003,714],{"class":198},[64,1005,717],{"class":202},[64,1007,1008,1010,1012,1014,1017,1019,1022,1025,1028,1030,1032,1035,1038,1041,1043,1046,1048,1050,1052,1055,1057,1060],{"class":66,"line":352},[64,1009,722],{"class":202},[64,1011,436],{"class":70},[64,1013,241],{"class":202},[64,1015,1016],{"class":73},"`[${",[64,1018,999],{"class":202},[64,1020,1021],{"class":73},".",[64,1023,1024],{"class":202},"category",[64,1026,1027],{"class":73},"}] ${",[64,1029,999],{"class":202},[64,1031,1021],{"class":73},[64,1033,1034],{"class":202},"severity",[64,1036,1037],{"class":73},"}: ${",[64,1039,1040],{"class":228},"JSON",[64,1042,1021],{"class":73},[64,1044,1045],{"class":70},"stringify",[64,1047,241],{"class":73},[64,1049,999],{"class":202},[64,1051,1021],{"class":73},[64,1053,1054],{"class":202},"payload",[64,1056,34],{"class":73},[64,1058,1059],{"class":73},"}`",[64,1061,331],{"class":202},[64,1063,1064],{"class":66,"line":357},[64,1065,288],{"class":202},[53,1067,1069],{"className":447,"code":1068,"filename":110,"language":449,"meta":59,"style":59},"from nolag_agents import NoLagAgents, NoLagAgentsOptions\nfrom nolag_agents.patterns import Observe\n\nagents = NoLagAgents(MONITOR_TOKEN, NoLagAgentsOptions(app_name=\"my-agents\"))\nawait agents.connect()\n\nroom = await agents.room(\"default-workflow\")\nobserve = Observe(room, \"monitor\")\n\n# Watch all events in the workflow\nobserve.on(lambda event: print(f\"[{event.category}] {event.severity}: {event.payload}\"))\n",[61,1070,1071,1076,1081,1085,1090,1094,1098,1102,1107,1111,1116],{"__ignoreMap":59},[64,1072,1073],{"class":66,"line":67},[64,1074,1075],{},"from nolag_agents import NoLagAgents, NoLagAgentsOptions\n",[64,1077,1078],{"class":66,"line":215},[64,1079,1080],{},"from nolag_agents.patterns import Observe\n",[64,1082,1083],{"class":66,"line":222},[64,1084,219],{"emptyLinePlaceholder":218},[64,1086,1087],{"class":66,"line":250},[64,1088,1089],{},"agents = NoLagAgents(MONITOR_TOKEN, NoLagAgentsOptions(app_name=\"my-agents\"))\n",[64,1091,1092],{"class":66,"line":262},[64,1093,490],{},[64,1095,1096],{"class":66,"line":285},[64,1097,219],{"emptyLinePlaceholder":218},[64,1099,1100],{"class":66,"line":291},[64,1101,499],{},[64,1103,1104],{"class":66,"line":306},[64,1105,1106],{},"observe = Observe(room, \"monitor\")\n",[64,1108,1109],{"class":66,"line":311},[64,1110,219],{"emptyLinePlaceholder":218},[64,1112,1113],{"class":66,"line":334},[64,1114,1115],{},"# Watch all events in the workflow\n",[64,1117,1118],{"class":66,"line":352},[64,1119,1120],{},"observe.on(lambda event: print(f\"[{event.category}] {event.severity}: {event.payload}\"))\n",[18,1122,1124],{"id":1123},"step-7-view-in-the-agent-dashboard","Step 7: View in the Agent Dashboard",[14,1126,124,1127,1130],{},[100,1128,1129],{},"Agent Dashboard"," in the portal to see your agents in real time. The dashboard shows connected agents, active tasks, task history, and the event stream.",[18,1132,1134],{"id":1133},"multi-tenant-setup","Multi-Tenant Setup",[14,1136,1137,1138,1142,1143,1146,1147,1150],{},"If you are building a multi-tenant application where each customer needs isolated agent workflows, use ",[30,1139,1141],{"href":1140},"/docs/scopes/getting-started","Access Scopes",". Scopes automatically namespace all MQTT topics - including agent coordination topics like ",[61,1144,1145],{},"_handoff/dispatch"," and ",[61,1148,1149],{},"_blackboard/state"," - under a tenant-specific slug.",[14,1152,1153],{},"This means you deploy one agents app and create scoped actors for each tenant. An orchestrator in tenant A cannot dispatch tasks to workers in tenant B. The isolation is enforced at the protocol level with zero code changes to your agent logic.",[14,1155,1156,1157,1161],{},"See the ",[30,1158,1160],{"href":1159},"/docs/scopes/multi-tenancy","Multi-Tenant Patterns"," guide for detailed implementation examples, including per-tenant agent deployments.",[18,1163,1165],{"id":1164},"next-steps","Next Steps",[23,1167,1168,1175,1182,1189],{},[26,1169,1170,1174],{},[30,1171,1173],{"href":1172},"/docs/agents/patterns","Patterns"," - deep dive on all six coordination patterns",[26,1176,1177,1181],{},[30,1178,1180],{"href":1179},"/docs/agents/composition","Composition"," - combine agents with chat, notifications, and more",[26,1183,1184,1188],{},[30,1185,1187],{"href":1186},"/docs/agents/tags","Tag Vocabulary"," - learn how capability and priority tags work",[26,1190,1191,1195],{},[30,1192,1194],{"href":1193},"/docs/agents/examples","Examples"," - canonical recipes for common agent workflows",[1197,1198,1199],"style",{},"html pre.shiki code .sScJk, html code.shiki .sScJk{--shiki-default:#6F42C1;--shiki-dark:#B392F0}html pre.shiki code .sZZnC, html code.shiki .sZZnC{--shiki-default:#032F62;--shiki-dark:#9ECBFF}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .szBVR, html code.shiki .szBVR{--shiki-default:#D73A49;--shiki-dark:#F97583}html pre.shiki code .sVt8B, html code.shiki .sVt8B{--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .sj4cs, html code.shiki .sj4cs{--shiki-default:#005CC5;--shiki-dark:#79B8FF}html pre.shiki code .sJ8bj, html code.shiki .sJ8bj{--shiki-default:#6A737D;--shiki-dark:#6A737D}html pre.shiki code .s4XuR, html code.shiki .s4XuR{--shiki-default:#E36209;--shiki-dark:#FFAB70}",{"title":59,"searchDepth":215,"depth":215,"links":1201},[1202,1203,1204,1205,1206,1207,1208,1209,1210,1211],{"id":20,"depth":215,"text":21},{"id":47,"depth":215,"text":48},{"id":117,"depth":215,"text":118},{"id":151,"depth":215,"text":152},{"id":179,"depth":215,"text":180},{"id":546,"depth":215,"text":547},{"id":869,"depth":215,"text":870},{"id":1123,"depth":215,"text":1124},{"id":1133,"depth":215,"text":1134},{"id":1164,"depth":215,"text":1165},"Step-by-step guide to building your first multi-agent workflow with @nolag/agents.","md",{},{"title":5,"description":1212},"docs/agents/getting-started","Sq5j3jmHz9bOwPPZxowluq6fyE61lk3zUttB5hs9IJA",1788160342212]