Skip to content
FIM / blog

From Vibe Coding to Production: Monitoring Cancer Research with FutureX

A step-by-step guide to converting a vibe-coded prototype into a production-grade AI agent with FutureX, focused on monitoring oncology breakthroughs.

FT
FIM Team

6 min read

From Vibe Coding to Production: Monitoring Cancer Research with FutureX
From Vibe Coding to Production: Monitoring Cancer Research with FutureX

Vibe coding gave us a working prototype in an evening. It fetched headlines from Stanford Medicine and other science feeds, then piped them into an LLM for a summary. In production, that script would fail: no retries, no schema, no observability. This guide shows how to rebuild it as a production-grade agentic AI system using FutureX, the coding agent from FIM. We will cover ingestion, filtering, extraction, notification, and observability, with a concrete example that scans Stanford Medicine's advancements and other oncology news.

From Vibe Coding to Production#

The gap between vibe coding and production AI is not about model quality. It is about control. A prototype runs until a feed changes format or a network request times out. A production agent handles both gracefully and explains what it did. FutureX lets you build agents that combine a generative model with deterministic tools, structured data contracts, and full traceability.

When we first vibe-coded a cancer research monitor, the script looked like a notebook with a loop: download RSS, concatenate text, call the model, print a summary. It worked for demo day. But there was no way to know why the model skipped an article, no way to prevent duplicate Slack messages, and no way to parse the output into a database. Rebuilding with FutureX transformed that script into a service we can trust.

The core principle is to separate the parts. The model decides what is relevant and how to phrase a brief. Everything else—fetching, parsing, deduplication, delivery—is a tool. FutureX makes tool calling explicit, so you can see every action the agent takes.

Designing the Monitoring Agent#

Our target is an agent that scans Stanford Medicine's news section plus a few general science feeds for oncology breakthroughs. It classifies each announcement, extracts clinical entities, and generates a concise, actionable brief for researchers. The agent runs on a schedule and posts to a private Slack channel.

Defining the Data Sources#

Start with one reliable source: Stanford Medicine's press release feed. Add PubMed's oncology RSS filter and maybe Science Daily. For a scoped prototype, three feeds are enough. Each feed has different XML structures, so the ingestion tool must normalize them to a common item format.

The Output Schema#

A production AI agent must yield consistent JSON. We define a Brief schema before writing any logic:

JSON
{
  "title": "string",
  "url": "string",
  "publication_date": "ISO8601",
  "institutions": ["string"],
  "cancer_type": "string or null",
  "intervention": "string or null",
  "summary": "string (max 2 sentences)",
  "impact_level": "low|medium|high"
}

FutureX supports structured output mode, which forces the model to conform to this schema. If the model tries to return extra fields or malformed JSON, the agent rejects the result and regenerates it. That is a major leap from vibe coding, where output was a markdown blob we parsed with regex.

Diagram showing the architecture of the cancer research monitoring agent, from news feeds to FutureX to Slack

Source: med.stanford.edu

Building the Pipeline with FutureX#

We define the agent as code. This is important for version control, testing, and deployment. FutureX exposes a configuration object with an agent name, a list of tools, and a system prompt. The system prompt describes the researcher audience and the level of caution required when describing clinical findings.

Ingestion Tool#

The first tool, fetch_feed, takes a URL and optional If-Modified-Since header. It returns a normalized list of items: title, link, summary, publication date. A cron trigger invokes the agent every hour. FutureX lets you attach the cron as an event source, so you do not need a separate scheduler.

Filtering Tool#

Raw RSS summaries are often cryptic. The agent uses a filtering step to decide if a headline is about oncology. Because this is an agentic AI, the filter is not a hard-coded keyword list. The model reads the title, the feed summary, and any initially available metadata. It can reason about phrases like "pancreatic ductal adenocarcinoma" or "CAR-T therapy." If relevance is unclear, the agent fetches the full article.

The developer must constrain the filter to avoid scope creep. The system prompt says: "Focus on cancer research, especially clinical trials, drug approvals, and translational findings. Ignore general biotech funding news unless it is oncology-specific." This keeps the agent sharp.

Full-Text Extraction#

For promising items, the agent calls fetch_article. We use a simple readability parser that strips navigation and returns body text. FutureX records the byte count and status code, so we can debug when a publisher changes its markup.

After fetching, the model performs extraction. It looks for cancer type, intervention (drug, antibody, radiation, surgical technique), and institutions like Stanford Medicine. This is where structured output shines. The extraction step returns JSON that matches the Brief schema, with cancer_type and intervention possibly null if the article is not specific.

Generating Actionable Briefs#

The brief itself must be concise. Researchers get hundreds of alerts per day; a 200-word summary is too long. We instruct FutureX to produce exactly two sentences. The first sentence states the finding and patient population. The second sentence states the intervention and the reported outcome, without hype.

For example, if Stanford Medicine announces a phase II trial for a KRAS inhibitor in non-small cell lung cancer, the brief might read: "A phase II trial at Stanford Medicine evaluated an oral KRAS G12C inhibitor in 78 patients with previously treated non-small cell lung cancer. The intervention showed a 42% overall response rate, with grade 3 or higher adverse events in 15% of participants." That is actionable.

Delivery and Deduplication#

Once the agent generates a brief, it calls send_brief. We use Slack's webhook. To prevent duplicates, each item is hashed by URL plus publication date. FutureX keeps a state store across runs, so the agent can check existing hashes before sending.

We also assign an impact level. The model classifies the brief as high, medium, or low. High-impact briefs go to a human review channel before the general dispatch. This is a simple human-in-the-loop safeguard that works well for production AI in clinical domains.

Hardening for Production#

A vibe-coded prototype crashes silently. A production agent fails loudly but recovers. We harden the pipeline in three areas.

Error Handling and Retries#

Every tool call in FutureX can define a retry policy. For network-bound tools like fetch_feed, we use exponential backoff with jitter. After three failed attempts, the agent marks the source as unavailable and continues with other sources. If the model itself times out, FutureX retries with a lower temperature and the same prompt.

We also handle malformed content. A feed item might not have a published date. The agent uses a validation tool to coerce missing dates into a sentinel value. The Brief schema allows null dates, but the delivery tool drops any brief older than 60 days.

Observability and Replay#

FutureX emits a trace for every run. Each trace includes the model's reasoning, every tool call and its response, the structured output, and the final delivered message. When a researcher asks, "Why did we get this alert?", you can show the exact article and the model's reasoning path.

For production AI, we also set up metrics: number of feeds fetched, articles filtered out, briefs generated, and Slack delivery failures. A dashboard gives immediate signal. If the rate of extracted cancer_type nulls jumps, we know the prompt or a feed changed.

Conclusion#

Vibe coding is a great way to explore agentic AI, but production requires discipline. With FutureX, we turned a fragile script into a reliable monitor that scans Stanford Medicine and other sources, filters oncology news, and delivers structured, concise briefs. The same pattern applies to any domain: define a schema, build small tools, and let an agentic AI coordinate the workflow. Start with a prototype, then harden it with FutureX.

Share this article