PHII Labs
2025-10-28AI Systems9 min read

Building agent systems that ship: from signal to action

The architecture pattern behind every PHII Labs project: capture, reason, route, act — and why most agent prototypes fail at routing.

Building agent systems that ship: from signal to action

Every PHII Labs project follows one pattern: capture signals, reason on them, route actions, and surface outcomes. It sounds simple. Most agent prototypes fail because they skip routing.

The pattern

1. Ingest

Signals come from everywhere: voice messages, chat, webhooks, search queries, form submissions. The first job is to normalize them into a single stream. Not "process a WhatsApp message" or "handle a form post" — just "we received a signal of type X with payload Y."

The ingest layer does no business logic. It converts, validates, and queues. This separation matters because signal sources change constantly. If your ingest is tightly coupled to your reasoning, every new channel forces a rewrite.

2. Reason

This is where the LLM earns its keep. Given a normalized signal, the reasoning layer classifies intent, scores urgency, extracts entities, and decides what should happen next.

The critical design choice: the LLM proposes, the system disposes. The model returns a structured decision — route to human, send automated reply, create task, escalate — but the system enforces it. Never let the model directly trigger side effects. The model can say "send this reply" but the system checks whether the reply is allowed, whether the recipient is valid, and whether the rate limit is respected.

3. Route

This is where prototypes die. Routing is the logic that takes a reasoned decision and maps it to a concrete action in a real system: create a CRM lead, send a WhatsApp message, file a ticket, update a dashboard.

Routing fails when it is implicit — buried in prompt instructions like "if the user seems angry, escalate to a human." That works in a demo and breaks in production. Real routing is explicit: a rules engine or state machine that takes the structured output of the reasoning layer and executes deterministic, auditable actions.

4. Act

The action layer is the interface to the outside world: APIs, databases, message queues, notification systems. It is boring on purpose. No AI here — just reliable execution with retries, idempotency, and logging.

5. Observe

Every step is logged. Not for debugging (though that helps) — for trust. When a user asks "why did the system do X?", you need to show the full chain: signal received, classified as Y, routed to Z, action taken at timestamp T. This is what makes operators comfortable handing real work to an AI system.

Why most prototypes fail

The pattern fails at routing because builders treat the LLM as the system. They ask the model to decide AND act in one step. That works for a demo. In production:

  • The model hallucinates an action that is not supported.
  • The model sends a reply that violates a business rule.
  • The model escalates when it should not, or does not escalate when it should.
  • There is no audit trail because the decision was inside a prompt.

The fix is structural: separate reasoning from routing, make routing explicit and deterministic, and log everything. That is the PHII pattern, and it is why our systems survive contact with real users.

Want systems like this?

We build and ship AI systems for real operations.