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
- Call
verbalized_sampling_initializewithquery,mode, optionalinput_content,num_samples,num_responses, and probability threshold. - Generate the requested number of candidate samples in the user's language.
- Call
verbalized_sampling_auto_submitwith samples that containtextandprobability. - Use
verbalized_sampling_get_all,status,list,resample,export, ordeleteas 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.pyowns session state, validation, selection, statistics, export, and deletion.configs/config.pydefines modes, sample limits, probability thresholds, export formats, and selection strategies.src/utils/session_persistence.pyprovides 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.