Skip to main content

Multi-agent society simulation with playful personalities

Project description

A Society of Agents

Pylint PyPI

LLM Society - AI agents in philosophical debate

Inspired by Marvin Minsky's Society of Mind, a multi-agent simulation where AI personalities debate questions from different perspectives. Ask a question, specify the viewpoints you want, and watch the debate unfold.

What it does

  1. You provide a question and the perspectives you want represented
  2. AI generates distinct agent personalities for each perspective
  3. An orchestrator facilitates debate between the agents
  4. Agents discuss, disagree, and build on each other's arguments

Installation

pip install pysociety

or

uv add pysociety

Quick Start

Create a .env file with your API key:

ANTHROPIC_API_KEY=your-api-key-here

Run a debate

uv run python -m llm_society "What is the meaning of life? I want an optimistic view and a pessimistic one."

More examples

# Ethics debate
uv run python -m llm_society "$(cat examples/trolley_problem.txt)"

# Philosophy
uv run python -m llm_society "$(cat examples/free_will.txt)"

# Social issues
uv run python -m llm_society "$(cat examples/wealth_inequality.txt)"

Example Questions

File Topic Perspectives
meaning_of_life.txt Meaning of life Optimist, Pessimist
trolley_problem.txt Trolley problem Utilitarian, Deontologist, Virtue ethicist
free_will.txt Free will Determinist, Libertarian, Compatibilist
wealth_inequality.txt Wealth inequality Libertarian, Socialist, Rawlsian, Communitarian
animal_rights.txt Animal rights Peter Singer, Traditionalist, Environmental ethicist
civil_disobedience.txt Civil disobedience Thoreau, MLK, Legal positivist, Conservative

Optional Configuration

You can customize models in .env:

# Main orchestrator model
MAIN_AGENT_MODEL=anthropic:claude-opus-4-5-20251101

# Sub-agent models
SUB_AGENT_MODEL=anthropic:claude-sonnet-4-5-20250929

# Prompt generation model
PROMPT_GENERATOR_MODEL=anthropic/claude-opus-4-5-20251101

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pysociety-0.2.3.tar.gz (821.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pysociety-0.2.3-py3-none-any.whl (7.6 kB view details)

Uploaded Python 3

File details

Details for the file pysociety-0.2.3.tar.gz.

File metadata

  • Download URL: pysociety-0.2.3.tar.gz
  • Upload date:
  • Size: 821.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for pysociety-0.2.3.tar.gz
Algorithm Hash digest
SHA256 b3b7d4779ff5329ea92f9897006c042fa66c4f284aa13833fc0faa6eafd078eb
MD5 5ea601535b6dbf1604f9dc695ed859b5
BLAKE2b-256 916250ca3f17f564e4793761b5ffd67b04e222fba63edc6dc2bc237bd1e91911

See more details on using hashes here.

File details

Details for the file pysociety-0.2.3-py3-none-any.whl.

File metadata

  • Download URL: pysociety-0.2.3-py3-none-any.whl
  • Upload date:
  • Size: 7.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for pysociety-0.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 e8df3bd488ae803860d0e593caac4faac5d90ed38bd3701e95a3077a4143d013
MD5 3ee42cc7697698fd753113dad683ed54
BLAKE2b-256 9c76075648639e86d19b45e30152e5780a8f4aef9983a3e1de71b0db6a4d8b69

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page