A personal self-reflection tool powered by LLMs, inspired by narrative-based approaches to self-exploration in psychology.
The user starts by writing a free-form personal narrative. From there, the system identifies themes to explore and generates Socratic questions designed to prompt deeper reflection. Keywords act as cognitive scaffolding to help the user engage with questions that might otherwise feel hard to answer. At the end of a session, the system produces a summary grounded in the user's own words.
- Narrative — the user writes a free-form personal narrative
- Themes — the LLM identifies themes to explore; the user can also add their own
- Questions — for each theme, Socratic questions are generated to guide reflection
- Keywords — optional hints to help the user respond to each question
- Summary — at the end of the session, a narrative summary is generated from the user's answers
- Python, Streamlit
- Anthropic API (Claude)
- SQLite (user data and session persistence)
- YAML-based configuration and prompt management
app.py # entry point
cfg.yml # model, db and session settings
prompts.yml # all system and user prompts
src/
workflow.py # LLM workflow orchestration
db.py # database management
pages/
user_info.py # login and registration
narrative_and_themes_navigation.py
questions_answers.py
conclusion.py
utils/
llm.py # Anthropic API wrapper
parsing.py # XML response parsing
formatting.py # Q&A history formatting
Create a .env file in the root directory:
API_KEY=your_anthropic_api_key
Run the app:
streamlit run app.pyAll settings are managed in cfg.yml:
llm:
model: claude-sonnet-4-20250514
temperature: 0.1
max_tokens: 1024
settings:
language: italian # language for LLM responses
n_themes: 5
n_questions: 3
n_keywords: 3Work in progress. The current version is a functional demo. The longer-term idea lives in the data layer: what gets collected across sessions, how it evolves over time, and how it can be visualized to support self-understanding.
This project is inspired by ExploreSelf, a research project by NAVER AI Lab exploring LLM-driven Socratic dialogue for self-reflection and personal growth.