Framework
microsoft/TimeCraft avatar
microsoft/TimeCraft

TimeCraft: Microsoft's Diffusion Framework for Cross-Domain Time Series Generation

Official code for TimeCraft: A Time Series Generation Framework for Real-World Applications

1,090 stars65 forksPythonMIT

At a glance

What is it?
TimeCraft is a Python diffusion framework for generating synthetic time series across domains, with text-based control and task-aware adaptation. It is research code aimed at teams that need controllable synthetic temporal data, not a drop-in library.
Who is it for?
TimeCraft is for research and applied ML teams that need synthetic time series with domain control, text conditioning, or downstream-task targeting, and that can read a paper alongside the code. It is not for teams wanting a pip-installable data augmentation library, and it is not a substitute for collecting real data where collection is feasible.
Can I use it commercially?
Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 40 days ago.
What is it written in?
Mainly Python, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on September 15, 2026, and from our analysis. They are not legal advice.

DEEP OPEN-SOURCE ANALYSIS

The problem TimeCraft targets: single-domain generators and unconditional sampling

Most time series generators are trained on one dataset and reproduce that dataset's distribution. The TimeCraft README states this directly: existing methods are "limited to single-domain generation" and "lack controllability." The second complaint matters more than the first for practitioners. A generator that produces plausible ECG windows is useful only if you are working on ECG. A generator that produces plausible ECG windows when you ask for them, and stock ticks when you ask for those, is a different kind of asset. TimeCraft is built for the second case. The intended users are teams in healthcare, finance, energy, and transportation that face data scarcity, privacy constraints on sharing real records, or a need to simulate scenarios that cannot be collected. The README also names a third failure it wants to fix: models that "focus solely on replicating the training data distribution" without asking whether the synthetic data helps the downstream model. That is the target-aware claim, and it is the most ambitious part of the framework.

Semantic prototypes and the Prototype Assignment Module

The cross-domain mechanism rests on a shared latent space. TimeCraft learns what the README calls "semantic prototypes," described as a dictionary of temporal patterns that encode domain-invariant features such as trends and seasonality. A prototype is not a template you pick by hand. It is a learned latent component, and the claim is that the same components reappear across domains. Adaptation to a new domain happens through the Prototype Assignment Module (PAM), which computes domain-specific weights over the prototypes from few-shot examples. The result is a domain prompt, a latent representation of the target domain built without labels and without retraining the base model. The design has a clear appeal: you pay for the base model once and pay a small few-shot cost per new domain. It also has a clear dependency. The quality of the prompt is bounded by the few-shot examples you supply. The README does not specify how many examples count as few-shot, how sensitive the prompt is to their selection, or what happens when the target domain shares no prototypes with the training mixture. Those are the questions to answer before trusting cross-domain output.

Text conditioning and the multi-agent description pipeline

The second branch is text control. TimeCraft uses a multi-agent text generation system to produce textual descriptions of time series patterns, and those descriptions become paired time series and text data for training. At generation time the framework combines semantic prototypes with free-form textual prompts, which the README calls hybrid conditioning. The practical value is interpretability: a prompt can name a trend, a seasonality pattern, or a domain characteristic, and the prototype side keeps the output grounded in patterns the model has actually seen. The risk is inherited from the text pipeline. If the multi-agent system writes descriptions that do not match the underlying series, the model learns a mismatched pairing, and no amount of conditioning at inference fixes that. The README does not describe a validation step for the generated descriptions, so anyone using this branch should inspect the paired data before training on it. Treat the text branch as a data-construction pipeline you have to audit, not a black box.

Influence-guided diffusion for downstream tasks

The third branch changes the objective. Instead of matching the training distribution, TimeCraft generates samples intended to improve a downstream model, using an influence-guided diffusion mechanism that estimates the expected reduction in task-specific loss through influence functions. The README lists forecasting, classification, and anomaly detection as the target tasks. This is the part of the framework with the least detail in the supplied material. Influence functions are expensive to compute, and the README does not say how the estimate is approximated, how often it is recomputed during sampling, or what the cost is relative to unconditional generation. It also does not say what happens when the downstream model is later retrained on a different architecture, since the generated samples were optimized against one specific model and loss. If you adopt TimeCraft for this feature alone, plan to verify the influence computation yourself in the code before committing to it.

Getting it running: what the README actually gives you

The README supplies no installation command, no dependency list, no Python version, and no configuration keys. What it does supply is a repository layout: the 2026 announcements point to three subdirectories, CaTSG, OATS, and Diff-MN, each linked from the news section with its own paper. The framework overview states that TimeCraft supports "three flexible input branches," which correspond to the prototype, text, and target-aware paths described above. Beyond that, the practical steps are the standard ones for research code: clone the repository, read the subdirectory READMEs and any requirements files that ship with them, and check whether the main branch contains a training script. The absence of releases is worth noting. With no tagged versions, there is no stable interface to pin against, and no upgrade path other than tracking main. For a project whose last push is dated 2026-08-07, that means your integration is against a moving target.

Where TimeCraft is the wrong tool

The most obvious limitation is that this is research code. No releases, no documented install, no config reference in the supplied material. If your team needs synthetic time series next week and has no capacity to read a paper and adapt training scripts, TimeCraft will cost more than it returns. A second limitation is the few-shot requirement in the PAM path: cross-domain generation assumes you can supply representative examples of the target domain. If you have none, the prototype assignment has nothing to weight against, and you are back to the base model's training mixture. A third is the evaluation gap. The README does not describe metrics, baselines, or a benchmark harness, so you cannot compare TimeCraft output to your existing augmentation without building that comparison yourself. Finally, the target-aware branch optimizes against a specific downstream model and loss. If your production model changes architecture or objective, the samples generated for the old one may no longer be the right samples.

Alternatives and the difference in approach

The README itself names TimeDP, a Microsoft Research project described as creating cross-domain synthetic time-series data, and links a research blog about it. The distinction visible in the material is scope. TimeDP is presented as a cross-domain generator; TimeCraft adds text-based control and influence-guided, target-aware generation on top of the cross-domain foundation, and the 2026 updates extend it further into causal control (CaTSG), online augmentation for time series foundation models (OATS), and continuous generation from irregular observations (Diff-MN). If your need is cross-domain generation alone, TimeDP is the narrower and presumably simpler target. If you need to steer generation with text or to optimize synthetic data for a downstream task, TimeCraft is the only one of the two that claims those capabilities in the supplied material. Outside Microsoft's own line, the general alternative is classical augmentation (jittering, scaling, window warping) applied to your existing series. That approach needs no training and no few-shot examples, but it cannot invent a domain you have no data for, which is precisely the case TimeCraft is built around.

Licence, maintenance, and what to verify first

TimeCraft is MIT licensed, which permits commercial use and modification with the usual attribution requirement. Nothing in the supplied material suggests a separate licence for the CaTSG, OATS, or Diff-MN subdirectories, but those are separate research contributions with their own papers, so check each subdirectory for its own licence file before shipping anything derived from them. On maintenance: the repository is not archived, the last push is 2026-08-07, and there are no releases. There is no version pin to hold, so an upgrade means pulling main and re-reading the code. For a research framework with three active subprojects, that is a real ongoing cost. The first thing to verify is whether the main branch has a runnable entry point at all; the README as supplied does not name one. The second is whether the few-shot path works for your domain. The third is whether the influence-guided branch has a usable implementation, since it is the feature with the least documentation and the highest computational cost.

Editorial conclusion

TimeCraft is for research and applied ML teams that need synthetic time series with domain control, text conditioning, or downstream-task targeting, and that can read a paper alongside the code. It is not for teams wanting a pip-installable data augmentation library, and it is not a substitute for collecting real data where collection is feasible. Before adopting it, verify three things in the repository: whether the main branch contains a runnable training entry point, whether the CaTSG, OATS, and Diff-MN subdirectories ship their own dependencies and configs, and whether the few-shot examples needed by the Prototype Assignment Module are available for your target domain. If those three checks pass, the MIT licence makes local experimentation cheap; if they do not, you are adopting a paper, not a tool.

Official sources

  1. Issues
  2. License: MIT
  3. microsoft/TimeCraft on GitHub
  4. README
Community notes

Community notes