Client: Demandfarm (Key Account Management software for B2B)
Role: Consultant / builder
Period: 2024
Stack: Python, Portkey AI Gateway, SEC API, Yahoo Finance API, Google Search, AWS Cloud, PostgreSQL, REST API, ThreadPoolExecutor
Demandfarm sells Key Account Management software to enterprise B2B teams. Their users are key account managers and sales leaders managing strategic existing accounts, not SDRs prospecting cold lists.
Before any strategic account meeting, a KAM needs to know what the account is doing financially: latest earnings, year-over-year trends, recent leadership changes, competitive moves, strategic priorities from the CEO's commentary. The information exists publicly (SEC filings, earnings call transcripts, annual reports, financial news), but reading and synthesizing it for one account takes hours. At enterprise volume, the math does not work.
Demandfarm wanted an agent built into their platform that would automate this research and produce a digestible report for each account.
A REST-API account intelligence agent with two specialized data collectors and an LLM synthesis layer.
For listed companies. Input: a ticker symbol (the agent first resolves the official ticker from the CRM-provided account name, since the CRM name is often inaccurate). Collects in parallel:
Output: a structured dictionary with basic info, news, financials, balance sheet, cash flow, annual report extracts, earnings call summary, and value-proposition alignment.
For non-listed companies. Input: a company domain. Collects from the company website plus LLM analysis:
Both collectors feed a synthesis step (via Portkey Chat API) that produces five output sections:
Portkey AI Gateway. Every LLM call routes through Portkey. Lets us switch providers (Claude, GPT, open-source) without changing call sites, externalize prompt templates, get observability and logging out of the box. Critical for a long-lived API that needs to evolve model choice without redeploying.
Parallel collection with ThreadPoolExecutor. Each data source has its own latency profile (SEC API is slow, Yahoo is fast, Google Search is medium). Sequential collection would take 30+ seconds per account. Parallel fan-out brings it under 10s for the public collector.
Database UPSERT with 2-week TTL. Account research is expensive to generate. Cached results live for 2 weeks. Re-requests within that window serve from cache. After 2 weeks, the next request triggers a refresh. Refresh is PULL-based (on next request), not automatic, which keeps infrastructure cost bounded.
Async job interface. Account research takes 10 to 60 seconds depending on data sources. Synchronous REST would tie up client connections. The API uses a job-token pattern: submit a request, get a token, poll the token endpoint or receive a webhook on completion.
Credit-based rate limiting. Each customer has a credit balance with expiry (for example, 100 credits valid until a specific date). Each account research is 1 credit. Rate limit is per-customer, capped at 5 calls per minute. Audit logging captures every REST invocation for billing and debugging.
Company name resolution. CRM-stored account names are often informal or incorrect. The agent has a name-resolution step that disambiguates the official ticker symbol and long name from a fuzzy input. Handles edge cases like Nestle (multinational with regional listings) and ambiguous small-caps.
Multi-market ticker coverage. Tested across NYSE, NASDAQ, Euronext, LSE, SZSE, TSX, BSE, ASX. The agent picks the appropriate market based on the input or surfaces ambiguity.
The agent replaced 1 to 3 hours of manual KAM research per account with a single API call returning a structured report in 10 to 60 seconds. At Demandfarm's customer volume the engagement paid back inside a quarter.
Beyond the immediate value, the engagement established the productization pattern I now apply across other client builds: deterministic input, parallel data collection, LLM synthesis, structured artifact out, with eval, caching, rate limiting, and observability built in.
This is the credential for both AI Workflow Automation and Custom AI Agents + RAG. The Demandfarm engagement specifically: a real B2B SaaS company, a real expensive-analyst workflow, replaced with a productized AI pipeline that ships a deterministic artifact every time.
The deeper proof: the agent is in production today, serving real KAM users inside Demandfarm's platform, with audit logging, rate limiting, and credit-based billing. Not a demo, not a notebook, a shipped REST service.
If your team has a similar workflow, an analyst burning hours doing public-data research that ends in a written summary, that is exactly the shape of build I would design for you.
Step 1: scope which workflows are worth automating (1 week). Step 2: build one as a productized agent (2 to 4 weeks). Step 3: if it works, repeat. Most teams run 5 to 10 agents like this once the first is in production.
Book a 30-min discovery call to talk through your specific workflow.
Book a 30-min call. We will talk through the architecture and what it would take to ship something like this for you.