> For the complete documentation index, see [llms.txt](https://oodlz-ai-studio.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://oodlz-ai-studio.gitbook.io/docs/inbound-agent/the-brain.md).

# The Brain

The agent layer — query preprocessing, intent classification, specialist tool routing, result re-ranking, and shared conversation memory.

> **Five engineered layers between the message arriving and the reply leaving.**

The Brain is what stops the inbound agent from being a chatbot. Most AI assistants pass the raw user message to a vector search and return what comes back. The Oodlz inbound agent runs the message through 5 deliberate layers — query preprocessing, intent classification, specialist tool routing, result re-ranking, and shared conversation memory — before a reply is composed.

## How It Works

Each inbound message hits the layers in order. Filler phrases are stripped so the vector search retrieves the right results. Intent is classified into 1 of 6 categories before any expensive call fires — harmful messages drop, casual compliments get a 1–2 sentence reply with no tool call, active product intent gets the full commercial pipeline. The agent then routes to the right specialist tool based on the classified intent. Results pass through a re-ranking layer that deduplicates, promotes exact matches, and sorts by priority. All turns of the same user, on any channel, share the same Redis memory under the same session key.

The pages below cover each layer in detail — what it does, what it enforces, and why the off-the-shelf alternative fails.

## What You Get

* Predictable agent behaviour — every message goes through the same 5 layers, in the same order, every time.
* Cost discipline — bad-faith input is dropped before reaching an LLM call, casual compliments skip tool calls entirely.
* Quality output — re-ranking ensures the most relevant results surface first, not whatever the vector store happened to return.
* Shared memory — every channel hits the same conversation thread by session key.

![Inbound flow — five layers between a message arriving and a reply leaving: query preprocessing, intent classification, specialist tool routing, result re-ranking, shared conversation memory](https://2935174940-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9WhvO5Y38RJO9oNIdz9G%2Fuploads%2Fgit-blob-58152c200cd99f91f8133595d1608f73938a1244%2Fdiagram-inbound-flow.svg?alt=media)
