silicon-sampling

silicon-sampling

MCP server that implements a cognitive survey response framework by storing persona information in a modular database and allowing LLMs to selectively retrieve relevant modules for each survey question.

Category
访问服务器

README

Structured Silicon Sampling (S3)

Open-source implementation for the IC2S2 2026 paper:

Beyond Prompting: A Cognitively-Grounded Framework for Silicon Survey Samples

S3 operationalizes the cognitive model of survey response (Tourangeau et al., 2000) as a Model Context Protocol (MCP) server. Instead of loading an entire persona backstory into the prompt, S3 stores persona information in a modular database and lets the LLM selectively retrieve only the modules relevant to each survey question.

Framework Architecture

Architecture

The framework externalizes the four stages of the cognitive survey response model into three separable layers:

Layer Cognitive stage What it does
Rules Comprehension + Response Provides a minimal identity anchor (persona_id) and strict response constraints. No demographic or attitudinal content is pre-loaded, forcing the model to actively seek information.
Skills Judgment + Strategy A cognitive router that selects a reasoning procedure based on question type: Factual Recall, Direct Attitude, or Attitude Construction. Each skill specifies which modules to retrieve and how to synthesize them.
MCP Retrieval Exposes the persona as a modular database (13 domains, ~170 fields) accessible only via explicit tool calls. The model retrieves 2-5 modules per question rather than receiving all ~170 fields at once.

Repository Structure

server.py                 MCP server (core)
run_experiment.py         Experiment runner (Claude Agent SDK)
analyze_results.py        Compute per-persona metrics (exact match, within-1, MAE)
significance_analysis.py  Paired significance tests across phases
eval_items.json           22 held-out ANES 2024 evaluation items with ground truth

personas/                 50 ANES 2024 personas (stratified by party ID x region)
  anes_001.json ... anes_050.json

rules/                    Rule templates (researcher-specified)
  survey_respondent.txt   Full framework rule (identity anchor only)
  baseline_static.txt     Static backstory baseline (Argyle et al. style)
  rules_only.txt          Ablation: rules without Skills or MCP

skills/                   Skill templates (model-selected per question)
  factual_recall.txt      Personal circumstances and estimation
  direct_attitude.txt     Single-topic policy/social attitudes
  attitude_construction.txt  Complex cross-domain attitude formation

scripts/                  Data processing
  download_anes.py        Download ANES 2024 data
  generate_personas.py    Generate persona JSON files from ANES

results/                  Pilot experiment results (N=10 per phase)
  phase0_phase1_n10_seed2024.json   Phases 0-1
  phase2_n10_seed2024.json          Phase 2
  phase3_n10_seed2024.json          Phase 3

Quick Start

Prerequisites

  • Python 3.10+
  • An MCP-compatible client (Cursor, Claude Desktop, or Claude Agent SDK)

Installation

pip install -r requirements.txt

Run the MCP Server

# stdio transport (for Cursor, Claude Desktop)
python server.py

# SSE transport (for web clients)
python server.py --transport sse

# Restrict modules for phase experiments
python server.py --allowed-modules demographics life_narrative politics economy health social_context local_context

Configure in Cursor

Add to .cursor/mcp.json:

{
  "mcpServers": {
    "silicon-sampling": {
      "command": "python",
      "args": ["/absolute/path/to/server.py"]
    }
  }
}

Configure in Claude Desktop

Add to claude_desktop_config.json:

{
  "mcpServers": {
    "silicon-sampling": {
      "command": "python",
      "args": ["/absolute/path/to/server.py"]
    }
  }
}

MCP Tools

Tool Description
get_survey_skill Select a reasoning skill (factual_recall, direct_attitude, attitude_construction) based on question type
get_persona_modules Selectively retrieve persona modules by name (e.g., ["economy", "demographics"])
get_retrieval_log View all skill selections and module retrievals this session

Persona Modules

Each persona contains up to 13 thematic modules (~170 fields total):

Module Fields Content
demographics 10 Age, gender, race, education, income, marital status, religion, state
life_narrative 1 Summary of life circumstances
politics 35 Party ID, ideology, approval, voting, candidate evaluations, participation
economy 18 Employment, housing, investments, food security, economic outlook, trade
health 20 Insurance, healthcare concerns, mental health, diagnosed conditions
social_context 19 Social trust, group thermometers, immigration, police, guns
racial_attitudes 16 Racial/ethnic group thermometers, discrimination perceptions
values_personality 9 Moral foundations, authoritarianism, science attitudes
media_consumption 12 News sources, social media, Fox/CNN, institutional thermometers
religion_community 7 Attendance, importance, guidance, children, community
local_context 2 State, census region
policy_positions 19 Spending priorities, candidate placements, competence ratings
civic_participation 3 Campaign volunteering, signs, buttons

Experiment Design

The pilot experiment varies persona complexity across four phases to test the hypothesis that S3's advantage grows with information load:

Phase Modules Fields Retrieval
0: Sparse 7 ~31 Limited (2-3 modules)
1: Enriched 11 ~107 Limited (2-3 modules)
2: Enriched + free 11 ~107 Unlimited
3: Full 13 ~170 Unlimited

Each phase uses 10 randomly sampled personas (non-overlapping across phases) evaluated on 22 held-out ANES items across six domains (politics, economy, health, social context, racial attitudes, values).

Reproducing Results

# Run experiment (requires Claude Agent SDK with Max subscription)
python run_experiment.py --phases 0 1 --n-personas 10 --conditions baseline_static full_framework --seed 2024
python run_experiment.py --phases 2 --n-personas 10 --conditions baseline_static full_framework --seed 2024
python run_experiment.py --phases 3 --n-personas 10 --conditions baseline_static full_framework --seed 2024

# Analyze results
python analyze_results.py results/phase0_phase1_n10_seed2024.json results/phase2_n10_seed2024.json results/phase3_n10_seed2024.json

# Significance tests
python significance_analysis.py

Example Session

A typical survey simulation with the full framework:

1. Model reads Rule (survey_respondent.txt): receives persona_id and response constraints only
2. Model receives survey question: "How often can you trust the federal government?"
3. Model calls get_survey_skill("attitude_construction", "trust in federal government")
   -> Receives instructions to retrieve politics + economy + values_personality + demographics
4. Model calls get_persona_modules("anes_010", ["politics", "economy", "values_personality", "demographics"], "trust in federal government")
   -> Receives only those 4 modules (~80 fields), not all 170
5. Model synthesizes a response grounded in the retrieved information

Ablation Conditions

The full evaluation plan compares four conditions to isolate each layer's contribution:

Condition Rule Skills MCP Retrieval
Baseline baseline_static (full backstory in prompt) No No
Rules only rules_only (anchor + full backstory) No No
Rules + Skills survey_respondent + skill selection + full backstory Yes No
Full S3 survey_respondent + skill selection + selective retrieval Yes Yes

License

MIT

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选