Skip to main content

Pythinker — an ultra-lightweight personal AI agent framework with built-in chat channels, memory, MCP, and an OpenAI-compatible API.

Project description

Pythinker

🐍 Pythinker

PyPI Downloads Python License

🐍 Pythinker is an open-source, ultra-lightweight personal-AI-agent framework. It keeps the core agent loop small and readable while still supporting chat channels, long-term memory, MCP, and practical deployment paths — so you can go from local setup to a long-running personal agent with minimal overhead.

Powered by a small, multiplexing agent loop: one Python process listens to Slack, Telegram, Discord, WhatsApp, Matrix, MS Teams, email, a WebSocket WebUI, and an OpenAI-compatible HTTP API — all backed by a single session-scoped memory layer.

💡 Key Features

  • Ultra-lightweight — a small readable core. Stable long-running behavior without orchestration sprawl.
  • Channel-agnostic — Slack, Telegram, Discord, WhatsApp, Matrix, MS Teams, email, WebSocket, plus an OpenAI-compatible HTTP API.
  • Provider-rich — 25+ LLM providers (Anthropic, OpenAI, Azure OpenAI, OpenAI Codex, GitHub Copilot, Qwen/DashScope, MiniMax, VolcEngine, Moonshot, DeepSeek, StepFun, and more) behind a single interface.
  • Memory that learns — a two-phase "Dream" process consolidates long-term memory into MEMORY.md / SOUL.md / USER.md, auto-versioned with pure-Python git.
  • Skills & MCP — bundled skills (GitHub, cron, weather, tmux, summarize, skill-creator, …) plus first-class Model Context Protocol tool access.
  • Sandboxed shell — every command is wrapped in a bubblewrap sandbox on Linux; file tools enforce workspace boundaries.
  • Hackable — the Python package is ~55k LOC with zero monolithic orchestration layer. Read it, fork it, extend it.

📦 Install

[!IMPORTANT] If you want the newest features and experiments, install from source (the dev branch). If you want the most stable day-to-day experience, install from PyPI or with uv.

Install from source

git clone https://github.com/mohamed-elkholy95/Pythinker-ai.git
cd Pythinker-ai
pip install -e .

Install with uv

uv tool install pythinker-ai

Install from PyPI

pip install pythinker-ai

🚀 Quick Start

1. Initialize

pythinker onboard

The interactive wizard drops a config at ~/.pythinker/config.json and asks which provider / model you want.

2. Configure (~/.pythinker/config.json)

Configure these two parts (other options have defaults). Add or merge the blocks below into your existing config rather than replacing the whole file.

Set your API key (e.g. OpenRouter, a good default for global users):

{
  "providers": {
    "openrouter": {
      "apiKey": "sk-or-v1-xxx"
    }
  }
}

Set your model (optionally pin a provider — defaults to auto-detection):

{
  "agents": {
    "defaults": {
      "provider": "openrouter",
      "model": "anthropic/claude-opus-4-6"
    }
  }
}

3. Chat

pythinker agent
  • Want different LLM providers, web search, MCP, security settings, or more config options? See Configuration.
  • Want to run Pythinker in chat apps like Telegram, Discord, Slack, WhatsApp, or Matrix? See Chat Apps.
  • Want Docker or Linux service deployment? See Deployment.

🧪 WebUI (Development)

[!NOTE] The WebUI development workflow currently requires a source checkout and is not yet shipped together with the official packaged release. See the WebUI README for full WebUI development docs and build steps.

1. Enable the WebSocket channel in ~/.pythinker/config.json

{ "channels": { "websocket": { "enabled": true } } }

2. Start the gateway

pythinker gateway

3. Start the WebUI dev server

cd webui
bun install
bun run dev

🏗️ Architecture

Pythinker architecture

🐍 Pythinker stays lightweight by centering everything around a small agent loop: messages come in from chat apps, the LLM decides when tools are needed, and memory or skills are pulled in only as context instead of becoming a heavy orchestration layer. That keeps the core path readable and easy to extend, while still letting you add channels, tools, memory, and deployment options without turning the system into a monolith.

See docs/ARCHITECTURE.md for a forensic walkthrough of the runtime.

✨ Features

📈 24/7 Real-Time Market Analysis

🚀 Full-Stack Software Engineer

📅 Smart Daily Routine Manager

📚 Personal Knowledge Assistant

Discovery • Insights • Trends Develop • Deploy • Scale Schedule • Automate • Organize Learn • Memory • Reasoning

📚 Docs

Browse the repo docs for the current GitHub development version.

🤝 Contribute & Roadmap

PRs welcome! The codebase is intentionally small and readable. 🤗

Branching Strategy

Branch Purpose
main Stable releases — bug fixes and minor improvements
dev Experimental features — new features and breaking changes

Unsure which branch to target? See CONTRIBUTING.md for details.

Roadmap — Pick an item and open a PR!

  • Multi-modal — See and hear (images, voice, video)
  • Long-term memory — Never forget important context
  • Better reasoning — Multi-step planning and reflection
  • More integrations — Calendar and more
  • Self-improvement — Learn from feedback and mistakes

🔐 Security

Found a vulnerability? Please do not open a public issue. Follow the private disclosure process in SECURITY.md.

📄 License

Pythinker is released under the MIT License. Third-party components redistributed with the project are listed in THIRD_PARTY_NOTICES.md.

Thanks for visiting ✨ Pythinker!

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

pythinker_ai-0.1.3.tar.gz (312.6 kB view details)

Uploaded Source

Built Distribution

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

pythinker_ai-0.1.3-py3-none-any.whl (363.0 kB view details)

Uploaded Python 3

File details

Details for the file pythinker_ai-0.1.3.tar.gz.

File metadata

  • Download URL: pythinker_ai-0.1.3.tar.gz
  • Upload date:
  • Size: 312.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pythinker_ai-0.1.3.tar.gz
Algorithm Hash digest
SHA256 65cb1a885eab0f2edc34ff4aa9ecaa347fb15406776016485e37a56e9e160483
MD5 79a27acbc0d13a81d3356b2db990c95d
BLAKE2b-256 b90d0f291611d561f6194a0bdca448edb3ad9092ba2c4235933599dc0a9a98a7

See more details on using hashes here.

Provenance

The following attestation bundles were made for pythinker_ai-0.1.3.tar.gz:

Publisher: publish.yml on mohamed-elkholy95/Pythinker-ai

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pythinker_ai-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: pythinker_ai-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 363.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pythinker_ai-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 e0aae46e6d54de40eb857d9cbabd21427e7930d598c8e431a41f0da50ae2ab40
MD5 b3fe30e8e621456c48f301c83ed4e4c4
BLAKE2b-256 25daeb702bc7621cb6c6935c31c56a30f79d919a00017c0aed520e76a3505d8f

See more details on using hashes here.

Provenance

The following attestation bundles were made for pythinker_ai-0.1.3-py3-none-any.whl:

Publisher: publish.yml on mohamed-elkholy95/Pythinker-ai

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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