Files
daily-journal-prompt/README.md
2026-01-02 14:13:20 -07:00

164 lines
5.6 KiB
Markdown

# Daily Journal Prompt Generator
A Python tool that uses OpenAI-compatible AI endpoints to generate creative writing prompts for daily journaling. The tool maintains awareness of previous prompts to minimize repetition while providing diverse, thought-provoking topics for journal writing.
## ✨ Features
- **AI-Powered Prompt Generation**: Uses OpenAI-compatible APIs to generate creative writing prompts
- **Smart Repetition Avoidance**: Maintains history of the last 60 prompts to minimize thematic overlap
- **Multiple Options**: Generates 6 different prompt options for each session
- **Diverse Topics**: Covers a wide range of themes including memories, creativity, self-reflection, and imagination
- **Simple Configuration**: Easy setup with environment variables for API keys
- **JSON-Based History**: Stores prompt history in a structured JSON format for easy management
## 📋 Prerequisites
- Python 3.7+
- An API key from an OpenAI-compatible service (DeepSeek, OpenAI, etc.)
- Basic knowledge of Python and command line usage
## 🚀 Installation & Setup
1. **Clone the repository**:
```bash
git clone <repository-url>
cd daily-journal-prompt
```
2. **Set up environment variables**:
```bash
cp example.env .env
```
Edit the `.env` file and add your API key:
```env
# DeepSeek
DEEPSEEK_API_KEY="sk-your-actual-api-key-here"
# Or for OpenAI
# OPENAI_API_KEY="sk-your-openai-api-key"
```
3. **Install required Python packages**:
```bash
pip install openai python-dotenv
```
## 📁 Project Structure
```
daily-journal-prompt/
├── README.md # This documentation
├── ds_prompt.txt # AI prompt template for generating journal prompts
├── historic_prompts.json # History of previous 60 prompts (JSON format)
├── example.env # Example environment configuration
├── .env # Your actual environment configuration (gitignored)
└── .gitignore # Git ignore rules
```
### File Descriptions
- **ds_prompt.txt**: The core prompt template that instructs the AI to generate 6 new journal prompts while avoiding repetition with the last 60 prompts.
- **historic_prompts.json**: A JSON array containing the last 60 generated prompts. This file is updated each time new prompts are generated.
- **example.env**: Template for your environment configuration. Copy this to `.env` and add your API key.
- **.env**: Your actual environment variables (not tracked in git for security).
## 🔧 Implementation Status
This repository currently provides:
- ✅ Complete prompt template for AI interaction
- ✅ Historic prompt database with 60 example prompts
- ✅ Environment configuration template
- ✅ Comprehensive documentation
**To complete the implementation**, you need to:
1. Create a Python script (see example above)
2. Add API key parsing and AI client initialization
3. Implement prompt parsing and history management
4. Add error handling and user interface
The example Python code in the "Getting Started" section provides a complete starting point.
## 🔧 Usage
### Prompt Generation Process
1. The system reads the template from `ds_prompt.txt`
2. It loads the previous 60 prompts from `historic_prompts.json`
3. The AI generates 6 new prompts, attempting to minimize repetition
4. New prompts are added to the history (maintaining only the last 60)
5. User selects one prompt for their journal writing session
## 📝 Prompt Examples
The tool generates prompts like these (from `historic_prompts.json`):
- **Memory-based**: "Describe a memory you have that is tied to a specific smell..."
- **Creative Writing**: "Invent a mythological creature for a modern urban setting..."
- **Self-Reflection**: "Write a dialogue between two aspects of yourself..."
- **Observational**: "Describe your current emotional state as a weather system..."
Each prompt is designed to inspire 1-2 pages of journal writing and ranges from 500-1000 characters.
## ⚙️ Configuration
### Environment Variables
Create a `.env` file with your API configuration:
```env
# For DeepSeek
DEEPSEEK_API_KEY="sk-your-deepseek-api-key"
# For OpenAI
# OPENAI_API_KEY="sk-your-openai-api-key"
# Optional: Custom API base URL
# API_BASE_URL="https://api.deepseek.com"
```
### Prompt Template Customization
You can modify `ds_prompt.txt` to change the prompt generation parameters:
- Number of prompts generated (default: 6)
- Prompt length requirements (default: 500-1000 characters)
- Specific themes or constraints
- Output format specifications
## 🔄 Maintaining Prompt History
The `historic_prompts.json` file maintains a rolling history of the last 60 prompts. This helps:
1. **Avoid repetition**: The AI references previous prompts to generate new, diverse topics
2. **Track usage**: See what types of prompts have been generated
3. **Quality control**: Monitor the variety and quality of generated prompts
## 🤝 Contributing
Contributions are welcome! Here are some ways you can contribute:
1. **Add new prompt templates** for different writing styles
2. **Improve the AI prompt engineering** for better results
3. **Add support for more AI providers**
4. **Create a CLI interface** for easier usage
5. **Add tests** to ensure reliability
## 📄 License
[Add appropriate license information here]
## 🙏 Acknowledgments
- Inspired by the need for consistent journaling practice
- Built with OpenAI-compatible AI services
- Community contributions welcome
## 🆘 Support
For issues, questions, or suggestions:
1. Check the existing issues on GitHub
2. Create a new issue with detailed information
3. Provide examples of problematic prompts or errors