https://github.com/all-hands-ai/tom-swe

The theory of mind module for the SWE agent

https://github.com/all-hands-ai/tom-swe

Science Score: 26.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (8.4%) to scientific vocabulary
Last synced: 10 months ago · JSON representation

Repository

The theory of mind module for the SWE agent

Basic Info
  • Host: GitHub
  • Owner: All-Hands-AI
  • Language: Python
  • Default Branch: main
  • Size: 1.04 MB
Statistics
  • Stars: 2
  • Watchers: 0
  • Forks: 0
  • Open Issues: 0
  • Releases: 0
Created 12 months ago · Last pushed 10 months ago
Metadata Files
Readme

README.md

ToM-SWE

Theory of Mind package for SWE agents. Provides personalized instruction improvement and user behavior analysis through a three-tier memory system.

Quick Start

  1. Install dependencies: bash uv sync

  2. Set up LLM API credentials: ```bash

    Create .env file

    LITELLMAPIKEY=yourapikeyhere LITELLMBASEURL=yourproxyendpoint DEFAULTLLMMODEL=litellmproxy/claude-sonnet-4-20250514 ```

  3. Run example or configure LLM: bash uv run python example.py # See instruction improvement in action uv run tom-config # Interactive LLM setup

Core Features

  • Three-Tier Memory: Cleaned sessions → Session analyses → User profiles
  • Instruction Improvement: Transforms vague instructions into personalized guidance
  • User Behavior Analysis: LLM-powered psychological insights and preferences
  • OpenHands Integration: Use TomCodeActAgent for automatic instruction enhancement

Main Commands

```bash

User analysis

uv run user-analysis --user-id

Theory of Mind analysis

uv run tom-test # Test on sample users uv run tom-analyze # Full analysis

RAG document analysis

uv run rag-agent ```

OpenHands Integration

Configure OpenHands to use Tom-enhanced agent: toml default_agent = "TomCodeActAgent"

The agent automatically: 1. Improves user instructions with personalized suggestions 2. Processes user sessions for better understanding 3. Shows progress during analysis

Prompts

The prompts are stored in tom_swe/prompts/registry.py. You could also find some prompts in tom_swe/generation/dataclass.py

Requirements

  • Python 3.8+
  • uv package manager
  • LLM API key (contact All Hands AI for access)

Owner

  • Name: All Hands AI
  • Login: All-Hands-AI
  • Kind: organization
  • Email: contact@all-hands.dev

We build AI software development agents for everyone, in the open.

GitHub Events

Total
  • Watch event: 2
  • Push event: 30
  • Public event: 1
  • Create event: 3
Last Year
  • Watch event: 2
  • Push event: 30
  • Public event: 1
  • Create event: 3

Issues and Pull Requests

Last synced: 10 months ago

All Time
  • Total issues: 6
  • Total pull requests: 16
  • Average time to close issues: 10 days
  • Average time to close pull requests: 1 day
  • Total issue authors: 1
  • Total pull request authors: 1
  • Average comments per issue: 1.83
  • Average comments per pull request: 1.38
  • Merged pull requests: 14
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 6
  • Pull requests: 16
  • Average time to close issues: 10 days
  • Average time to close pull requests: 1 day
  • Issue authors: 1
  • Pull request authors: 1
  • Average comments per issue: 1.83
  • Average comments per pull request: 1.38
  • Merged pull requests: 14
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • XuhuiZhou (6)
Pull Request Authors
  • XuhuiZhou (16)
Top Labels
Issue Labels
openhands (6) enhancement (5)
Pull Request Labels

Dependencies

.github/workflows/mypy.yml actions
  • actions/checkout v4 composite
  • actions/setup-python v5 composite
.github/workflows/pre-commit.yml actions
  • actions/checkout v4 composite
  • actions/setup-python v5 composite
.github/workflows/pytest.yml actions
  • actions/checkout v4 composite
  • actions/setup-python v5 composite
  • codecov/codecov-action v4.0.1 composite
pyproject.toml pypi
  • aiofiles >=23.0.0
  • fastapi >=0.104.0
  • httpx >=0.25.0
  • json-repair >=0.1.0
  • litellm >=1.0.0
  • numpy >=1.24.0
  • pandas >=2.0.0
  • pydantic >=2.0.0
  • python-dotenv >=1.0.0
  • rich >=13.0.0
  • tqdm >=4.65.0
  • typing-extensions >=4.0.0
  • uvicorn >=0.24.0
uv.lock pypi
  • aiofiles 24.1.0
  • aiohappyeyeballs 2.6.1
  • aiohttp 3.12.13
  • aiosignal 1.4.0
  • annotated-types 0.7.0
  • anyio 4.9.0
  • async-timeout 5.0.1
  • attrs 25.3.0
  • black 25.1.0
  • certifi 2025.6.15
  • cfgv 3.4.0
  • charset-normalizer 3.4.2
  • click 8.1.8
  • colorama 0.4.6
  • coverage 7.9.2
  • distlib 0.3.9
  • distro 1.9.0
  • exceptiongroup 1.3.0
  • fastapi 0.115.14
  • filelock 3.18.0
  • frozenlist 1.7.0
  • fsspec 2025.5.1
  • h11 0.16.0
  • hf-xet 1.1.5
  • httpcore 1.0.9
  • httpx 0.28.1
  • huggingface-hub 0.33.2
  • identify 2.6.12
  • idna 3.10
  • importlib-metadata 8.7.0
  • iniconfig 2.1.0
  • isort 6.0.1
  • jinja2 3.1.6
  • jiter 0.10.0
  • json-repair 0.44.1
  • jsonschema 4.24.0
  • jsonschema-specifications 2025.4.1
  • litellm 1.73.6.post1
  • markdown-it-py 3.0.0
  • markupsafe 3.0.2
  • mdurl 0.1.2
  • multidict 6.6.3
  • mypy 1.16.1
  • mypy-extensions 1.1.0
  • nodeenv 1.9.1
  • numpy 2.0.2
  • openai 1.93.0
  • packaging 25.0
  • pandas 2.3.0
  • pathspec 0.12.1
  • platformdirs 4.3.8
  • pluggy 1.6.0
  • pre-commit 4.2.0
  • propcache 0.3.2
  • pydantic 2.11.7
  • pydantic-core 2.33.2
  • pygments 2.19.2
  • pytest 8.4.1
  • pytest-cov 6.2.1
  • python-dateutil 2.9.0.post0
  • python-dotenv 1.1.1
  • pytz 2025.2
  • pyyaml 6.0.2
  • referencing 0.36.2
  • regex 2024.11.6
  • requests 2.32.4
  • rich 14.0.0
  • rpds-py 0.26.0
  • ruff 0.12.2
  • six 1.17.0
  • sniffio 1.3.1
  • starlette 0.46.2
  • tiktoken 0.9.0
  • tokenizers 0.21.2
  • tom-swe 1.0.0
  • tomli 2.2.1
  • tqdm 4.67.1
  • typing-extensions 4.14.0
  • typing-inspection 0.4.1
  • tzdata 2025.2
  • urllib3 2.5.0
  • uvicorn 0.35.0
  • virtualenv 20.31.2
  • yarl 1.20.1
  • zipp 3.23.0