Design agent workflows that stay legible

Last updated: March 2026

The best Lev agent workflows are narrow, state-aware, and easy to review. Start with retrieval and explanation, then graduate to bounded write actions only when the workflow is stable.

Workflow Design Principles

  • Retrieve before acting: pull deals, placements, term sheets, and account context before the agent makes a recommendation.
  • Keep tools narrow: prefer smaller reads and explicit actions over one giant prompt that asks the model to infer missing state.
  • Make handoffs visible: when the agent wants to mutate data or message a human, show the exact reasoning and source records first.
  • Use resource pages as contracts: tie prompt instructions to the schemas and constraints in the API reference pages.

Default workflow shape

1. Identify context
Resolve the deal, account, or lender the user is talking about before asking the model to reason about next steps.
2. Gather primary records
Read the smallest set of records needed: deal, financials, placements, term sheets, lender search results, or team context.
3. Summarize with citations
Have the agent restate the key facts before it proposes any write or outbound action.
4. Request confirmation
For writes or external actions, require an explicit user confirmation or a review checkpoint.
5. Execute and log
Perform the bounded action, then return the updated state plus the request_id when relevant.

Prompt Patterns

Prompt templates

markdown
You are helping a broker evaluate lender fit.

1. Read the deal, deal financials, and any recent lender search results.
2. Summarize the facts you found.
3. Recommend the next action only if the records are sufficient.
4. If data is missing, say exactly what to fetch next.

Safety and Review

Prefer reviewable agents
An agent that exposes its retrieved records, next action, and exact write payload is more useful than an agent that tries to feel magical.
  • Keep outbound actions gated behind approval.
  • Treat lender search, placements, and term-sheet comparisons as high-value review checkpoints.
  • Use request_id values from the API when you need to trace surprising behavior.

What's next

Apply these patterns to the most differentiated AI workflow in the platform.

Continue to Lender Search