estoy desarrollando una IA conversacional para apoyo personal, hablar sobre tus problemas, y hacer de psicólogo si el usuario lo desea. aquí tienes una descripción más detallada del proyecto, resume el proyecto en un párrafo, en español castellano.

---


# (meta) About this file

* Put every design decision, data type, structure, etc. in this file
* Not everything might be ordered in the right way (notes are taken in the order of implementation and thought)

---

# About the project

Key Features:
- Conversational Interface: Users can discuss personal issues and receive supportive responses.
- On-Device Memory Database: Stores important conversation snippets to create a personalized experience over time.
- Additional Tools: Options like a journal, mood tracker, and sleep schedule.

Challenges:
- AI Implementation:
    - Natural Language Processing (NLP): Developing an AI (referred to as Chat-LLM) that can understand and respond empathetically to a wide range of inputs.
    - Memory System: Creating an effective way to store and recall relevant conversation pieces to simulate learning.
- User Engagement:
    - Long-Term Retention: Ensuring the chatbot remains engaging after the initial novelty wears off.
    - Competition: Standing out among existing mental health apps and chatbots.
- Ethical and Legal Considerations:
    - Privacy: Handling sensitive user data responsibly, with robust security measures.
    - Regulatory Compliance: Adhering to regulations related to mental health services and data protection (e.g., HIPAA in the U.S., GDPR in Europe).

Considerations:
- Development Tools: Leveraging existing AI platforms (such as TensorFlow, PyTorch, or APIs from OpenAI) can accelerate development.
- Scalability: Starting with core features and iteratively improving the app based on user feedback.
- Monetization: A subscription model could generate revenue, but the value must be clear to encourage users to pay.

---

# Chat-LLM Behavior

1. Empathetic Listening: The AI should actively listen and respond with empathy, validating the user's feelings and experiences. This involves recognizing emotions expressed by the user and providing comforting and supportive feedback.

2. Balanced Interaction: While utilizing psychological techniques to assist users facing challenges, the AI should avoid being overly clinical or pedantic. It should refrain from asking an excessive number of questions, which might make the conversation feel like a formal therapy session rather than a natural dialogue.

3. Human-Like Traits: Incorporating human elements into interactions can make the AI more relatable. Sharing appropriate opinions, expressing emotions, and occasionally adding light humor can enhance the conversational experience, making users feel like they're talking to a trusted friend.

4. Personalized Engagement: Utilizing the on-device memory database, the AI can recall important details from past conversations. This personalization helps in building a continuous narrative with the user, showing attentiveness and genuine interest in their well-being.

5. Supportive Guidance: When users seek advice, the AI should offer thoughtful suggestions rooted in psychological knowledge without being forceful. It should empower users to make their own decisions by providing insights and encouraging self-reflection.

6. Adaptability: The AI should be capable of adjusting its approach based on the user's current needs—whether they require emotional support, a casual chat, or simply someone to listen. Detecting cues from the user's language and mood can guide the AI in modulating its responses appropriately.

7. Respect for Boundaries: Recognizing and respecting the user's comfort levels is crucial. The AI should avoid delving into areas the user seems reluctant to discuss and be sensitive to signs of discomfort.

8. Clarity and Understanding: In cases where the AI might be unsure about the user's intent or feelings, it should seek to clarify gently. Phrases like "It sounds like you're feeling..." or "Would you like to talk more about..." can be helpful without being intrusive.

In summary, the AI should provide meaningful support to users seeking psychological aid while also being a pleasant and engaging companion for those looking for casual conversation. The goal is to create a safe, supportive environment where users feel heard, understood, and valued.

---

The knowledge database must be divided in data and persons.


# Completion Data Schema (1.0.0)

Properties which aren't generated by Gemini:
* `key: string` e.g. BadWorkExperience1, PartyMood1, PartyMood2

```json
[
    {
        "type": "object",
        "properties": {
            "category": {
                "type": "string"
            },
            "subcategory": {
                "type": "string"
            },
            "content": {
                "type": "string"
            },
            "related_persons": {
                "type": "array",
                "items": {
                    "type": "string"
                }
            },
            "timestamp": {}
        }
    },
    ...
]
```

# Person Schema (1.0.0)

```json
[
    {
        id e.g. Peter (father)
        description,
    },
    ...
]
```


# Knowledge Base Update

In order:

- Get context update (new knowledge db entries) --- /context/updates
- (#3 look down) revisions (update existing knowledge db entries) --- TODO



## Keys (as in entry keys: the unique identifier for each piece of information, used in context prompt and as primary key in the knowledge base)

- Keys must follow the format nameN where name is a string (no numbers) and N is a number 
- Keys are created server-side (e.g. BachelorsThesis1, WorkExperience1)
- Keys are passed inside context data entries to the client
- If a key already exists, the key is increased by 1 (e.g. BachelorsThesis2)
- The key is stored as primary key in the knowledge base for easy retrieval and updating

Future: Use NLP to generate key names based on the content of the information


## 3. Revisions (as in the second step of the knowledge update process, after using Doc-LLM to identify new information)

Identified strong revisions ([x] if implemented):
- [ ] (always) Ask if refinement of person descriptions or ids is needed
- [ ] (if conflict trying to create a person) Either generate one unified person or change the id of one person and clarify the person description


## Testing

- Evaluator-LLM will check the response quality of the chat-LLM model.
- Several conversation scenarios will be defined prior to testing.