1 Agent Framework Landscape
Seven frameworks evaluated against AgileX requirements: edge deployment, multi-model, MCP/A2A, South African context.
| Framework | Language | Models | A2A | MCP | Deploy | Best For | AgileX Fit |
|---|---|---|---|---|---|---|---|
| Google ADK | Py/TS/Go/Java | Multi (LiteLLM) | Native | Native | Cloud Run/GKE/Vertex | GCP teams, interop standards | Reference |
| LangGraph | Python | Multi | Via LangChain | Yes | Any | Full-control graph orchestration | Overhead |
| CrewAI | Python | Multi | No | Limited | Any | Fast prototyping, role metaphor | No checkpoints |
| OpenAI Agents SDK | Python | OpenAI only | No | No | OpenAI Cloud | OpenAI-first teams | Locked |
| Anthropic Agent SDK | Python | Claude only | Implied | Native | Anthropic API | Claude-first, MCP-native | For quality tasks |
| AutoGen/AG2 | Python | Multi | No | No | Any | Research debate patterns | Not mature |
| AgentForce | Config | Einstein | No | No | Salesforce | >60% Salesforce shops | Vendor lock |
Our Decision: Custom TypeScript on Cloudflare + Protocols
We don't adopt any single framework. Instead, we use Cloudflare Workers as the runtime, AI Gateway as the model multiplexer, A2A for agent discovery, and MCP for tool access. This gives us multi-model, edge-first, and protocol-compliant without framework lock-in.
Google ADK stays as a reference pattern (agenticx-agents repo). If we ever need GCP-native deployment, the ADK scaffolding is ready.
2 Protocols We Use
A2A (Agent-to-Agent)
Status: Implemented
What: JSON-RPC over HTTP. Agent card at /.well-known/agent.json.
Where: agilex-portal serves the card with 5 skills.
Why: Any A2A client can discover and call our agents.
MCP (Model Context Protocol)
Status: Implemented in huly-recruit-mcp
What: Tool/data protocol. MCP server exposes Huly tools.
Where: 3 tools: create_talent, create_vacancy, create_application.
Why: Claude Code, Cursor, any MCP client can call Huly directly.
Agent Skills
Status: Reference (2nth-skills repo)
What: SKILL.md with YAML frontmatter + scripts.
Where: biz/hr/recruitment/SKILL.md has the full value chain.
Why: Agents load skills contextually, not monolithically.
3 AI Model Strategy
Multi-model via Cloudflare AI Gateway. Each task routes to the best model. Automatic fallback chain.
| Task | Primary | Provider | Fallback | Why This Model |
|---|---|---|---|---|
| CV text → JSON | Llama 3.1 8B | Edge (free) | Gemini Flash | Fast structured extraction, zero cost |
| CV structured parse | Gemini 2.5 Flash | Workers AI | Good JSON output, cheap | |
| Candidate scoring | Gemini 2.5 Pro | Claude Sonnet | Strong reasoning for fair evaluation | |
| Offer letters | Claude Sonnet 4.6 | Anthropic | Gemini Pro | Quality writing, legal precision |
| Rejection feedback | Claude Sonnet 4.6 | Anthropic | Gemini Flash | Empathetic, constructive tone |
| Pipeline reports | Gemini 2.5 Flash | Workers AI | Data synthesis, fast | |
| Routine emails | Llama 3.1 8B | Edge (free) | Gemini Flash | High volume, templated |
| Embeddings | BGE Base v1.5 | Edge | — | 768-dim vectors, instant |
Inference Platforms
| Platform | Role | SA Advantage |
|---|---|---|
| Cloudflare Workers AI | Default edge inference (Llama, BGE) | Global edge, free tier, no FX |
| Cloudflare AI Gateway | Proxy to Gemini, Claude, GPT, any provider | Caching, cost tracking, fallback |
| Ollama | Local dev inference (POPIA, offline) | No FX, load-shedding resilient |
| LiteLLM | Reference only (used by ADK in Python repo) | Model-agnostic config switching |
4 Integration Matrix — What's Real vs Stubbed
| Integration | Status | Repo | Env Var | Notes |
|---|---|---|---|---|
| Workers AI (Llama 3.1 8B) | Real | agilex-portal | AI binding | Works on deployed Worker. Fallback locally. |
| AI Gateway (Gemini, Claude) | Real | agilex-portal | CF_AIG_TOKEN + API keys | Needs secrets set. Falls back to Workers AI. |
| CV Parser (PDF/DOCX → JSON) | Real | agilex-tools | CV_PARSER_URL | Working. Needs deploy + env var. |
| Paton CV Formatter | Real | agilex-tools | — | Working. Multi-brand. |
| Huly create_talent | Real | huly-recruit-mcp | HULY_* vars | Working. Needs Huly instance. |
| Huly create_vacancy | Real | huly-recruit-mcp | HULY_* vars | Auto-seeds 7 pipeline stages. |
| Huly create_application | Real | huly-recruit-mcp | HULY_* vars | Links talent → vacancy at stage. |
| D1 Database | Real | agilex-portal | DB binding | 6 tables, seeded. |
| A2A Agent Card | Real | agilex-portal | — | 5 skills published. |
| Google Drive | Stub | agilex-portal | GOOGLE_SA_KEY | Returns fake URLs. Needs service account. |
| Gmail | Stub | agilex-portal | GOOGLE_SA_KEY | Templates defined. No real send. |
| Google Calendar | Stub | agilex-portal | GOOGLE_SA_KEY | Mock events. No real booking. |
| Google Sheets | Stub | agilex-portal | GOOGLE_SA_KEY | Mock rows. No real spreadsheet. |
5 E2E Data Flow — CV to Huly Talent
Recruiter drops CV in simulator (agilex-sim)
│
├─1─► POST /api/agents/acquire/parse-cv (agilex-portal)
│ ├── Try: agilex-tools/api/tools/cv-parser (real PDF→JSON)
│ ├── Fall back: Workers AI inline extraction
│ └── Fall back: raw text passthrough
│
├─2─► Gemini Pro scores candidate 0-100 (via AI Gateway)
│ ├── Auto-advance to Screening if ≥80
│ └── Fall back: Workers AI scoring
│
├─3─► huly-recruit-mcp/create_talent (real Huly ATS write)
│ ├── Creates Person + Candidate mixin
│ ├── Adds email/phone/LinkedIn channels
│ └── Links Drive CV URL as Homepage channel
│
├─4─► Google Drive upload (STUB → real when service account ready)
│ └── Store CV in /Candidates/Active/{name}/
│
├─5─► Gmail notification (STUB → real when service account ready)
│ └── Send acknowledgement to candidate
│
└─6─► D1: INSERT candidate + LOG agent_activity
Steps 1-3 are real today. Steps 4-5 are stubs. Step 6 is real (D1).
6 Wiring Plan — What to Do and In What Order
| # | Task | Effort | Dependencies | Result |
|---|---|---|---|---|
| 1 | Deploy agilex-tools to agilex-tools.pages.dev | 5 min | None | CV parser API goes live |
| 2 | Set CV_PARSER_URL on portal + deploy | 10 min | Step 1 | Acquire agent calls real parser |
| 3 | Set AI Gateway secrets (CF_AIG_TOKEN, GOOGLE_AI_KEY, ANTHROPIC_API_KEY) | 15 min | Create AI Gateway in CF dashboard | Multi-model scoring works |
| 4 | Start Huly locally + run MCP seed script | 30 min | Docker running | Huly workspace with demo data |
| 5 | Wire portal → huly-recruit-mcp (HTTP wrapper) | 1-2 hrs | Step 4 | Acquire agent creates real Huly talents |
| 6 | Google Workspace service account | 1 hr | GCP project | Drive, Gmail, Calendar, Sheets go live |
| 7 | Update simulator to show real API responses | 30 min | Steps 1-3 | Sim shows "Live" badges on real data |
7 Consolidated Repo Map
| Repo | Org | Role | LOC | Status |
|---|---|---|---|---|
| agilex-portal | 2nth-ai | API gateway + agent orchestrator | 1,650 | Active |
| agilex-tools | 2nth-ai (mirror) | CV parser + recruitment tools API | 3,646 | Active |
| huly-recruit-mcp | 2nth-ai (mirror) | MCP server for Huly ATS | 1,149 | Active |
| agilex-sim | 2nth-ai | Recruiter-first simulator UI | 657 | Active |
| agilex-site | 2nth-ai | Marketing site (Astro) | 513 | Active |
| agilex-docs | 2nth-ai | Internal documentation hub | ~4,000 | Active |
| agenticx-agents | 2nth-ai | Python ADK reference + architecture | 2,092 | Reference |
Total active codebase: ~7,615 LOC TypeScript/Astro + ~4,000 LOC documentation.
8 What Makes This Stack Different
No Framework Lock-in
We use protocols (A2A, MCP) not frameworks. Any A2A client can discover our agents. Any MCP client can call Huly. Models swap via one env var.
Edge-First
Agents run on Cloudflare Workers — 300+ cities, zero cold starts. CV parsing happens at the edge before hitting any external API. ~50ms for edge tasks vs ~200ms for cloud.
Real Tools Already Working
The CV parser extracts real PDFs. The MCP server writes real Huly records. The AI Gateway routes to real models. This isn't a demo — it's infrastructure with a demo UI on top.
Graceful Degradation
Every integration has a fallback: tools API → Workers AI → raw text. Gemini → Claude → Llama. Huly MCP → stub. Google → stub. The system always works, just at different fidelity levels.
9 Cost Projection
| Component | Monthly (ZAR) | Notes |
|---|---|---|
| Cloudflare (Workers, D1, KV, Pages, AI Gateway) | R0 | Free tier covers all |
| Workers AI (Llama + embeddings) | ~R90 – R180 | ~$5-10/mo |
| Gemini API (Flash + Pro) | ~R180 – R540 | ~$10-30/mo via AI Studio |
| Anthropic API (Claude Sonnet) | ~R360 – R720 | ~$20-40/mo for quality tasks |
| Google Workspace | Existing | Already provisioned |
| Total | R630 – R1,440 | ~$35-80/mo |
10 Decision Points for Next Session
Before wiring, decide:
- Deploy agilex-tools to
agilex-tools.pages.dev? - Create AI Gateway + set Gemini/Claude API keys?
- Start Huly locally for MCP testing?
- Google Workspace service account — create now or defer?
Quick wins (30 min total):
npm run build && wrangler pages deployon agilex-tools- Set
CV_PARSER_URLon portal - Create AI Gateway in CF dashboard
- Set 3 secrets:
CF_AIG_TOKEN,GOOGLE_AI_KEY,ANTHROPIC_API_KEY - Deploy portal → real CV parse + real scoring live