A 3-minute demo showcasing the GitHub Copilot SDK for agentic workflows in financial services. The application walks a broker through a 6-step portfolio risk review — from market analysis to compliance pre-check — powered by Copilot tool invocation, multi-turn sessions, and SSE streaming.
https://www.youtube.com/watch?v=SRtzNyrPUW0&t=84s
React (Vite) Express API GitHub Copilot SDK
┌──────────────┐ ┌──────────────┐ ┌──────────────────┐
│ StepWizard │──SSE──│ POST /api/ │──SDK──│ CopilotClient │
│ ModelSelect │ │ chat │ │ createSession │
│ ChatPanel │ │ providers │ │ sendAndWait │
│ Portfolio │ │ portfolios │ │ ProviderConfig │
│ List │ │ reset │ │ (BYOM toggle) │
└──────────────┘ └──────┬───────┘ └──────┬───────────┘
│ │
┌────────┴────────┐ ┌──────┴───────┐
│ 6 Custom Tools │ │ AGENTS.md │
│ (defineTool) │ │ (system │
│ │ │ instructions)│
└────────┬────────┘ └──────────────┘
│
┌────────┴────────┐
│ Mock JSON Data │
│ (portfolios, │
│ news, opps, │
│ compliance) │
└─────────────────┘
| Step | Tool Called | What Happens |
|---|---|---|
| 1. Market Overview | getMarketOverview |
S&P 500 snapshot, sentiment analysis, key drivers |
| 2. Portfolio Triage | getPortfoliosNeedingAttention |
Ranks 20 VIP portfolios by urgency score |
| 3. News Impact | getRelevantNews |
Cross-references portfolio sectors with breaking news |
| 4. Opportunities | getInvestmentOpportunities |
Matches defensive/diversification plays to weak sectors |
| 5. Draft Email | draftClientEmail |
Generates personalized client outreach with disclaimers |
| 6. Compliance | runComplianceScan |
Evaluates proposed changes against 8 SEC/company rules |
The financial terminal-themed UI with the step wizard, BYOM model toggle, and data pipeline header.
S&P 500 snapshot with sector performance table, key drivers, and sentiment analysis — all generated by Copilot from the get_market_overview tool.
Top 4 at-risk portfolios ranked by urgency score with distressed holdings and concentration flags.
Cross-referenced news items matched to portfolio sectors and tickers with sentiment and impact level.
Defensive and diversification opportunities scored by relevance to the portfolio's weak sectors.
Personalized outreach email with market drivers, recommendations, and regulatory disclaimers — ready to send.
SEC and company policy scan of proposed changes with severity flags and required actions.
Full portfolio explorer with search, summary strip, and expandable holdings tables.
- Node.js ≥ 18
- GitHub Copilot subscription (Individual, Business, or Enterprise)
- Authenticated via
gh auth login(GitHub CLI) - (Optional) Azure OpenAI deployment for Bring-Your-Own-Model (BYOM)
# Install dependencies
npm install
# (Optional) Configure Azure OpenAI — copy and fill in your values
cp .env.example .env
# Start both API and frontend
npm run devThis starts:
- API at
http://localhost:3001(Express + Copilot SDK) - Frontend at
http://localhost:5173(React + Vite)
Open http://localhost:5173 and walk through each step.
The app supports switching between GitHub Copilot (default) and a self-hosted Azure OpenAI endpoint at runtime via the model selector in the UI.
- Create a
.envfile from the template:cp .env.example .env
- Fill in your Azure OpenAI values:
AZURE_OPENAI_BASE_URL=https://<your-resource>.openai.azure.com AZURE_OPENAI_API_KEY=<your-key> AZURE_OPENAI_DEPLOYMENT=gpt-4o # your deployment name AZURE_OPENAI_API_VERSION=2024-10-21 # optional, defaults to 2024-10-21
- Restart the dev server — the Azure OpenAI option will appear in the model selector.
- The
GET /api/providersendpoint returns available model providers based on environment configuration. - The frontend
ModelSelectorcomponent fetches providers and lets users toggle between them. - When Azure OpenAI is selected, the SDK
SessionConfig.provideris configured withtype: "azure", the base URL, API key, and API version viaProviderConfig. - Switching providers mid-session automatically destroys the old session and creates a new one.
| Capability | Where Used |
|---|---|
CopilotClient + createSession |
src/api/routes/chat.ts |
sendAndWait with streaming |
src/api/routes/chat.ts |
defineTool with JSON Schema |
src/api/tools/ |
AGENTS.md for system instructions |
AGENTS.md |
ProviderConfig (BYOM) |
src/api/routes/chat.ts — Azure OpenAI toggle |
Session hooks (onPreToolUse) |
src/api/routes/chat.ts |
| Multi-turn context accumulation | Session persists across all 6 steps |
├── AGENTS.md # Agent instructions (role, tone, safety)
├── .env.example # Azure OpenAI configuration template
├── data/
│ ├── portfolios.json # 20 VIP client portfolios
│ ├── news.json # 10 market news items
│ ├── opportunities.json # 8 investment opportunities
│ └── compliance-rules.json # 8 SEC & company rules
├── src/
│ ├── api/
│ │ ├── server.ts # Express entry point (port 3001)
│ │ ├── routes/chat.ts # SSE streaming + session mgmt + BYOM
│ │ └── tools/ # 6 tool definitions
│ │ ├── marketOverview.ts
│ │ ├── portfolioAttention.ts
│ │ ├── relevantNews.ts
│ │ ├── investmentOpportunities.ts
│ │ ├── draftEmail.ts
│ │ ├── complianceScan.ts
│ │ └── index.ts
│ └── web/
│ ├── vite.config.ts
│ ├── index.html
│ └── src/
│ ├── main.tsx
│ ├── App.tsx # Tab nav + model selector state
│ ├── hooks/useChat.ts # SSE hook with provider support
│ └── components/
│ ├── StepWizard.tsx # 6-step wizard
│ ├── ChatPanel.tsx # Markdown rendering
│ ├── ModelSelector.tsx # BYOM provider toggle
│ └── PortfolioList.tsx # All-portfolios view
└── package.json
- All data is mock/simulated — no real client data is used
- Tool outputs include appropriate disclaimers
- Compliance scan is a pre-check, not a substitute for real compliance review
- Email drafts include standard regulatory disclaimers
- The agent never gives definitive investment advice
| Script | Description |
|---|---|
npm run dev |
Start API + frontend concurrently |
npm run dev:api |
Start Express API only |
npm run dev:web |
Start Vite frontend only |









