All work

AUTONOMOUS RETURNS & RESOLUTION AGENT

Let AI
understand.
Let rules decide.

INDEPENDENT ENGINEERING PROTOTYPE

I built a returns workflow around a simple separation: language models can interpret a request, but deterministic software should own the policy outcome.

LangGraph connects that interpretation to order lookup, structured state, clarification, reply drafting and final validation.

Try a fictional decision boundary ↓
Interpret the requestRetrieve trusted order dataApply deterministic policyDraft & validate the reply

01 / SEPARATING RESPONSIBILITIES

Policy owns the decision.

A request can be incomplete or conversational. The graph checks the available context before lookup, clarification or policy. The current order tool reads a mock store; it is not a production order API.

TOOL LOOP

agent → tools → observe_tool → agent

parse_response

Missing context → ask_customer → validate

Ready for policy → policy → draft_reply → validate

Source-grounded logical flow, not a recorded execution. A parsed response can also force an order lookup. Waiting requests can resume with prior state; terminal tickets are protected from reopening.

The model’s structured route is validated with Pydantic. The policy outcome is stored separately, and the reply model supplies wording rather than replacing the decision.

Final output is checked again. Shape validation helps enforce the interface; it cannot guarantee correct interpretation, correct policy or appropriate wording.

02 / POLICY PLAYGROUND

Change the facts.
Inspect the boundary.

This smaller, fictional policy illustrates the separation. Change structured attributes to see the rule and deterministic result; no conversation is generated.

FICTIONAL POLICY DEMONSTRATION · Not the project’s assessment policy or a statement of customer rights. No model or order service is called.

01 / STRUCTURED INPUT

A small request record.

Reference
DEMO-42
Days since delivery
7
Condition
Sealed

02 / DETERMINISTIC RESULT

Rule E · Offer a return path

Return path available

RETURN_PATH

7 days is within the fictional window and the item is sealed. No real return is authorised.

Applicable illustrative rule: A sealed item within 21 days can follow this demo’s return path.

The fictional rules, in priority order
  1. V
    Validate

    Delivery age must be a whole number from 0 to 365.

  2. A
    Request details

    A reference is needed before proceeding.

  3. B
    Ask a person

    A damaged item goes to a person, regardless of age.

  4. C
    Check the window

    More than 21 days is outside this fictional window.

  5. D
    Inspect opened items

    An opened item within the window needs a person.

  6. E
    Offer a return path

    A sealed item within 21 days can follow this demo’s return path.

03 / TESTING THE BOUNDARIES

What the tests cover.

RÉSUMÉ BASELINE

13 automated tests

The documented accomplishment covers rules, missing information, invalid inputs and tool interactions.

PINNED SOURCE / OFFLINE REVIEW

16 passed · 3 skipped

19 collected: eight workflow tests, four policy tests, three tool tests, one golden-suite test and three optional live tests. Deterministic model doubles exercised the offline graph.

EXTERNAL-SERVICE LIMIT

Live calls were not run.

The three live-model tests were deliberately skipped. LangSmith decorators instrument workflow, tool and parser calls; no hosted traces or private reasoning are displayed here.

04 / LOOKING BACK

The useful work
is at the handoff.

This project demonstrates my experience separating probabilistic interpretation from deterministic decisions, then testing the handoffs between them. Tool failures, incomplete context and resumed requests matter as much as the happy path.

I would extend malformed-output and provider-failure tests before treating the prototype as an operational service. The existing source and successful offline run establish a tested prototype, not production readiness.

Explore the Returns Agent source ↗