Skip to main content
who?? logo

who??

Evidence-Grounded Cognitive Digital Twin, Psycholinguistic & Behavioral Modeling Toolkit

CI Python 3.10+ License: MIT MCP Server M8ven Score Code Style: Ruff

Build evidence-grounded cognitive digital twins from public corpora, transcripts, and documents — analyze linguistic markers, knowledge graphs, conceptual contradictions, and counterfactual scenarios across Claude, ChatGPT (OpenAI), Google Gemini, local Ollama, or 100% Offline execution.


Overview

who?? is an open-source framework for evidence-grounded cognitive digital twins and psycholinguistic behavioral analysis. Instead of prompting a generic role-play chatbot that fabricates opinions, who?? extracts structured signals directly from a subject's writings, speeches, documents, and dialogue logs:

  • Evidence & Citation First: Claims, twin chat replies, and simulated reactions are linked back to retrieved primary corpus quotes and concept-graph relationships, paired with explicit probabilistic framing rather than deterministic claims.
  • Universal AI Stack & MCP Ready: Works out of the box with Anthropic Claude, OpenAI / ChatGPT, Google Gemini, Groq, DeepSeek, OpenRouter, Mistral, local Ollama / vLLM, and 100% zero-API offline mode, plus native MCP (who mcp) and multi-provider JSON tool schemas (get_tool_schemas).
  • Strict Zero-Substitution Identity Gate: Rejects unauthorized name expansions or third-party record merges during academic and OSINT ingestion via strict token matching (entity_validator).
   Primary Footprint & Corpus          Psycholinguistic & Graph Core         Any LLM, Agent, or Offline CLI
 [Articles / Transcripts / PDFs] ──► [Feature Extractor + Cognitive Vault] ──► [Claude / ChatGPT / Gemini / Ollama]
 [Dialogue Logs / RSS / Papers ] ──► [Vector Memory + Concept Graph      ] ──► [MCP Tools / SDK / CLI Reports    ]

Scientific & Mathematical Foundations

Capability Methodology & Implemented Engine What It Does
Negation-Aware Bayesian Psychometrics Clause-scoped syntactic negation guards (English & Turkish) + Beta-Binomial 95% Credible Intervals across lexical markers (Machiavellianism, Need for Closure, Prospect Loss Framing β, Affective Volatility, Moral Foundations, Epistemic Calibration) Prevents false keyword hits (e.g., "no risk", "not only fair", "-mam gerekiyor" vs "kabul etmem") and scales credible intervals with corpus size
CAPS Context Matrix & Stated vs. Revealed Framing Context-conditional keyword bucketing (IF [Context] -> THEN [Signature]) + separation of stated ideals vs. conditional red-line commitments ([NECESSARY_CONDITION_RED_LINE]) Maps how a subject's framing shifts across Academic, Crisis, Strategic, and Interpersonal contexts
Knowledge Graph & Structural Balance Local JSON/NetworkX + optional Neo4j concept graph extraction (ADVOCATES, CRITIQUES, CONTRADICTS), Signed Graph Laplacian spectrum (λ_min), and simulated-annealing Ising frustration metrics Identifies central concepts, recurring tensions, and structural contradictions across a subject's own corpus
Boltzmann-Gibbs Scenario Simulation & Swarms Corpus- and knowledge-graph-conditioned Softmax/Boltzmann-Gibbs scenario models, Monte Carlo sensitivity sweeps, and multi-twin SwarmArena debates Models plausible scenario reactions with explicit provenance, entropy, and free-energy diagnostics (non-predictive scenario modeling)
Temporal Drift, Chronomics & Verification Circadian timestamp bucketing (CognitiveChronomics), Ornstein-Uhlenbeck longitudinal drift analysis (TemporalDriftDetector), Temporal Holdout Backtesting (ProfileEvaluator), and stylometric Jensen-Shannon Divergence (JSD) Tracks day/night rhetorical shifts, longitudinal vocabulary changes, citation validity, and candidate-response style fidelity

Quickstart

1. Installation

Core Installation (Python 3.10+):

pip install the-project-who

Or install from source (includes the bundled read-only Target X demo profile):

git clone https://github.com/tilkiii/the-project-who.git
cd the-project-who
pip install -e .

Optional Extras:

# Persistent ChromaDB HNSW, Neo4j driver, scholarly, yt-dlp:
pip install -e ".[full]"

# Heavy local multimodal ML (Docling, PaddleOCR, BERTopic, Crawl4AI):
pip install -e ".[ml]"

# Development & testing tools (pytest, ruff, mypy):
pip install -e ".[dev]"

Note for Windows users: If the who executable is not on your PATH after installation, invoke the CLI directly with python -m who.cli.

2. Provider Setup (Claude, ChatGPT, Gemini, Local Ollama, or Offline)

All quantitative feature extraction, graph analytics, and offline corpus-grounded synthesis work without any API key. For full natural-language generation, copy .env.example to .env and set whichever provider you already use:

# Pick ONE provider (or omit all to use offline corpus-grounded fallback):

# Anthropic Claude
ANTHROPIC_API_KEY=your_anthropic_key_here
# WHO_PROVIDER=anthropic

# OpenAI / ChatGPT
OPENAI_API_KEY=your_openai_key_here
# WHO_PROVIDER=openai

# Google Gemini
GEMINI_API_KEY=your_gemini_key_here
# WHO_PROVIDER=gemini

# Fast Open-Weight / Local Providers (optional)
# GROQ_API_KEY=...
# DEEPSEEK_API_KEY=...
# OPENROUTER_API_KEY=...
# OLLAMA_API_BASE=http://localhost:11434

Usage: Python SDK, Multi-LLM Tool Calling, MCP & CLI

Option A: Direct Python SDK

Demo Profile Note: The bundled read-only Target X demo profile (profiles/target_x/) is included in source/git installs (git clone ... + pip install -e . or pip install "git+...") and is write-protected against accidental overwrites unless WHO_ALLOW_DEMO_WRITE=1 is set. Minimal wheel installs start with an empty workspace — ingest your own target data first via who harvest --target "...".

from who import CognitiveTwin, list_targets

print(list_targets())

twin = CognitiveTwin("Target X", mode="autodetect")

# 1. Profile & active behavioral rules
profile = twin.get_profile()
rules = twin.get_operational_rules()

# 2. In-character grounded dialogue & analytical Q&A
reply = twin.chat("What standards do you require before endorsing an organizational proposal?")
insight = twin.ask("What recurring principles appear in the subject's primary documents?")

# 3. Claim verification & scenario simulation
verification = twin.explain("Subject prefers empirical verification over centralized authority")
sim = twin.simulate_monte_carlo(
    "A counterparty requests exclusive IP transfer with no audit mechanism.",
    iterations=25,
)

# 4. Longitudinal drift & stylometric fidelity check
drift = twin.analyze_drift(["New public statement emphasizing transparency and verifiable audits."])
check = twin.verify_response("Empirical bounds and reciprocal governance remain essential.")

Option B: Connect Directly to ChatGPT (OpenAI), Claude (Anthropic), Gemini, or Ollama Tool Calling

Export native tool schemas for the 7 Cognitive Digital Twin tools (get_tool_schemas) and dispatch calls cleanly through MCPServer().dispatch_tool_call:

from openai import OpenAI
from who.mcp_server import MCPServer, get_tool_schemas

mcp = MCPServer()

# 1. ChatGPT / OpenAI Function Calling
client = OpenAI()
resp = client.chat.completions.create(
    model="gpt-4o-mini",
    messages=[{"role": "user", "content": "Inspect Target X's cognitive profile and summarize their red lines."}],
    tools=get_tool_schemas("openai"),
)
tc = resp.choices[0].message.tool_calls[0]
result = mcp.dispatch_tool_call(tc.function.name, tc.function.arguments)

# 2. Anthropic Claude Tool Use
# tools=get_tool_schemas("anthropic")
# result = mcp.dispatch_tool_call(tool_use_block.name, tool_use_block.input)

# 3. Google Gemini Function Calling
# tools=get_tool_schemas("gemini")
# result = mcp.dispatch_tool_call(function_call.name, dict(function_call.args))

# 4. Local Ollama (OpenAI-Compatible Function Calling)
# tools=get_tool_schemas("ollama")

Option C: Model Context Protocol (MCP) — Claude Desktop, Claude Code, Cursor

Run who mcp over JSON-RPC stdio. Available MCP tools (all annotated with safety hints):

  • who_list_targets(): List all profiled targets in the local vault.
  • who_get_profile(target): Retrieve psychometric dimensions, CAPS matrix, stated vs. revealed framing, and operational rules.
  • who_chat(target, message, tone): Direct in-character dialogue with the target's cognitive digital twin.
  • who_simulate(target, scenario, monte_carlo, iterations): Simulate scenario reactions and Boltzmann-Gibbs Monte Carlo distributions.
  • who_explain(target, claim): Verify a claim against primary corpus quotes and knowledge graph paths.
  • who_academic_research(topic, target, limit, ingest): Search arXiv, PubMed, Semantic Scholar, and Crossref with 0–100 Scientific Rigor scoring.
  • who_compose_outreach(target, goal, context): Draft communication tailored to the profiled subject's epistemic framing.

Option D: Full CLI Pipeline

# Diagnostics, configured AI providers & local profiles
who doctor
who providers
who targets

# Ingest -> Learn -> Build Vault -> Audit -> Interact
who harvest --target "Subject A" --docs-dir ./path/to/texts
who learn --target "Subject A"
who build-vault --target "Subject A"
who evaluate-profile --target "Subject A"
who psych-insights --target "Subject A"

# Query, chat, simulate, debate, & track drift (demo profile: Target X)
who ask --target "Target X" --prompt "What criteria drive strategic trust?"
who chat --target "Target X"
who explain --target "Target X" --claim "Prioritizes empirical verification"
who simulate --target "Target X" --scenario "Proposal demanding unilateral veto removal" --monte-carlo --iterations 25
who compose --target "Target X" --goal "Invite to peer-reviewed workshop"
who arena --targets "Target X, Subject A" --topic "Transparency vs institutional autonomy" --rounds 2
who monitor --target "Target X" --drift

Explore runnable scripts in examples/:


Methodological Limitations & Ethical Scope

To maintain strict scientific transparency, users and researchers should account for the following boundaries:

  1. Non-Clinical Scope (Goldwater Rule Alignment): who?? models observable linguistic, rhetorical, and decision-framing patterns from text corpora using transparent lexicon/statistical heuristics. It does not perform clinical psychological diagnosis, mental health assessment, or deterministic mind-reading.
  2. Heuristic Lexical Indicators & Short-Corpus Thresholds: Core indices combine curated English/Turkish lexicons, privative/syntactic negation guards, and Beta-Binomial uncertainty intervals. They emit explicit INSUFFICIENT_DATA states below 20 words and represent lexical behavioral indicators — not clinical psychometric diagnoses. Scenario simulations are explicitly labeled as corpus-conditioned scenario models rather than trained empirical predictors.
  3. 3-Tier Literature Grounding: Retrieved literature is strictly separated into QUANTITATIVE_EXTRACTED (explicit r and N), QUALITATIVE_ABSTRACT_MATCH (excluded from Fisher-z Bayesian updates), and REFERENCE_BASELINE_PRIOR. Quantitative effect sizes serve strictly as Bayesian population priors and do not establish individual-level causality.
  4. Corpus Quality & Consent: Public texts reflect public personas; simulated outputs remain strictly bounded by input volume, source diversity, and selection bias. This toolkit is intended for computational social science, public-domain analysis, consented self-twinning, and research workflows — never covert surveillance or non-consensual private profiling (see SECURITY.md and CODE_OF_CONDUCT.md).

Documentation & Community

License

MIT License. Designed for evidence-grounded research, behavioral simulation, and personal agent tooling.

Thanks

We thank Sude Naz Akcabağ for her contributions.

Metadata

Release files for the-project-who 1.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for the-project-who 1.3.0
File Size Uploaded Provenance Actions
the_project_who-1.3.0.tar.gz 399.7 kB With provenance Details for the_project_who-1.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for the-project-who 1.3.0
File Interpreter ABI Platform Actions
the_project_who-1.3.0-py3-none-any.whl Python 3 none any Details for the_project_who-1.3.0-py3-none-any.whl

Total release size: 706.8 kB

Release files / the_project_who-1.3.0.tar.gz

Download URL the_project_who-1.3.0.tar.gz
Size 399.7 kB
Tags Source
SHA-256 checksum
How to use checksums
02508dac4eb4f8d7ca6cf6622cf6b478f56c4fcfbb037dd5ee85a90e53e7f0d3
BLAKE2b-256 checksum
How to use checksums
f12aa851309560de9e033e800280d4940cd8d19fadf0630cea21913fe42575bb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 4, 2026.

Transparency log

Release files / the_project_who-1.3.0-py3-none-any.whl

Download URL the_project_who-1.3.0-py3-none-any.whl
Size 307.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4cdd06805080f9c12c37aa008f4f1026146886d87bedaa9fb30b08dd002ec71b
BLAKE2b-256 checksum
How to use checksums
4782b4d2c87debd68518e2b67c3639973dd2d6733dd586447a268a01bb2200c5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 4, 2026.

Transparency log

Security for the-project-who 1.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for the_project_who-1.3.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 4, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.3.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page