NAF architecture and modules

The Newo Agent Framework (NAF) v3.9.0 is a modular multi-agent framework that powers every Newo AI Employee. This article is the definitive reference for the NAF's internal structure: core agents, flow organization, separated modules, versioning, and the modular architecture pattern. It is written for developers, solutions engineers, and technical partners who need to understand NAF internals.

Architecture overview

The NAF codebase is organized into two top-level directories:

  • naf/ — The core framework. Contains the primary agents, flows, skills, and shared attributes that handle conversations, booking, scheduling, SMS, email, browser automation, and more.
  • projects/ — Separated modules. Each module is an independent project with its own agents, flows, versioning, and registry configuration.

Core NAF agents

The NAF defines 12 agents. Each agent is a directory under naf/agents/ containing an agent.yaml definition and a flows/ directory.

Agent idnRoleDescription
ConvoAgentPrimary conversational agentThe main user-facing agent. Processes messages and responds across all conversational channels: phone, chat, Telegram, WhatsApp, and others. Contains 30 flows covering message handling, booking, scheduling, follow-up, voice actions, tool calling, observation, and more.
GeneralManagerAgentProject manager and orchestratorKeeper of task objects, task instructions, and business context. Handles project initialization, publishing, migrations, report generation, canvas building, and intent type management.
ScenarioWriterConversation scenario generatorGenerates and writes conversation scenarios via a multi-step pipeline (draft → procedure mapping → formatting → validation). Produces structured scripts that the ConvoAgent follows during interactions.
TaskManagerTask lifecycle managerManages creation, assignment, tracking, and completion of tasks across the agent team.
EmailWorkerEmail delivery specialistSends email messages on behalf of the agent team. Triggered by other agents via SendSystemEvent.
SmsWorkerSMS delivery specialistSends SMS messages to users. Triggered by inter-agent events rather than direct user interaction.
MagicWorkerBrowser automation workerSimulates keyboard and mouse actions within a browser, behaving like a human when interacting with web applications that lack APIs. Used for booking tables, scheduling spa appointments, and similar tasks.
MultiLocationAgentLocation routing controllerControls the target location of a session. Used by businesses with multiple physical locations to route conversations and tasks to the correct branch.
AgentCreatorAccount initialization agentHandles automated agent creation and account initialization, including callback and incoming-event processing.
SuperAgentProjectProject-level metadataHandles project-level metadata operations. Internal utility agent.
ApifyCheckAvailabilityWorkerApify integration workerChecks business availability using the Apify integration. Internal utility agent.
TestAgentRegression testing agentUsed for automated regression testing. Internal utility agent.

Flow and skill organization

Flows group related skills around a specific capability. A flow YAML file defines the skills it contains and the events it subscribes to.

Each skill definition includes:

FieldDescription
idnUnique identifier for the skill within its flow.
prompt_scriptRelative path to the .nsl or .nslg file containing the skill logic.
runner_typeScript engine: nsl or guidance. See below.
modelLLM configuration with model_idn and provider_idn.
parametersOptional parameters passed to the skill at runtime.

NSL vs NSLG runner types

The NAF uses two script engines for skill prompt scripts:

Runner typeFile extensionTemplate syntaxDescription
nsl.nslJinja2 ({% if %}, {% for %}, {{ }})The primary script engine. Uses Python/Jinja2 template syntax with {% %} for control flow and {{ }} for expressions. Supports Python string methods, json.loads(), re.sub(), and other Python builtins.
guidance.nslgHandlebars ({{#if}}, {{#each}}, {{Set()}})Legacy script engine based on Handlebars syntax. Uses {{#if condition}}...{{/if}} for control flow and {{Set(name=..., value=...)}} for variable assignment. Still widely used in the codebase alongside NSL.

Both script engines share access to the same platform actions:

ActionDescription
GetCustomerAttribute(field=...)Read a project-level attribute.
SetCustomerAttribute(field=..., value=...)Write a project-level attribute.
GetPersonaAttribute(id=..., field=...)Read a per-user attribute from a persona.
SetPersonaAttribute(id=..., field=..., value=...)Write a per-user attribute.
SendSystemEvent(eventIdn=..., connectorIdn=...)Fire a system event to trigger skills in other flows/agents.
SendMessage(message=...)Send a message to the user.
SendCommand(commandIdn=..., integrationIdn=...)Send a command to an integration (e.g., voice, HTTP).
GetTriggeredAct()Get the event/action that triggered the current skill.
GetUser()Get the current user object.
GetState(name=...) / SetState(name=..., value=...)Read/write flow-level state that persists across skill invocations within the same flow.
GetDatetime(format=..., timezone=...)Get the current date/time.
Gen(...)Call the LLM to generate text or structured JSON output.
Return(val=...)Return a value from a skill (used when the skill is called by another skill).

The turn pipeline

When a message arrives, the platform processes it through a coordinated pipeline. Understanding this pipeline is essential for grasping how the Observer, Tool Caller, and ConvoAgent interact:

  1. Event receivedconversation_started or user_message event fires from the integration (chat, phone, Telegram, etc.).
  2. CAMainFlow handles the event — The ConvoAgent's main flow picks up the event, assembles the prompt, and generates a response.
  3. broadcast_analyze_conversation fires — After the ConvoAgent generates its response, a broadcast event triggers parallel analysis.
  4. Three flows run in parallel:
    • CAObserverFlow (queue mode) — Extracts user information and evaluates conversation quality.
    • CAThoughtsFlow (interrupt mode) — Generates structured KEY DIRECTIVES for the next turn.
    • CANewoToolCaller (queue mode) — Detects agent commitments and triggers backend actions.
  5. Results feed back — Thoughts are stored in persona attributes, tools fire execution flows, and the cycle repeats on the next message.

ConvoAgent flows

The ConvoAgent is the largest agent with 30 specialized flows:

FlowPurpose
CAMainFlowCore message processing, conversation start/end, V2V prompting
CAObserverFlowParallel reasoning and conversation analysis
CAThoughtsFlowStructured thought generation for guidance
CANewoToolCallerTool condition detection and execution
CAMessageFlowMessage formatting and delivery
CABookingManagementFlowBooking creation and management
CACheckingAvailabilityFlowAvailability lookup
CAScheduleFlowCalendar and meeting scheduling
CASearchBookingFlowExisting booking search
CAFollowUpFlowFollow-up message scheduling
CAEndSessionFlowSession termination handling
CADataInjectionFlowRuntime data injection
CARagFlowRetrieval Augmented Generation
CAAssessmentFlowConversation quality assessment
CAReportFlowReport generation
CACalculatorFlowNumeric calculations
CATimezoneFlowTimezone detection and conversion
CAUserManagementFlowUser data management
CABroadcastConversationFlowBroadcast message handling
CAExternalReplyExternal reply processing
CAThinkFlowInternal reasoning
CAGen2SendAgentMessageFlowGen2 agent message delivery
CAGen2SendUserMessageFlowGen2 user message delivery
CAExecuteExternalTasksFlowExternal task execution
CAActionCallTransferFlowCall transfer execution
CAActionCallHangUpFlowCall hang-up execution
CAActionCallDefineVoiceMailFlowVoicemail detection
CAActionCallSendDialpadDigitsFlowDTMF digit sending
CAActionSendEmailInformationFlowEmail information dispatch
CAActionSendSMSInformationFlowSMS information dispatch

Separated modules

The NAF is extended by independent versioned modules that add specialized capabilities — outbound calling, lead nurturing, conversation assessment, messaging platform integrations, and booking system integrations. Each module maintains its own agents, flows, and version lifecycle, allowing Newo to update a single capability without redeploying the entire framework.

Modules update automatically when new versions are published to the registry. The platform schedules updates during off-peak hours based on each account's preferred update time.


Changelog

NAF architecture and modules: initial publication

Published developer reference covering NAF v3.9.0 architecture, all 12 core agents, 30 ConvoAgent flows, 9 separated modules, modular architecture pattern, and the registry-based versioning system.