Recipes¶
Location: inception_recipes/
Recipes are complete, end-to-end AI agent implementations for specific business use cases — ready to customize and deploy. They show how core libraries, accelerator patterns, and MCP servers combine into production systems.
Invoice Automation (invoice_automation/)¶
What it does¶
Automates the Oracle EBS Accounts Payable invoice lifecycle using a multi-agent pipeline:
- Daily trigger — a scheduled job runs before 8 AM, connects to EBS via OIC MCP, and retrieves pending invoices
- Classification agent — analyzes each invoice and routes it: auto-approved → Auto Pay Agent, exceptions → Review Agent
- Auto Pay Agent — processes approved invoices directly
- Review Agent — surfaces flagged invoices to an AP Manager dashboard with approve/hold actions
- Supplier Analysis Agent — spawns a 3-agent chain (Assessment → Preparation → Execution) to analyze cash flow, develop negotiation strategy, and email suppliers
Agent chain for supplier negotiation¶
Negotiate Terms Agent
└─ spawns: Contract Assessment Sub-Agent (cash flow analysis)
└─ spawns: Contract Preparation Sub-Agent (strategy development)
└─ spawns: Contract Execution Sub-Agent (email generation → Email MCP)
Episodic memory for replay¶
Agents store every action in Oracle 26ai with vector embeddings:
SELECT memory_id, content, context, timestamp
FROM episodic_memories
WHERE VECTOR_DISTANCE(embedding, :query_vector) < 0.3
AND timestamp >= SYSDATE - 7
ORDER BY timestamp DESC
FETCH FIRST 10 ROWS ONLY
This enables natural-language replay queries like: "How and what invoice got auto-paid on Feb 01 at 9 AM?"
Technology stack¶
| Layer | Technology |
|---|---|
| Frontend | React + Vite + Tailwind CSS |
| Backend API | FastAPI (port 8001) |
| MCP server | ADW MCP (port 8003) |
| Database | Oracle Autonomous Data Warehouse |
| Auth | IDCS SSO → API Gateway → IAM DB token exchange |
| Integration | OIC MCP Server for EBS write-back |
| Memory | Oracle 26ai vector store (episodic + semantic) |
Security model (defence in depth)¶
- SSO via IDCS — no anonymous access
- IAM group verification — role gate before any tool runs
- IAM DB token exchange — short-lived, user-scoped token; no shared credentials
- VPD row-level security —
AP_SUPPLIERS_SLIMfiltered byAP_Clerkrole - EBS shielded via OIC — agents never access EBS directly; all writes via OIC workflow
Running locally¶
cd inception_recipes/invoice_automation
mkdir -p src/backend/logs
source src/backend/venv3.13/bin/activate
# Start MCP server (port 8003)
nohup python src/backend/mcp_adw_server.py > src/backend/logs/mcp_server.log 2>&1 &
# Start FastAPI backend (port 8001)
nohup python src/backend/fastapi_app.py > src/backend/logs/fastapi.log 2>&1 &
# Start React frontend (port 5173)
npm run dev
Smart Dispatch (smart_dispatch/)¶
What it does¶
A multi-agent field service dispatch system that automates call intake, signal triage, and technician dispatch using a coordinated LangGraph agent fleet backed by Oracle ADB and OCI GenAI. A caller describes a device issue; the system identifies the service record, diagnoses the root cause, surfaces KB guidance, and recommends a governed next action — with full cross-turn memory.
Agent topology¶
Customer
→ Call-Intake Agent (llama-4-scout-17b) — conversational triage + entity extraction
→ Memory Agent — Oracle Store cache hit/miss router (~2s)
HIT → answer from memory
MISS → Contract Agent (gemini-2.5-pro) — MCP SQL deep research (up to 20 calls)
→ [HITL: "Would you like to schedule a dispatch?"]
YES → Dispatch Agent — Fusion Studio ping + dispatch report
NO → Farewell node — session summary
Authentication model¶
Two complementary login flows:
| Client | Flow | Token location |
|---|---|---|
| Web UI | IDCS OAuth2 Authorization Code | Server-side session + HttpOnly sd_session cookie |
| CLI | OCI API key → token exchange (RFC 8693) | In-memory cache, auto-refreshed |
The web login redirects to IDCS, exchanges the code server-side, stores the token in a Map<sessionId, {...}>, and sets an HttpOnly cookie — the token never touches the browser. The CLI signs a POST to the IDCS token endpoint with the machine's OCI API key and caches the resulting Bearer token for the session.
CLI¶
cd inception_recipes/smart_dispatch/smart_dispatch_agents
uv run python -m src.cli.smart_dispatch # login via OCI API key
uv run python -m src.cli.smart_dispatch --session <id> # resume session
Startup sequence: OCI API key exchange → MCP SQLcl probe (connect + ALTER SESSION + SELECT * FROM DUAL) → "Connected to SIDECARADB_HIGH" → REPL.
Technology stack¶
| Layer | Technology |
|---|---|
| Frontend | React + Vite (:8000) |
| API Gateway | Node.js / Express (:7002) + OCI API key token exchange |
| AI Orchestration | LangGraph StateGraph |
| Agents | create_oci_agent (intake), create_deep_research_agent (contract) |
| LLM | llama-4-scout-17b (intake/memory/dispatch) · gemini-2.5-pro (contract) |
| Data access | FastMCP SQLcl server (:3001) |
| Memory | OracleDBSaver (conversation) + OracleStore (structured + vector) |
| Python backend | FastAPI (:7001) |
| Observability | LangFuse tracing |
Business value¶
| Metric | Before | After |
|---|---|---|
| Handle time per claim | 15–30 min | < 3 min |
| Availability | Business hours | 24/7 self-service |
| Cost per claim | Baseline | 40–60% reduction |
| Customer satisfaction | Baseline | 30–50% improvement |
See the Smart Dispatch Architecture page for full details: LangGraph workflow, auth flows, memory namespaces, MCP integration, and the
create_deep_research_agentmiddleware stack.
Why recipes matter¶
- Translate patterns into systems — shows exactly how accelerator patterns wire together with real data and real auth
- Reusable conventions — folder structure, agent topology, and integration patterns are copy-paste ready
- Onboarding accelerator — new team members see a working system, not abstract diagrams
- Contribute your own — the recipe backlog is community-driven; submit a new business use case to the library