Local-first diary feedback app powered by OpenAI-compatible AI providers.
AI Diary Feedback reads local Markdown diary entries, generates supportive diary feedback, maintains a local summary cache, lets you save favorite feedback, and can optionally export a sanitized context file for a local companion app.
The project is designed for private local use. Real diary entries, generated cache files, logs, .env files, and private local paths should stay on your own machine.
- Provides a local Flask web UI for diary feedback.
- Reads diary files from a configurable local folder.
- Generates feedback using OpenAI-compatible providers such as OpenRouter or SiliconFlow.
- Builds and reuses local diary summary cache files.
- Saves favorite feedback locally.
- Can append saved feedback back into diary files with guarded comment blocks.
- Includes an optional email notification script.
- Includes an optional Smart Desktop Pet integration that exports sanitized summary context only.
app.py # Flask web app
diary_feedback.py # Diary reading, feedback, summary cache logic
favorite_feedback.py # Save favorite feedback locally
pet_feedback_export.py # Optional sanitized desktop-pet bridge export
diary_notify.py # Optional email notification workflow
templates/index.html # Local web UI
config.py # Environment-based configuration
prompt.example.txt # Public example prompt
.env.example # Configuration template
examples/ # Fictional integration examples
sample_data/ # Fictional demo data
- Python 3.11
- Conda or another Python environment manager
- An OpenAI-compatible API key if you want to generate real feedback
Install dependencies:
conda create -n diary python=3.11
conda activate diary
python -m pip install openai mistune python-frontmatter python-dotenv flaskCopy the example environment file:
copy .env.example .envThen edit .env with your own private values.
Important settings:
OPENROUTER_API_KEY=your_openrouter_api_key_here
SILICONFLOW_API_KEY=your_siliconflow_api_key_here
DIARY_ROOT=./sample_data/diary
CACHE_DIR=./summary_cache
PROMPT_FILE=./prompt.example.txt
DATA_DIR=./data
APP_PORT=5000Never commit .env.
By default, the reader expects diary files named by date:
YYYY-MM-DD.md
The current diary path helper uses this folder style:
DIARY_ROOT/
26年/
1月/
2026-01-01.md
You can point DIARY_ROOT to your own private diary folder in .env.
conda activate diary
python app.pyOpen:
http://127.0.0.1:5000
If you set a different APP_PORT, use that port instead.
On Windows, you can also run:
Start.bat- Start the web app.
- Choose a date.
- Click the feedback button in the local UI.
- The app reads the local diary entry and asks the configured AI provider for feedback.
- After generation, the app can update the local summary cache.
The UI can scan diary dates and build missing summaries. Cache files are stored locally and ignored by Git.
Favorite feedback is saved under DATA_DIR, which defaults to ./data. This directory is ignored by Git.
If enabled in the UI, saved feedback can also be appended to the source diary file inside guarded comment blocks. The reader strips those blocks before future AI processing so saved feedback does not pollute later summaries.
diary_notify.py, email.bat, and run_notify.bat are optional. They use email settings from .env.
Do not run email scripts until your email credentials and receiver address are intentionally configured.
This project can optionally integrate with Smart Desktop Pet:
https://github.com/kadywilson/desktop-pet
The integration is disabled by default:
ENABLE_DESKTOP_PET_INTEGRATION=falseWhen enabled, this project exports a local JSON bridge file containing sanitized diary context, such as a short summary and suggested tone. It should not export full diary entries, raw AI conversations, private memories, API keys, tokens, or private local paths.
Example private configuration:
ENABLE_DESKTOP_PET_INTEGRATION=true
DESKTOP_PET_BRIDGE_PATH=your_private_local_bridge_path_here
DESKTOP_PET_EXPORT_MODE=sanitized_summaryA fictional demo bridge file is included at:
examples/desktop_pet_bridge.demo.json
You do not need Smart Desktop Pet installed to run this diary feedback app.
This repository is meant to publish code and fictional examples only.
Do not commit:
.env- real diary entries
- real generated feedback
- summary cache files
- logs
- databases
- generated bridge files
- API keys or tokens
- private local paths
See:
PRIVACY.mdSECURITY.mdINTEGRATIONS.md
Fictional examples are included in:
sample_data/demo_diary_entry.jsonsample_data/diary/examples/desktop_pet_bridge.demo.json
They are safe to inspect and use for setup checks.
No license has been declared yet. Add a license before encouraging broad reuse.