Skip to main content

Zero-cost background coding agent with layered memory, idle-time dreaming, and Ollama support.

Project description

DeepSleep-bets

DeepSleep is the open-source background agent for local models.

It gives developers a ds workflow, a compact 3-layer memory file, and idle-time "dreaming" that summarizes recent work while they are away.

It is written from scratch and safe to publish. The architecture is inspired by the broader always-on agent pattern, not copied from leaked source code or source maps.

Why it lands fast

  • pip install deepsleep-ai
  • ds init
  • ds
  • ds dream

That is the product.

You initialize a repo once, ask natural questions in the terminal, and let DeepSleep update session context after you stop typing.

Core promise

  • Zero-cost agent: runs on local Ollama models instead of paid tokens
  • Idle-time dreaming: watches your repo and summarizes after inactivity
  • 3-layer memory: project, session, and ephemeral
  • Terminal-native: hacker-style interactive UI with file completion

Quick demo

pip install deepsleep-ai
ollama pull deepseek-r1
ds init
ds dream --once
ds

Then ask:

What was I doing?
Refactor src/deepsleep_ai/cli.py
Summarize the recent changes

The leaked-spec hook, done safely

DeepSleep explicitly implements a 3-layer memory stack:

  • project: long-term repo identity, goals, and facts
  • session: what you were doing recently, which files were active, and the latest dream summary
  • ephemeral: last turns, open questions, and the most recent file changes

All of it lives in .deepsleep/memory.json, and the compactor keeps that file under 2KB so it stays fast, deterministic, and portable.

Zero-cost local model stack

DeepSleep is built for Ollama and targets deepseek-r1 by default.

If Ollama is offline, DeepSleep still works with deterministic local fallbacks so demos do not collapse and the tool remains usable on day one.

Idle-time dreaming

Run ds dream, leave your editor open, and DeepSleep watches your project for file saves.

After 5 minutes of inactivity, it:

  1. collects the files you touched
  2. reads compact local snippets
  3. writes a fresh session summary into memory
  4. preserves only the highest-signal context under the 2KB cap

That is what makes What was I doing? feel instant the next time you open the project.

Install

PyPI

pip install deepsleep-ai

Local development

python3 -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"

Ollama

ollama serve
ollama pull deepseek-r1

Commands

ds init
ds
ds chat
ds dream
ds dream --idle-seconds 300
ds status
ds doctor

First-run workflow

1. Initialize a project

ds init

This creates:

  • .deepsleep/memory.json
  • .deepsleep/activity.jsonl
  • .deepsleep/prompt_history.txt

2. Validate your setup

ds doctor

It checks the memory files, Ollama reachability, and whether your chosen model is available.

3. Start the interactive UI

ds

Inside the prompt you can ask:

  • What was I doing?
  • Refactor src/deepsleep_ai/cli.py
  • Summarize the recent changes

Slash commands:

  • /help
  • /status
  • /memory
  • /dream
  • /quit

4. Start the dream loop

ds dream

DeepSleep watches the current project with Watchdog and writes fresh session context after idle periods.

5. One-shot demo mode

ds dream --once

This is great for screenshots, demos, and launch videos because it snapshots recently touched files even if the watcher was not already running.

Package layout

The MVP is centered on these four files:

Trust signals

  • publishable pyproject.toml for pip install deepsleep-ai
  • ds console entrypoint
  • MIT license
  • GitHub Actions CI
  • tests for memory compaction, watcher behavior, offline fallback, and chat exit flow

Self-test

pytest -q
python -m deepsleep_ai --help

Launch kit

If you want this repo to travel, keep the demo brutally simple:

  1. ds init
  2. edit two files
  3. ds dream --once
  4. show .deepsleep/memory.json
  5. ask What was I doing?
  6. run ds doctor

That story is short, visual, and immediately understandable.

There is a practical launch playbook in LAUNCH.md and a contributor plan in CONTRIBUTING.md.

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

deepsleep_ai-0.1.0.tar.gz (18.0 kB view details)

Uploaded Source

Built Distribution

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

deepsleep_ai-0.1.0-py3-none-any.whl (15.7 kB view details)

Uploaded Python 3

File details

Details for the file deepsleep_ai-0.1.0.tar.gz.

File metadata

  • Download URL: deepsleep_ai-0.1.0.tar.gz
  • Upload date:
  • Size: 18.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for deepsleep_ai-0.1.0.tar.gz
Algorithm Hash digest
SHA256 8bd3cb3b45624b913f2e1c0da5f36642902d69646378940daf6dac1ac37cc30b
MD5 51ac0f34c852092089c85550fa23cfcf
BLAKE2b-256 5b7d4d8d21c964e6e7f222ac2ac462a4a69ab1bad87ad172173883544ccb2fa1

See more details on using hashes here.

Provenance

The following attestation bundles were made for deepsleep_ai-0.1.0.tar.gz:

Publisher: publish.yml on Keshavsharma-code/DeepSleep-beta

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

File details

Details for the file deepsleep_ai-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: deepsleep_ai-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 15.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for deepsleep_ai-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f973995eaece1bcefd1d9fdcaf4ac115ed787b39e7b4f4041a9aab88a019cdd6
MD5 2532dd90a253b7e2fdc40b48567a5a5c
BLAKE2b-256 bc0b4c6e1bd61c41d10e9515111452a4b753da659616dfcc1328ac3ae65dffd3

See more details on using hashes here.

Provenance

The following attestation bundles were made for deepsleep_ai-0.1.0-py3-none-any.whl:

Publisher: publish.yml on Keshavsharma-code/DeepSleep-beta

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