AlexandrAI AGENTS.md
agents-md

LMSSEP Verbalized Sampling MCP Server Agent Guide

Project-specific AGENTS.md guidance for the LMSSEP Verbalized Sampling MCP server, sample generation, selection strategies, export, and language matching rules.

AGENTS.md

Guidance for coding agents working on LMSSEP Verbalized Sampling MCP Server. This server asks an LLM to produce multiple low-probability candidate responses, then selects one or more according to a strategy.

Project overview

Verbalized Sampling supports creative variation, content improvement, exploration, and balanced response generation. It analyzes the user's language and requested quantity, then guides the LLM to generate diverse samples in the same language as the query.

Setup commands

bashcd <project-root>/genesis/LMSSEP/verbalized_sampling
pip install -r requirements.txt
python main.py

Runtime configuration is controlled by standard MCP server environment variables plus reasoning settings in configs/config.py.

Tool workflow

  1. Call verbalized_sampling_initialize with query, mode, optional input_content, num_samples, num_responses, and probability threshold.
  2. Generate the requested number of candidate samples in the user's language.
  3. Call verbalized_sampling_auto_submit with samples that contain text and probability.
  4. Use verbalized_sampling_get_all, status, list, resample, export, or delete as needed.

Selection strategies include uniform, weighted, lowest, and highest. weighted favors more creative lower-probability responses while still sampling from the set.

Code map

  • src/tools/verbalized_sampling.py owns session state, validation, selection, statistics, export, and deletion.
  • configs/config.py defines modes, sample limits, probability thresholds, export formats, and selection strategies.
  • src/utils/session_persistence.py provides persistence helpers.

Testing and verification

Test generate, improve, explore, and balanced modes. Verify invalid sample counts, missing input_content for improve mode, probabilities above threshold, unsupported strategies, resampling, export formats, and deletion.

Safety and output hygiene

The tool is for diversity, not factual validation. Do not use low-probability samples as facts without independent checking. Redact private prompt content before exporting sessions or publishing reports.

Commit and PR rules

Changes to sampling modes, probability validation, or selection strategies need examples that show the user-facing difference. Keep export formats deterministic enough for review.