Skip to content

Repository files navigation

FreshCart — Multi-Platform Agent Integration Demo

What is this?

FreshCart is a demo grocery store app built to show how customer-facing intelligence can span platforms, not stay locked into one ecosystem.

The main goal is to demonstrate a multi-platform integration pattern:

  • CRM and customer service workflows are managed through Salesforce Agentforce.
  • Product inquiry and product intelligence are handled with Azure OpenAI and the Microsoft Agent Framework.

An orchestrator routes requests to the right platform based on intent.

Why it exists

This project was built to validate a practical architecture where different platforms do what they do best. It also exercises a custom NuGet package that wraps the Salesforce Agentforce REST API as a first-class agent in the Microsoft Agent Framework.

The idea is simple: the future is multi-platform, just like the industry previously evolved toward multi-cloud. Customer success teams need to stay adaptable and flexible, and leverage the best capabilities across systems.

What it demonstrates

A customer sends a message. An Orchestrator decides which agent and platform should handle it:

  • Product questions (prices, sizes, ingredients, recommendations) are answered by a Product Concierge agent powered by Azure OpenAI through the Microsoft Agent Framework.
  • Customer service topics (refunds, returns, order issues, shipping, account context) are routed to a Customer Service agent powered by Salesforce Agentforce.

Developers can enable debug mode in the chat UI to see which platform handled each response, making the routing logic and integration boundaries easy to observe.

Step-By-Step: How This Was Built

  1. Created an ASP.NET Core web app foundation The app was set up as a .NET web project (net10.0) with static frontend assets and controller-based APIs.

  2. Added Microsoft Agent Framework dependencies The project includes Agent Framework packages to create and orchestrate specialized AI agents.

  3. Integrated Salesforce Agentforce for CRM flows A dedicated CustomerServiceAgent was implemented using the Agentforce REST client, authenticated with OAuth client credentials from environment variables.

  4. Built a Product Concierge agent on Azure OpenAI A separate ProductConciergeAgent was created with Azure OpenAI via AIProjectClient and DefaultAzureCredential for product and catalog questions.

  5. Created an intent-based Orchestrator agent The OrchestratorAgent was configured with routing instructions and tools so each incoming message is directed to exactly one specialist agent.

  6. Implemented customer session handling Session IDs are tracked per customer conversation to keep context across turns and to support session end operations.

  7. Exposed chat APIs for the frontend ChatController exposes:

    • POST /api/chat to send a message and receive the routed response
    • DELETE /api/chat/session/{customerId} to end a session
  8. Built a simple grocery storefront UI The frontend (wwwroot) includes a product catalog, cart, and chat panel. User messages are posted to the backend API and responses are rendered in chat bubbles.

  9. Added debug trace visualization Debug mode in the UI renders the routing path so developers can observe which agent/platform handled each request.

  10. Connected runtime configuration via .env The app loads environment variables at startup (Agentforce domain, key, secret, and agent ID), enabling local development without hardcoding credentials.

  11. Validated with scenario-driven prompts Product prompts (recommendations, pricing, ingredients) and CRM prompts (refunds, returns, shipping) were used to verify orchestration behavior.

This flow demonstrates a practical multi-platform pattern: route each intent to the best-fit system instead of forcing all workloads into one platform.

Architecture Diagram

flowchart LR
		U[Customer in Web UI] --> O[Orchestrator Agent\nMicrosoft Agent Framework]

		O -->|Product inquiry| P[Product Concierge Agent\nAzure OpenAI via AIProjectClient]
		O -->|CRM and service inquiry| C[Customer Service Agent\nSalesforce Agentforce REST API]

		P --> R[Unified response to UI]
		C --> R
Loading

Prerequisites

  • .NET 10 SDK (this project targets net10.0)
  • Salesforce org with an active Agentforce agent
  • Agentforce Connected App configured for OAuth 2.0 client credentials
  • Azure access for model inference used by Product Concierge (DefaultAzureCredential)

Environment Setup

Create a .env file in the project root and set:

AGENTFORCE_DOMAIN=your-org.my.salesforce.com
AGENTFORCE_CONSUMER_KEY=your-connected-app-consumer-key
AGENTFORCE_CONSUMER_SECRET=your-consumer-secret
AGENTFORCE_AGENT_ID=your-agent-id

If you are using Azure authentication locally, sign in first:

az login

How To Run

dotnet restore
dotnet run

Open the app in your browser at the local URL printed by ASP.NET Core (commonly http://localhost:5000 or https://localhost:5001).

Basic Steps To Try The Demo

  1. Start the app with dotnet run.
  2. Open the FreshCart UI in your browser.
  3. Ask a product question, for example: What products do you have for pasta night?
  4. Ask a CRM/service question, for example: I want to return my last order.
  5. Toggle Debug Mode in the chat panel and verify routing path changes by intent.
  6. End session from the UI to test session cleanup behavior.

API Quick Test (Optional)

You can also call the backend directly:

curl -X POST http://localhost:5000/api/chat \
	-H "Content-Type: application/json" \
	-d '{"customerId":"demo-user","message":"I need a refund","sessionId":""}'

Audience

This is a developer-facing demo. It is not intended for end users or production use.

Releases

Packages

Contributors

Languages