galapagos
DocsHubLeaderboardPlaygroundNews
galapagos

six blocks · any task ·
better solutions emerge.

Platform

  • Hub
  • Leaderboard
  • Playground

Resources

  • Docs
  • API reference
  • Card spec

Community

  • GitHub
  • Contribute

Updates

  • News
  • Releases

© 2026 Galapagos. Licensed under Apache-2.0.

Build your own scaffold.

Hub/Scaffolds/default/Beam Search

default/beam_search

Maintain a fixed-width beam of promising programs; expand one per step, prune by fitness+diversity.

Test-time searchApache-2.0
Scaffold cardFiles and versions
beam_search/prompt_builder.py
15 lines · 936 BpythonDownload
"""Beam Search PromptBuilder component — the standard multi-section template (SkyDiscover default builder)."""
from __future__ import annotations

from ...components.prompt import DefaultPromptBuilder


class BeamSearchPromptBuilder(DefaultPromptBuilder):
    """SkyDiscover's default context builder: task -> metrics -> feedback -> inspirations -> current
    program. Beam Search adds nothing of its own, so it renders the canonical multi-section message."""

    # BeamSearchDatabase.sample() returns a plain (parent, [programs]) tuple, which the SkyDiscover
    # controller wraps as {"": [...]} → DefaultContextBuilder._format_other_context_programs takes the
    # DICT branch, whose preamble differs from the list branch ("...may inspire new ideas:").
    inspiration_preamble = ("These programs represent diverse approaches and creative solutions "
                            "that may be relevant to the current task:\n")