Skip to main content

Dusha

PyPI Python License CI Ruff uv

Dusha (Rus: душа, [dʊˈʂa], "soul") is a lightweight python API that:

  1. stores messages, memories, affect state, anything you want
  2. injects those contexts at every LLM call (any provider is supported)
  3. has an extensible MCP and CLI to let you add any tools.

Because it's just a hackable python API, you can do literally anything. Including:

  • hop between harnesses and get the same soul on the other side
  • write your own emotion system
  • call weather API and feed it to the model real-time (so they know it's raining outside)
  • feed them your browser history
  • let your companion play music on any device through built-in relay plugin
  • integrate an external memory provider like Supermemory and add tools to Dusha MCP

See dusha-plugin-collections.

Quickstart

uv tool install dusha # docker image available. See below
dusha init <name> --serve # Also you can use --proxy for proxy setup, or without flags for generating both
dusha serve <name>

Then on the same or another device, run:

$ dusha proxy <name>

<name> isn't connected to a server yet.
? Connect to: (Use arrow keys)
   The server on this machine (http://127.0.0.1:8765)
 » Another server

? Server URL http://100.145.95.87:8765
? Server token, empty for none **********

Connected to http://100.145.95.87:8765.
Saved ~/.config/dusha/<name>/config.json.

Add a custom provider:

$ dusha -c <name> provider add # Add a provider profile from the models.dev catalog

? Provider (Use arrow keys, type to filter)
 » 302.AI (302ai)
   Abacus (abacus)
   abliteration.ai (abliteration-ai)
   above.dev (above)
   AgentRouter (agentrouter)
   Agnes AI (agnes)
   ...

Success!
New provider 302ai added to <name> at http://127.0.0.1:8766/302ai.
Restart dusha proxy <name> and dusha serve <name> to use it.

$ dusha proxy <name>

INFO:     Application startup complete.
INFO:     Uvicorn running on http://127.0.0.1:8766 (Press CTRL+C to quit)

Now in your harness or app, point your endpoint at the URL provider add gave you: in this case, http://127.0.0.1:8766/302ai and you're good to go. Now every request routes through dusha proxy.

Optionally (highly recommended), add MCP.

Docker (and Podman)

Prefer a container? The image is ghcr.io/somme4096/dusha. We have compose at home:

mkdir dusha && cd dusha
curl -O https://raw.githubusercontent.com/Somme4096/dusha/main/deploy/compose.yaml
touch .env # Put EMBEDDING_API_KEY=... here if you use one.
docker compose up -d # podman and podman-compose also works.

Detail in Deployment.

How it works

user message → dusha proxy → injects context → routed to upstream model → reply → (harness, dusha).

Dusha adds context "after" each message so cache can hit.

How do messages, memory, affect, and identity work in stock dusha?
  • Messages: Basic SQLite FTS5 plus optional embedding search. A plugin can do everything you can imagine if that's not enough.
  • Evergreen: Long-term facts that you edit from the CLI and your companion edits through integration tools. No automatic extraction.
    • Think of it as a USER.md but with proper lifecycle management and duplication prevention.
  • Affect: A deterministic emotion engine that uses values like {"anger": 0.35} and shifts over time, including when the user goes unresponsive. Of course, you can make your own!
    • Message intent analysis can also be an external plugin. drop the system_one plugin or any other classifier plugin into the plugins directory, and its decide listener picks which emotion each user message should provoke.
  • Identity: identity.md, or custom name.

Plugin

Everything is a plugin in dusha! Identity, memory, evergreen, memo, affect, and proactive are built in that you can alter/disable.

See Plugin for list of built-in plugins and how to build your own plugin. If you like, you can also take a look at dusha-plugin-collections which contain dusha plugins I use daily.

See Also

Versioning

With version 1.0.21, dusha entered 5:Stable/Production on PyPI. I will avoid breaking changes in minor and patch releases and deprecate features before removing them.

Note that dusha's version always ends in .21. Every release bumps only the numbers in front of it (0.0.21 → 0.1.21 → 1.0.21).

Why?

The weight of soul is said to be 21 grams. Dusha is a software with a soul, and I hope it stays that way forever.

Acknowledgement

Sincere gratitude to:

  • Drivesoid for their 16-emotion system and base/mood cycle.
  • Omemo for their gateway-as-memory-layer idea.

Metadata

Release files for dusha 1.4.21

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

Source distribution (sdist)

Source distribution for dusha 1.4.21
File Size Uploaded Provenance Actions
dusha-1.4.21.tar.gz 103.6 kB With provenance Details for dusha-1.4.21.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for dusha 1.4.21
File Interpreter ABI Platform Actions
dusha-1.4.21-py3-none-any.whl Python 3 none any Details for dusha-1.4.21-py3-none-any.whl

Total release size: 205.2 kB

Release files / dusha-1.4.21.tar.gz

Download URL dusha-1.4.21.tar.gz
Size 103.6 kB
Tags Source
SHA-256 checksum
How to use checksums
9b55966904d782fb6bbf739dc3be03ed0c63f5d63faf96c41e4675a20b4f9dde
BLAKE2b-256 checksum
How to use checksums
932411e96621b4eee96689ad540097478894a0ff4403cc5bfb9d98fc94f3e532
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 Nov 13, 2026.

Transparency log

Release files / dusha-1.4.21-py3-none-any.whl

Download URL dusha-1.4.21-py3-none-any.whl
Size 101.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8e7a6b07e6c21bc1c2d66ff86c8f0df20a7cdd0e0ba642276280861e71b03d00
BLAKE2b-256 checksum
How to use checksums
e1fcc4cf13a4e59b50360e4bc6c7d93ba3b7e7160236ccc1b35012a88893d760
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 Nov 13, 2026.

Transparency log

Security for dusha 1.4.21

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 dusha-1.4.21.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 Nov 13, 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.

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