Skip to content
All projects

KalqylAI Bot Suite — Real-time + Long-form Equity Research

Two autonomous AI bots running on Kalqyl's data layer: a real-time Twitter agent that turns a press release into a published tweet in under 30 seconds, and an analytical bot that writes structured long-form equity research reports.

2024 · AI & ML Consultant · Predli Consulting AB · 2+ years · in production

<30s

PR → tweet

8,000+

AI reports published

4.6M

annual views

16,000+

investors reached

Stack: python · llms · agentic-ai · prompting · fastapi · azure · validation

Context

Kalqyl AI is the consumer face of Predli's work with Spotlight Group — an autonomous AI equity researcher covering 160+ Swedish-listed companies. It runs as two distinct bots, each with its own job description:

  • A real-time Twitter agent — the public face on X (@KalqylAI). When a press release drops, it has seconds to publish a sharp, investor-grade summary thread.
  • An analytical bot — the long-form researcher. It writes structured equity research reports: dynamic outlines, rendered charts, financial ratios, segment commentary, and a coherent narrative across multiple disclosures.

Both bots consume the same enriched event stream from the underlying data infrastructure. What changes between them is the SLA, the schema of the output, the validation regime, and the prompting strategy.

I was involved in building the entire stack end to end, which broadly involved the following layers:

  • Data Modelling on Postgres and Ingestion pipeline which involves web scraping PRs, finding all valid attachments and ingesting them as well with Parsing, Chunking and Embedding Experiments (pgvector)
  • Designing, Hosting and Implementing end to end event driven pipelines on Azure containing a websocket listen app which invokes various Azure functions in sequence
  • AI based numerical extraction pipeline for tagging, metadata extraction, and extracting numerical details from complex tables
  • Designing a report writer, editor and dynamic graph plotter module which generates large analytical reports
  • Taking client feedback, resolving ambiguity and making technical action points out of it

Why two bots, not one

The instinct in agentic AI is to build one Big Bot that switches modes. We resisted that — the two jobs have incompatible operating envelopes.

The Twitter bot has to publish in under thirty seconds, in one tweet’s worth of text, with a punchy market-facing voice; its failure mode is a wrong number landing in front of investors, so validation has to be tight but lightweight.

The Analytical bot runs in the slower lane. Its output is a multi-section research report in an analyst-grade voice; its failure mode is a misrepresented thesis sitting in the content library forever, so quality and consistency matter more than speed.

A single agent trying to serve both targets lives in a permanent compromise. Splitting them lets each pipeline optimize for its own constraint — and lets the shared work (ingestion, classification, grounding) live cleanly in the data layer below.

Shared event, two pipelines

TWITTER BOT (< 30s SLA)ANALYTICAL BOT (long-form)Enriched Eventfrom data layerAgent Routerfinancial / narrativeTweet + ImageSwedish copy · branded imageEntity Validationticker · company · subsidiaryOutline Plannerdynamic per-companySection Retrievalwriting against tight slicesCharts + Formatprogrammatic · persona-aware@KalqylAI on Xreal-time tweetsKalqyl Libraryresearch reports · 8,000+

The Twitter bot — PR to tweet in 30 seconds

The Twitter bot's whole job is to react fast and be right. It contains a layer of scraping and getting PR text, preprocessing, relevancy classification, PR classifier (financial, narrative) for relevant tweet, tweet generation, post processing and publishing. Along with the tweet bot, I also made an analytical pipeline for the client providing insights on investors' interaction, which involves month-over-month analyses in likes, impressions, followers and what people are liking more.

When the PR is scraped and is deemed relevant enough to be tweeted about, the Twitter bot routes it by classifier label to one of two specialized agents:

  • Financial agent — numbers-first template. Earnings, dividends, capital actions, profit warnings. The agent works from the extracted financial tables, not from prose, so a Q3 revenue number on the tweet matches a Q3 revenue number on the disclosure.
  • Narrative agent — story-first template. Personnel changes, legal actions, product launches, M&A signals. The agent works from the body and structured metadata (who, what, which subsidiary, ticker).

Each agent generates a tweet (or short thread) in Swedish, plus a dynamically composed branded image carrying the company logo and the key data points the tweet refers to.

In action

When a press release drops — say, Maximum Entertainment AB filing a lawsuit against Cathay Bank — the data layer ingests it, the classifier routes it to the narrative agent, and @KalqylAI publishes a concise Swedish summary within 30 seconds. The bot extracts the key facts (who, what, which subsidiary, stock ticker), generates the tweet, composes a branded image with the company logo, and publishes — autonomously.

The Analytical bot — long-form AI research

The analytical bot operates in the slower lane. Its job is to write structured research reports that an institutional investor would actually read.

A run looks roughly like this:

  1. Outline planning. Given a company and a research scope, the bot drafts a dynamic outline — not a fixed template, since section choices depend on the company’s sector, recent disclosures, and what’s actually interesting in the data.
  2. Section-level retrieval. For each planned section, the bot pulls the relevant slice of the data layer (recent press releases, financial tables, segment data) and writes that section against that slice rather than against the entire universe of company data. Tight context, fewer hallucinations, better grounding.
  3. Chart generation. Where a chart adds substance, the bot produces it programmatically from extracted numerical tables rather than embedding screenshots. Charts are first-class artifacts, not decoration.
  4. Persona-aware formatting. The same underlying analysis renders differently depending on the audience — depth of statistical detail, glossary inclusion, length of executive summary.
  5. Estimation module. Responsible for generating EBITx estimations using AI reasoning models after gathering relevant information from the database.

The output is a structured research report that joins the Kalqyl content library — contributing to the 8,000+ reports and insights published to date.

What’s shared between the two bots

The two bots look very different at the surface, but they share the same foundation: one enriched-event contract from the data layer, and the same grounding discipline — both bots are conditioned on the structured payload (extracted tables, classified metadata, entity tags) rather than on raw text alone.

That’s the part that pays off over time. The visible win is the tweet and the report. The invisible win is that the next bot — whatever it ends up being — inherits the foundation for free.

Results

In production since 2023, the bot suite has shipped 8,000+ AI-generated reports and insights, generating 4.6 million annual views and reaching 16,000+ investors including private individuals, fund managers, and institutional buyers.

Reflection

Some difficulties and learning from the project involve:

  • Making large coherent reports without repetition
  • How to modularize different aspects and divide pipeline tasks, eval and strategy
  • Prompting pitfalls: Saw first hand the ordering bias, context overload and engineering, chain of thoughts/reasoning and how it works, chain of LLM modules