Back to case studies

Demandfarm: Account Research Workflow Automation

Client:Demandfarm
Period: 2024
Outcome: automated account intelligence agent that pulls SEC filings, earnings calls, financial data, and competitor signals into a single research report for Key Account Managers
Stack:PythonPortkey AI GatewaySEC APIYahoo Finance APIGoogle SearchAWSPostgreSQLThreadPoolExecutorREST API

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

The problem

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.

What I built

A REST-API account intelligence agent with two specialized data collectors and an LLM synthesis layer.

Public Company Data Collector

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:

  • Yahoo Finance API for basic info, news, financials, balance sheet, cash flow
  • SEC API for regulatory filings and annual reports
  • Google Search for annual reports and earnings call transcripts not exposed via the structured APIs
  • Portkey Chat API for LLM analysis of annual reports and earnings call transcripts

Output: a structured dictionary with basic info, news, financials, balance sheet, cash flow, annual report extracts, earnings call summary, and value-proposition alignment.

Private Company Data Collector

For non-listed companies. Input: a company domain. Collects from the company website plus LLM analysis:

  • CEO information
  • Funding rounds and latest funding details
  • Lingo map (the company's specific terminology)
  • Analyzed website content (growth and focus areas)
  • Similar companies
  • Customers
  • Ideal customer profile
  • Employee count

LLM Synthesis Layer

Both collectors feed a synthesis step (via Portkey Chat API) that produces five output sections:

  • A. Firmographics. Official name, business type, industry, sub-industry, HQ, regional offices, ownership status, parent and subsidiaries, financial performance, funding, leadership, founders, target market, key customers, market position, product lines, milestones
  • B. Recent News. Key developments, financial updates, leadership changes, market trends, PR and CSR activities, challenges and controversies
  • C. Top Competitors. Identification, competitive analysis (strengths, weaknesses, market share, positioning), product and service comparison, recent activities
  • D. Summarized Reports synthesized from earnings reports and earnings call transcripts. Strategic goals, performance highlights, market outlook, quarterly results, management commentary, future guidance
  • E. Aligned Value Proposition. Maps the user's organization's value proposition to the target account's strategic priorities and pain points, producing a contextualized recommendation

The engineering that made it ship

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 outcome

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.

What this case is proof of

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.

What I would do for you

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.

Want a similar build for your team?

Book a 30-min call. We will talk through the architecture and what it would take to ship something like this for you.