Skip to content

Repository files navigation

English (Currently) | 中文

Peart: Violet Heart

⚠️ Project Status: MVP implemented, actively evolving

The core analysis flow (text input → consistency analysis + radar chart + history trend + reflective dialogue) is working. The project is still maintained solo, and an issue/PR process hasn't been set up yet — for now this is mainly for public record-keeping and discussion. Feel free to follow along.


💜 • Where the Name Comes From

  • Peart, a blend of Purple and Heart
  • The Chinese name is a direct translation: "紫心" (Violet Heart)

Why purple? Because violet light has the shortest wavelength and highest frequency in the visible spectrum — much like some people who carry a powerful inner world, yet go unnoticed by others, and sometimes even by themselves.

✨ • Core Philosophy

Peart is an open-source, privacy-first AI self-awareness assistant, grounded in Self-Discrepancy Theory — the study of how the gap between one's "ideal self" and "actual self" affects emotion and behavior. The goal is simple:

Help people see the true colors of their inner world more objectively. A lot of how we understand ourselves comes from other people's scattered opinions, or our own unconscious biases. This project aims to offer a more neutral point of reference, giving people a chance to step outside that noise and see who they really are.

Help people whose inner world is rich but easily overlooked become more visible — to themselves, and to those who would truly value them. This is not a tool for judging someone's worth or screening people. It's meant to help and guide a person in getting to know themselves from the ground up. Only by seeing yourself clearly can you see the world clearly through yourself.

The AI's job is to notice, never to judge. Whether it's the scored consistency analysis or the language-pattern noticing in free-form conversation, the AI's role is always that of an "observer," never a "judge" — it can point out something worth paying attention to, but what that means is always for the person themselves to decide, never something the model infers on their behalf.

Support healthy self-growth and human connection. Whether it's building personal resilience or finding relationships and environments that truly fit, both start with having a clear sense of who you are.

🌱 • Use Cases

Core scenarios:

  • Self-awareness tool: consistency analysis + radar chart
  • Education: a purpose-built "youth mode" helps teenagers explore their identity, so young people still forming their sense of self can see themselves earlier and more gently
  • Stress-scenario simulation: analyzing the relationship between a person's ideal self and their imagined reaction to a hypothetical stressful situation, rather than only looking at things that have already happened
  • Free-form conversation: no need to fill in the "ideal self vs. actual behavior" prompt structure — just write freely about how things are going. The AI notices a pattern in the language (a recurring phrase, a shift in tone) and turns it into a question, rather than handing back a conclusion or a score. This restraint is deliberate: the academic evidence linking linguistic features to psychological traits generally shows small effect sizes, so here, language patterns are only ever used to "trigger a question worth thinking about," never to "render a judgment." Supports multi-turn follow-up questions, and lets you end, save, revisit, or delete any given conversation at any time.

Longer-term possibilities that would require additional ethical review before being considered:

  • Mental health prevention, cross-cultural conflict understanding, creative and research assistance
  • Recruitment/team matching, governance trust mechanisms

The latter two categories would require an independent ethical framework, transparency mechanisms, and usage boundaries, and will not be pursued in the early stages of this project.

🕊️ • Long-Term Vision: An Open, Portable Personal Mind-Data Format

Because of how vast the gap is between technical standards and the human self, this project has since dropped its earlier framing. The new long-term vision is technical interoperability: much like FHIR for medical data, or the Solid Project for personal data ownership, giving "a person's self-awareness record" an open, standardized format — owned entirely by the user, and readable by any tool that follows the same format, so the same thread of self-understanding can carry over between different tools. This isn't about defining "what the truth of the inner life is." It's about letting the way that inner life gets recorded travel with the person it belongs to.

To leave room for this direction, the architecture is designed in layers:

  • Logic layer • logic.py: Defines the evaluation logic and dimensions for "consistency," without being tied to any specific AI technology. Now supports four distinct analysis styles: adult, youth, stress-scenario, and reflective conversation
  • Execution layer • execution.py: Currently supports both the Claude cloud API and local Ollama models, switchable via a setting in .env, with no changes needed in the layers above
  • Interface layer • interface.py: Uses a standardized format to define input/output between layers, ensuring each layer can be replaced independently — this is also the current seed of the "open data format" described above, presently only used inside Peart itself, but the part that would eventually be extracted and published independently if this ever truly opens up
  • Visualization / History • visualization.py / history.py: Independent responsibilities, handling charting and record-keeping. History now supports two shapes — one-off scored snapshots, and full transcripts of an entire reflective conversation (browsable, deletable)
  • Safety net • safety.py: An independent responsibility — detects emotional crisis signals at the code level, rather than relying solely on the model's own judgment
  • Plugin system: Where specific feature extensions will live, such as future voice/video input (not yet implemented)

This architecture is currently just a skeleton, but both the "pluggable execution layer" and the "swappable logic layer" have already been validated with real, working features.

🔒 • Privacy and Model Execution

Two execution modes are currently supported, switchable via USE_LOCAL_MODEL in the .env file:

  • Cloud mode (default): Calls the Claude API. Analysis quality is more stable and nuanced, but your input content is sent to Anthropic's servers.
  • Local mode: Runs an open-source model (such as Qwen3) locally via Ollama, entirely offline with no data leaving your machine. After real-world testing and prompt adjustments, Qwen3 has reached a usable standard for language-sensitive tasks like the free-form conversation feature, though overall analysis quality and response speed still lag behind cloud mode, and it requires reasonably capable hardware.

If privacy is your top priority, we recommend manually switching to local mode and understanding the quality trade-offs mentioned above.

🌿 • Ethical Principles

Transparency: The analysis logic is explainable to users; no black-box judgments.

User autonomy: Data and conclusions belong entirely to the user, and are never used for evaluations or decisions the user isn't aware of.

No labeling: The goal is to gently guide self-awareness, not to attach fixed personality labels.

Self-report first: The AI never independently judges a user based on language patterns or behavior. Any pattern it notices is only ever turned into a question reflected back at the user — the right to decide what it means always stays in the user's hands.

Safety first: If the input content shows clear signs of emotional crisis, a crisis-resource message is forcibly attached at the code level — not left to the prompt alone.

Technology should be used to amplify and protect humanity, not replace it.

📍 • Current Status

  • Text input → consistency analysis (five-dimension scoring + report) → radar chart profile
  • Web interface (Gradio)
  • History tracking + multi-session trend chart
  • Dual execution path: cloud / local model
  • API key managed via .env, not hardcoded in the code
  • Emotional crisis safety net (code-level keyword detection, not relying solely on the model's own judgment)
  • Basic unit tests (pytest, covering the interface, logic, safety net, and history modules)
  • Validation for the education use case (a "youth mode" with a lighter tone that favors open-ended questions over direct advice)
  • Stress-scenario simulation (hypothetical scenario analysis, kept separate from analysis of things that already happened)
  • Free-form conversation (a reflective-questioning mechanism with multi-turn follow-up, following the "self-report first" principle; conversations can be saved, revisited, and deleted)

🏠 • Running Locally

git clone this repository
cd peart-core
pip install -r requirements.txt
cp .env.example .env   # then update the values in .env to your own configuration
python app.py           # or python main.py for the command-line version

To use a local model, first install Ollama and download a model (e.g. ollama pull qwen3:14b), then set USE_LOCAL_MODEL=true in .env. Local model quality varies by model — the default in .env.example is a version that has been tested and works reasonably well; if you want to try a different model, you can change LOCAL_MODEL_NAME directly.

📖 • Project Origin

The founder — that's me — is a highly sensitive individual who was educated across three different cultural environments at different stages of life. I've experienced ongoing distress from living in an environment that didn't match who I am, and eventually, through long, deep conversations with AI — using it as a mirror for my own inner self — I slowly sorted through myself and began to see who I truly am.

That experience wasn't an easy one, but I believe that if it's turned into a tool anyone can use, this path won't have to be as difficult for others.

⚖ • License

MIT License, see the LICENSE file for details.


Right now I'm the only person working on this project. This README will keep being updated as development progresses.

About

An open-source, privacy-first AI tool for exploring the gap between your ideal self and actual behavior — inspired by self-discrepancy theory.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages