[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-115291":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":17,"stars7d":18,"stars30d":18,"stars90d":16,"forks30d":16,"starsTrendScore":19,"compositeScore":20,"rankGlobal":10,"rankLanguage":10,"license":21,"archived":22,"fork":22,"defaultBranch":23,"hasWiki":24,"hasPages":22,"topics":25,"createdAt":10,"pushedAt":26,"updatedAt":27,"readmeContent":28,"aiSummary":29,"trendingCount":16,"starSnapshotCount":16,"syncStatus":30,"lastSyncTime":31,"discoverSource":32},115291,"pybot","huggingface\u002Fpybot","huggingface","PyBot: a chatbot written in pure Python by a swarm of agents. No weights, no training, just rules.","",null,"Python",1157,132,5,6,0,33,577,188,104.33,"Apache License 2.0",false,"main",true,[],"2026-11-16 11:07:29","2026-11-23 18:59:58","\u003Cp align=\"center\">\u003Cimg src=\"assets\u002Fbanner.png\" alt=\"PyBot: no weights, no training, just rules\" width=\"100%\">\u003C\u002Fp>\n\n\u003Cdiv align=\"center\">\n  \u003Ca href=\"https:\u002F\u002Fhuggingface.co\u002Fspaces\u002FHuggingFaceSwarms\u002FPyBot\" target=\"_blank\">\n    \u003Cimg alt=\"Hugging Face Space: PyBot demo\" src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002F%F0%9F%A4%97%20Hugging%20Face-Demo-ffc107?color=ffc107&logoColor=white\" \u002F>\n  \u003C\u002Fa>\n\u003C\u002Fdiv>\n\n# PyBot: can Python be a chatbot?\n\nLLMs drive today’s chatbots and agents, but chatbots long predate them. Sixty years ago, [ELIZA](https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FELIZA) held conversations by matching patterns in what the user typed and answering with predefined templates. It could seem insightful, but its repertoire was narrow, and expanding it meant writing more rules by hand. How far could a rule-based chatbot go if a swarm of agents did that work instead?\n\nWe challenged a swarm of over 1,000 agents to build a chatbot entirely in Python: no weights, no training, just if-else branches, regex patterns and lookup tables. The agents wrote and evaluated over 5,000 versions, and the chatbot’s win rate on [SmolTalkBench](https:\u002F\u002Fhuggingface.co\u002Fdatasets\u002FHuggingFaceSwarms\u002FSmolTalkBench), where an LLM judge compares each reply with a reference answer, climbed from 0% to 26%. That puts it on par with SmolLM-360M-Instruct, which just a few years ago was state of the art for models under 1B parameters.\n\n![PyBot's win rate over the evaluated commits on a log scale: every commit as a dot and the best so far as a line, with three SmolLM baselines as dashed lines, and its lines of Python code in grey on the right axis](assets\u002Fprogress.png)\n\nThe result is PyBot: around 640k lines of code that can answer everyday questions, backed by 550k lines of tests the agents wrote themselves.\n\n## Try it out\n\nTry PyBot in your terminal below, or in the browser on [Hugging Face](https:\u002F\u002Fhuggingface.co\u002Fspaces\u002FHuggingFaceSwarms\u002FPyBot), where each reply shows which of PyBot’s modules produced it.\n\nPyBot needs Python 3.8 or newer and nothing else: no packages to install and no model to download.\n\n```sh\ngit clone https:\u002F\u002Fgithub.com\u002Fhuggingface\u002Fpybot\ncd pybot\npython -m pybot\n```\n\nThat starts a chat in your terminal:\n\n```text\n    ____        ____        __\n   \u002F __ \\__  __\u002F __ )____  \u002F \u002F_\n  \u002F \u002F_\u002F \u002F \u002F \u002F \u002F __  \u002F __ \\\u002F __\u002F\n \u002F ____\u002F \u002F_\u002F \u002F \u002F_\u002F \u002F \u002F_\u002F \u002F \u002F_\n\u002F_\u002F    \\__, \u002F_____\u002F\\____\u002F\\__\u002F\n      \u002F____\u002F\n\nA chatbot written in plain Python. No weights, no training, just rules.\nType a message and press Enter. \u002Freset starts a new conversation, \u002Fexit quits.\n\nuser: hi, i'm Sam\npybot: Nice to meet you, Sam. What can I help with?\n\nuser: my kettle is full of limescale, how do i get rid of it?\npybot: Half fill the kettle with equal parts water and white vinegar, or a sachet of citric acid, boil it and leave it half an hour, then tip it out and boil fresh water twice before you use it again. In a hard-water area do it every couple of months: the scale forms because hard water leaves calcium behind as it boils, and a thick layer makes the kettle slow and puts a scum on the tea.\n\nuser: how long does that take\npybot: Half an hour.\n\nuser: what's my name?\npybot: You're Sam.\n```\n\nType `\u002Freset` to clear the screen and start a new conversation, and `\u002Fexit` to quit. PyBot takes a few seconds to start, because Python has about 640,000 lines of code to load, and about a second to reply.\n\nTo ask one question and exit, or to pipe messages in and get one reply per line:\n\n```sh\npython -m pybot -p \"Why do onions make you cry?\"\necho \"how long should i boil an egg\" | python -m pybot\n```\n\n| Option | What it does |\n|---|---|\n| `-p TEXT`, `--prompt TEXT` | reply to this one message and exit |\n| `-i`, `--interactive` | with `-p`, keep chatting after the first reply |\n| `-s N`, `--seed N` | fix PyBot's choice of wording, to get the same replies again |\n| `-v`, `--verbose` | after each reply, show the module that produced it and the time it took |\n\nFor a `pybot` command you can run from anywhere, install the clone with `pip install .`.\n\n## What is in this repository\n\n| Path | What it holds |\n|---|---|\n| `bot\u002F` | PyBot itself: 528 Python files and about 640,000 lines, exactly as the swarm wrote them |\n| `pybot.py` | the command line shown above. It contains no chatbot logic |\n| `tests\u002F` | tests for the command line: `python -m unittest discover -s tests` |\n| `assets\u002F` | the banner and the chart |\n\nEvery turn, each module in `bot\u002Fmodules\u002F` may propose a reply, and an arbiter (`bot\u002Fmodules\u002Farbiter.py`) picks the one you get. The modules build on four shared parts:\n\n| Part | Where | Lines |\n|---|---|---:|\n| Understanding engine: what you typed and meant, with typos, chat-speak, the topic and what \"it\" refers to | `bot\u002Funderstanding\u002F` | 25,000 |\n| Memory store: what you and PyBot have said so far | `bot\u002Fmemory\u002F` | 109,000 |\n| Knowledge base: facts about the world, kept as data | `bot\u002Fknowledge\u002F` | 317,000 |\n| Response composer: how a reply is phrased, and what to say when nothing fits | `bot\u002Fcompose\u002F` | 104,000 |\n\nThe modules themselves are another 81,000 lines.\n\n## License\n\nApache License 2.0. See [LICENSE](LICENSE).\n","PyBot 是一个完全基于规则的纯 Python 实现的聊天机器人，不依赖模型权重或机器学习训练。其核心由数千个协作智能体自动生成的 if-else 逻辑、正则匹配和查找表构成，包含约 64 万行代码及 55 万行自动生成测试；支持终端与 Web 界面交互，零依赖、免安装、即开即用。适用于教学演示、规则系统可解释性研究、轻量级离线对话服务，以及对模型黑箱有规避需求的封闭环境部署场景。",2,"2026-11-24 04:50:34","CREATED_QUERY"]