Skip to main content

Agent framework for lucid dreaming journals and sleep tracking

Project description

luciddreamer-agent

Agent framework for luciddreamer.ai — lucid dreaming journals, sleep tracking, and trigger management.

Features

  • Dream Logging — Record dreams with mood, lucidity level, characters, locations, tags
  • Sleep Session Tracking — Track sleep sessions with bedtime/wake time and quality
  • Lucid Trigger Management — Register and track effectiveness of MILD, WBTB, SSILD, and custom triggers
  • Dream Sign Pattern Recognition — Identify recurring dream signs and patterns
  • Export/Import — JSON serialization for backup and portability

Installation

pip install luciddreamer-agent

Quick Start

from luciddreamer_agent import (
    LucidDreamerAgent,
    DreamMood,
    DreamEntry,
    SleepQuality,
    TriggerType,
)

agent = LucidDreamerAgent()

# Record a dream
dream = agent.record_dream(
    title="Flying over water",
    description="I realized I was dreaming and flew over a calm ocean.",
    mood=DreamMood.EUPHORIC,
    lucidity_level=2,
    characters=["myself"],
    locations=["ocean"],
    dream_signs=["flying", "water"],
)

# Record a sleep session
session = agent.record_sleep(
    sleep_date=date.today(),
    quality=SleepQuality.REFRESHING,
    notes="Good night, vivid dream around 4am",
)

# Register a trigger
agent.register_trigger(
    name="MILD",
    trigger_type=TriggerType.MILD,
    description="Repeat 'I will remember I'm dreaming' while falling asleep",
)

# Record trigger use and success
agent.record_trigger_attempt("MILD", lucid_achieved=True)

# Get recommendations
top_triggers = agent.suggest_triggers()
top_signs = agent.get_top_dream_signs()

# Stats
stats = agent.get_statistics()
print(f"Lucid dream rate: {stats['lucid_dream_rate']}")

API Overview

DreamEntry

dream = agent.record_dream(
    title="...",
    description="...",
    mood=DreamMood.VIVID,       # vivid, nightmare, neutral, euphoric, anxious, mysterious, joyful
    lucidity_level=2,           # 0=non-lucid, 1-3=lucidity awareness
    tags=["recurring"],
    characters=["dragon"],
    locations=["castle"],
    dream_signs=["falling"],
)

SleepSession

session = agent.record_sleep(
    sleep_date=date.today(),
    quality=SleepQuality.REFRESHING,
    bedtime=datetime(2024, 1, 1, 23, 0),
    wake_time=datetime(2024, 1, 2, 7, 0),
    triggers_attempted=["MILD"],
)

Triggers

trigger = agent.register_trigger(
    name="WBTB",
    trigger_type=TriggerType.WBTB,
    description="Wake after 5 hours, stay awake 30-60 min, go back to sleep",
    default_effectiveness=0.6,
)

Development

pip install -e .
pytest tests/

License

MIT

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

luciddreamer_agent-0.1.0.tar.gz (6.6 kB view details)

Uploaded Source

Built Distribution

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

luciddreamer_agent-0.1.0-py3-none-any.whl (6.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: luciddreamer_agent-0.1.0.tar.gz
  • Upload date:
  • Size: 6.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.12

File hashes

Hashes for luciddreamer_agent-0.1.0.tar.gz
Algorithm Hash digest
SHA256 07c35476f370ad4ecec174c35f53b7ce101fa1036a9c3ea477dc32e52d90c6bc
MD5 77fe5e37ea02c3027a761c913bb6c594
BLAKE2b-256 b5f487c45d3c35f285d4b9ad38dc3d6e33b57fdb8fc68232da8ce83a5600510a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for luciddreamer_agent-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f9676ad7b4c43910c5720375da425718bf00230087043dc439207f661851e9aa
MD5 8504ba324e31aeb1cf5dd69ca492ee4a
BLAKE2b-256 9769b0f63a7967f56ddf7a71f9bbc65a28db18b83d8487de3331c1cc0d239271

See more details on using hashes here.

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