Models and evals
The model providers behind the agent and the campaign AI Steps, the model slots a workspace, a product and a Step can set, how calls are logged, and the eval scripts.
Every model call names an AI account and a model. An AI account is a saved connection to one provider, with its keys encrypted at rest. Calls reach the provider in two ways: single calls, for everything that asks one question and reads one answer, and agent sessions, for the reply agent and Ask Kit, which run the tool loop.
Providers
| Provider | What the account holds | Notes |
|---|---|---|
| Amazon Bedrock | A region, and either an API key or an access key pair | An account can name a Bedrock Guardrail, which the agents then apply on the provider side |
| OpenAI | An API key, and optionally a base URL | The base URL lets any OpenAI-compatible server stand in |
| Anthropic | An API key | Agent sessions are capped at 4,096 output tokens. Anthropic has no embedding models, so it is not offered as the embedding model |
Any other provider is refused.
Single calls
Single calls share one client per AI account and come in a few shapes:
| Shape | Used by |
|---|---|
| Plain text | The campaign AI Steps, and the summaries and image descriptions made when a knowledge document is added |
| Structured answer, checked against an expected shape, retried on a bad shape, with a fallback value | Lead scoring, lead research |
| Structured answer with the caller’s own check; each failed attempt adds the problems to the conversation, and the call gives up after 3 | AI flow drafts |
| Embeddings | Knowledge documents, memories and search queries |
| Model list | The model picker in Settings |
Each single call is logged with the provider, the kind of call, the model, the tokens (cached tokens too), why the model stopped, how long it took and whether it succeeded. Agent sessions talk to the provider through the agent framework and are not logged this way.
Model slots
| Slot | Set in | Used by |
|---|---|---|
| Workspace chat model | AI model in Settings | The reply agent, Ask Kit, lead scoring, AI flow drafts, lead research, knowledge document summaries and image descriptions |
| Workspace embedding model | AI model in Settings | Knowledge passages, memories and search queries |
| Product model | The product’s AI model | The reply agent when the conversation is about that one product; lead scoring when every criterion belongs to it |
| Step model | The campaign Step’s settings | AI personalize, AI reads the reply, AI scores the reply |
A product that names an AI account but no model borrows the workspace’s model when both use the same account. The reply agent falls back to the workspace chat model when its session cannot be built on the product’s model. Lead scoring falls back when the call on the product’s model fails. A session picks up a changed workspace model, or a changed AI account, on its next message after it has gone idle.
Evals
The eval scripts drive the real inbound path: a message goes in as if it arrived on a channel, the agent takes its turn, and the script records what happened. The harness starts only the parts of the backend the agent needs. The campaign engine stays out, so the harness does not clash with a backend already running. Sending is replaced with a stub that only writes the outbound message to the timeline, so Submit reply succeeds and nothing is delivered.
| Scenario | What it checks |
|---|---|
| KB1 | Reply quality in six languages, each message run once with knowledge and once with the passages removed as a control |
| KB2 | 20 labelled conversations for reply intent, BANT scoring and memory |
| KB3 | Adversarial, long-context and CRM-action cases, with the CRM before and after each turn and the list of tool calls |
| KB4 | Four product knowledge bases: whether the agent searches the right product and states the right facts |
The target workspace needs a chat model, an embedding model and one messaging account (email is preferred). KB4 expects its products to exist already. Each script writes its results as JSON lines to an evaluation reports folder inside the backend, which is not in the repository. Run a script inside the backend container:
docker exec edgr-backend bun run scripts/eval-lang-scenario.ts # KB1
docker exec edgr-backend bun run scripts/eval-intent-scoring-scenario.ts # KB2
docker exec edgr-backend bun run scripts/eval-adversarial-scenario.ts # KB3
docker exec edgr-backend bun run scripts/eval-multiproduct-scenario.ts # KB4To choose the messaging account yourself, pass its id:
docker exec -e EVAL_MESSAGING_CREDENTIAL_ID=<account id> edgr-backend bun run scripts/eval-lang-scenario.ts