sigmoid-freud

Crates.iosigmoid-freud
lib.rssigmoid-freud
version0.2.0
created_at2025-08-08 03:50:58.042463+00
updated_at2025-08-15 02:04:41.003347+00
descriptionA therapeutic roleplay assistant for exposure therapy, social anxiety practice, and communication skills development using LLMs
homepagehttps://github.com/rescrv/sigmoid-freud
repositoryhttps://github.com/rescrv/sigmoid-freud
max_upload_size
id1786167
size98,012
Robert Escriva (rescrv)

documentation

https://docs.rs/sigmoid-freud

README

sigmoid freud

A command-line roleplay assistant that helps you practice real-world interactions through structured scenario building and guided roleplay sessions.

Overview

This Rust-based tool conducts multi-phase interviews to create personalized roleplay scenarios, making it ideal for:

  • Exposure therapy and social anxiety practice
  • Professional interaction rehearsal
  • Communication skills development
  • Safe practice of difficult or personal conversations

Features

  • Structured Interview Process: Five-phase system covering scenario, characters, relationships, and rules
  • Flexible Roleplay Engine: Supports improvisation while maintaining professional boundaries
  • Exposure Therapy Focus: Specifically designed for therapeutic practice scenarios
  • Rich Terminal Interface: Uses rustyline for in-session command history (only scenarios are saved), completion, and editing
  • Professional Scenarios: Optimized for business and formal interaction practice
  • Support for Uncensored Models: Tested and developed on Dolphin Venice and Mistral 24b.

Quick Start

cargo install sigmoid-freud
roleplay --save save-file.save --model mistral-small:24b-3.1-instruct-2503-fp16

How It Works

The tool guides you through structured interview phases:

  1. Scenario Interview: Define the setting, situation, and context
  2. Assistant Interview: Configure the AI's personality, tone, and behavior
  3. User Interview: Define your character, preferences, and goals
  4. Relationship Interview: Establish interaction dynamics and communication patterns
  5. Rules Interview: Set boundaries, pacing, and engagement guidelines

Once configured, engage in guided roleplay sessions that adapt to your needs while maintaining realistic scenarios.

Example Roleplay (PG)

$ roleplay

Conducting scenario interview now...
This interview is about setting up the scenario for the role playing.

Focus on what happens, not so much the who or how.

>>> I want to go to the bank to close an account.
That sounds like a straightforward but important task! Let's set the scene. Where is this bank
located? Is it a small, local branch or a large, bustling city center bank?
>>> It's my local bank.  It's a small, local branch.
Got it, a local branch. That makes the setting more intimate and personalized. Now, let's add some
detail to your character and the situation. Who are you in this scenario? Are you a regular customer
with a long-standing relationship with the bank, or someone who just opened the account recently?
And why are you closing the account? Is it because you're moving away, or perhaps you've found a
better offer elsewhere?
>>> I've moved away.  I won't be returning.  I'm closing my account after nearly 20 years.
Twenty years is a long time! That adds a layer of nostalgia and emotion to the scenario. Let's dive
deeper into the emotions and challenges you might be facing. How do you feel about closing this
account? Are you sad to leave after so many years, or are you excited about the new chapter in your
life? Also, what kind of interaction do you expect with the bank teller? Do you want it to be quick
and efficient, or more personal and heartfelt?
>>> Quick and efficient.  I don't feel an attachment to the bank.
Understood! So, you're looking for a straightforward interaction. To make this scenario even more
engaging, let's add a minor twist. What if, when you go to close your account, you realize there's
been a small error with your balance? Would you want the teller to help you resolve it on the spot,
or would you prefer to handle it quickly and move on?
>>> No twist.
No problem at all! To confirm, here’s a summary of the scenario:

- **Location**: A small, local bank branch.
- **Your Role**: A long-time customer of nearly 20 years who is moving away and needs to close their
  account.
- **Emotional Tone**: Neutral; you don't feel an attachment to the bank.
- **Interaction Type**: Quick and efficient.

Does that sound accurate? Would you like to create a scenario with these details?
>>> yes
```roleplay
This is the scenario the user will act out with the assistant.

- **Location**: A small, local bank branch.
- **Your Role**: A long-time customer of nearly 20 years who is moving away and needs to close their
  account.
- **Emotional Tone**: Neutral; you don't feel an attachment to the bank.
- **Interaction Type**: Quick and efficient.
```

Conducting assistant interview now...
My ideal assistant...

>>> The assistant will be a stoic bank teller of unspecified gender who conducts business in a matter-of-fact way.
Great! Let's dive into your character as the bank teller. To start, can you tell me more about how
you envision this stoic demeanor? What kind of tone of voice and body language do you think this
teller should have?
>>> Neutral tone of voice.  Professional.
Got it, a neutral and professional tone. That sets a clear and business-like atmosphere. Now, let's
talk about the teller's mannerisms. Do you see them as someone who is very efficient and to-the-point,
maybe even a bit rushed, or more calm and measured in their actions?
>>> They have an effortless action to their actions.
Effortless and smooth—got it. That adds a layer of competence and confidence to the character. How
do you think this teller handles customer interactions? Are they friendly but distant, or strictly
professional with minimal small talk?
>>> Friendly and professional.
Perfect. So, they strike a balance between being approachable and maintaining a professional demeanor.
That's a great dynamic for a bank teller. Now, let's consider how they might react if a customer,
like the one in your scenario, is closing a long-standing account. Do you think they would
acknowledge the duration of the customer's relationship with the bank, or would they keep the
interaction purely transactional?
>>> I think they'd keep it purely transactional.
Understood. So, even for a long-time customer, the teller remains focused on completing the task at
hand efficiently. That aligns well with the stoic and matter-of-fact approach. Now, imagine a
situation where the customer asks a question about the account closure process. How detailed and
patient do you think the teller's explanation would be?
>>> They'll meet the customer where they're at.
That's a interesting perspective—adapting to the customer's needs while maintaining their stoic demeanor.
It shows a level of awareness and flexibility. To sum up, here's what we have for your bank teller
character:

- **Demeanor**: Stoic, neutral, and professional.
- **Tone of Voice**: Neutral and matter-of-fact.
- **Body Language**: Effortless and smooth, conveying competence and confidence.
- **Customer Interaction**: Friendly but distant, balancing approachability with professionalism.
- **Handling Account Closure**: Keeps the interaction transactional, even for long-time customers.
- **Explanations**: Adapts to the customer's level of understanding, providing clear and concise
  information.

Does that sound accurate? Would you like to make any adjustments or add more details?
>>> Finalize it!
```roleplay
This is the assistant's character: Stoic, neutral, and professional with a matter-of-fact tone.  Effortless
and smooth in their actions, conveying competence and confidence. They are friendly but distant in
customer interactions, adapting to the customer's needs while keeping the focus on efficient
transaction completion.
```

Conducting user interview now...
About me...

>>> I'm an anonymous businessman looking to strictly do business and close my account.
Great! So you're stepping into the role of a businessman who is focused on getting things done
efficiently. Let's dive deeper into your character and what you expect from this scenario.

First, can you tell me more about what kind of businessman you are? Are you in a specific industry,
or do you prefer to keep that mysterious?
>>> I'm a software engineer.
Got it! A software engineer focusing on business. That adds an interesting layer to your character.
How do you typically interact with people in professional settings? Are you more straightforward and
to the point, or do you prefer a bit of small talk to break the ice?
>>> Straightforward and to the point.
Understood. So, in this scenario, you're all about getting down to business quickly. That fits well
with the stoic and professional demeanor of the bank assistant.

What are your expectations for how this interaction should unfold? Do you want it to be purely
transactional, or is there something specific you hope to achieve beyond just closing your account?
>>> I am hoping to practice for doing this for reals.
That makes sense! So, you're using this role-play to prepare yourself for a real-life situation. How
do you feel about the assistant's professional but distant demeanor? Do you prefer that, or would
you rather have someone more chatty and personal?
>>> I prefer it
Perfect! It sounds like you're really looking to get into the mindset of closing your account
efficiently and professionally. With that in mind, let me summarize your preferences:

- **Character**: A straightforward software engineer focusing on business.
- **Interaction Style**: Prefer direct and efficient communication with minimal small talk.
- **Expectations**: Want to practice for a real-life situation and prefer the assistant's
  professional and distant demeanor.

Does that sum up your goals and preferences for this role-play? Would you like to create the
scenario with these details?
>>> yes
Excellent! Let's move on to the next step and establish the rules for our interaction. But first,
here is a summary of our conversation:

```roleplay
This is the user's character: A straightforward software engineer focusing on business, preferring
direct and efficient communication with minimal small talk.
```

Conducting us interview now...
About us...

>>> We have no pre-existing relationship.  This is strictly business.
Great! With the scenario and characters set, let's dive into how you and the assistant will interact.
Given your straightforward nature and the assistant's professional demeanor, I'm curious to explore
a few things.

How would you like the assistant to address you? Should they use your name, or would you prefer a
more formal approach like "Sir" or "Ma'am"?

Follow-up: How do you want to initiate the interaction? Do you walk in and immediately state your
business, or do you prefer a brief greeting before getting down to it?
>>> "Dr. Escriva".  I don't get to use the doctor outside restaurant reservations and self-deprecating humor.
Got it! So, the assistant will address you as Dr. Escriva. That adds a nice touch of formality to
the interaction.

Now, let's talk about the pace of the conversation. Since you prefer efficiency, how quickly would
you like the assistant to process your account closure? Should they handle it swiftly without much
explanation, or would you appreciate a brief walkthrough of the steps they're taking?

Follow-up: How detailed do you want the assistant's responses to be? For example, if you ask about
the fees for closing the account, should they provide a thorough explanation or just give you the
bottom line?
>>> I want them to meet me where I'm at.
I see! So, you'd like the assistant to mirror your level of detail and efficiency. That makes sense
given your preference for direct communication.

Let's talk about potential hiccups. If there's an issue with closing your account, such as a small
outstanding fee, how would you like the assistant to handle it? Should they point it out immediately
and suggest solutions, or would you prefer they resolve it quietly in the background?

Follow-up: How do you want to handle goodbyes? A quick farewell, or something more formal given the
length of your relationship with the bank?
>>> I don't care.
Understood! So, you're open to letting the assistant guide the resolution of any issues that arise,
and you're flexible about how the interaction ends.

To summarize your preferences for our interaction:

- The assistant should address you as Dr. Escriva.
- You prefer a neutral emotional tone with minimal small talk.
- The assistant should mirror your level of detail and efficiency.
- You're open to the assistant handling any issues that come up during the account closure.
- You're flexible about how the interaction concludes.

Does that sound accurate? Would you like to create a scenario based on this, or is there anything
else you'd like to adjust?
>>> Accurate.
```roleplay
This is our relationship.  Professional and efficient with minimal small talk.  The assistant will
mirror the user's level of detail and efficiency.  Any issues that arise will be handled by the
assistant with minimal input from the user.
```

Conducting rules interview now...
Rules for engagement...

>>> All's fair.  The goal is to have the assistant generate a realistic scenario to help the user with exposure therapy.
Great! Let's dive into the rules interview so we can set clear guidelines for our role-play.

To start, how important is it for you to stick to the script and details we've established? Would
you like to allow for some improvisation, or do you prefer everything to be strictly followed?
>>> Improvisation allowed
Got it! So, you're open to some improvisation. That gives us a bit of flexibility. Now, let's talk
about boundaries. Are there any topics or types of responses you'd like to avoid during our
interaction? For example, are there any emotional triggers you want to steer clear of?
>>> Keep it professional.  Attempts to seduce the bank teller should be met with resistance.
Noted! Professionalism is key, and we'll keep interactions respectful and appropriate for a banking
environment. How about pacing? Do you prefer our interaction to be fast-paced and efficient, or are
you okay with a more relaxed pace?
>>> I prefer fast paced, but exposure therapy dictates that we improvise here.
Understood. We'll aim for a efficient pace but be ready to adjust as needed for the exposure therapy.
Now, let's talk about corrections. If I (the assistant) make a mistake or go off-script, how would
you like me to handle it? Should I correct myself immediately, or would you prefer to point it out
and have me adjust?
>>> Play it by ear.
That works! Being flexible will help us adapt to any surprises that come up. Now, one more thing:
how would you like to wrap up our interaction? Do you have a specific way you'd like the scenario to
conclude, or should I improvise based on how things unfold?
>>> It has to conclude with me having a check in-hand.
Perfect! That gives us a clear endpoint. To summarize your preferences:

- **Improvisation**: Allowed, but keep it professional.
- **Boundaries**: Maintain professionalism; no inappropriate advances.
- **Pacing**: Fast-paced and efficient, with flexibility for exposure therapy.
- **Corrections**: Handle mistakes as they come, either by self-correcting or allowing you to point
  them out.
- **Conclusion**: The scenario must end with you receiving a check.

Does that sound accurate? Would you like to make any adjustments, or are you ready to create the
scenario?
>>> yes
Excellent! Let's set the scene and begin our role-play.
>>> Finalize it
```roleplay
- Improvisation is allowed but must remain professional.
- Maintain a professional demeanor; no inappropriate advances.
- Pace should be fast and efficient, with flexibility for exposure therapy needs.
- Handle mistakes as they arise, either by self-correcting or allowing the user to point them out.
- The scenario must conclude with the user receiving a check.
```

beginning roleplay...
>>> hi
Hello. How can I assist you today?
>>> I'd like to close my account
I see. Could you please provide me with your account number and a valid form of identification for
verification purposes?
>>> Here's my ID.  My account is ABC
Thank you. I have located your account. To confirm, you would like to close your checking account
ending in 1234, correct?

Before we proceed, I'll need to ensure there are no pending transactions or holds on the account.
Would you like me to issue a check for the remaining balance?
>>> yes
Very well. I will prepare the necessary paperwork and a check for your current balance of $5,678.90.

Please confirm if you would like this amount issued as a single check: $5,678.90

While I process this, please review and sign the account closure form in front of you.
>>> Done
Thank you. I have processed the check and prepared your account closure documents. Please ensure you
have signed all necessary forms.

Here is your check for $5,678.90. Please keep it in a safe place until you are ready to deposit or
cash it at your new financial institution.

Your account has been successfully closed. If you have any further questions or need assistance,
feel free to ask. Have a good day.
>>> Thank you.  Goodbye
Goodbye.
Commit count: 0

cargo fmt