# Forking Chats (/docs/features/fork)

import Image from 'next/image'

<Image
src="https://github.com/danny-avila/LibreChat/assets/32828263/5187e8e2-b1c1-4954-979c-9c3b8cfabe9e"
width={1024}
height={512}
alt="Fork Messages and Conversations feature in LibreChat"
/>

## Why Fork Conversations?

Think of forking like creating a new path in your chat - it's super handy when you want to:

### Keep Things On Track
Sometimes you'll hit on an interesting side topic but don't want to derail your main conversation. Forking lets you dive into that rabbit hole while keeping your original chat clean

### Play "What If"
Want to see how different approaches might play out? Fork the chat and try various angles. It's like having multiple parallel conversations, each exploring a different possibility

### Save Important Context 
When you fork, you can bring along as much or as little of the previous chat as you need. This way, you're not starting completely from scratch, and the AI still has the background it needs

### Share Specific Parts
Need to show someone just part of your conversation? Instead of copying and pasting or sharing your whole chat history, you can fork just the relevant bit and share that

### Keep Ideas Organized
Long chats can spawn lots of different ideas. Rather than letting them get tangled together, you can fork each one into its own thread and develop them separately

### Try Different Approaches
Sometimes you might wonder if there's a better way to ask something. Forking lets you experiment with different ways of talking to the AI without messing up your main conversation

## Forking Options

Use these settings to fork messages with the desired behavior.

Forking refers to creating a new conversation that starts/ends from specific messages in the current conversation, creating a copy according to the options selected.

The "target message" refers to either the message the popup was opened from, or, if you check "Start fork here", the latest message in the conversation.


### Visible messages only: 
This option forks only the visible messages; in other words, the direct path to the target message, without any branches.

<div style={{padding: "20px", display: "flex", justifyContent: "center", alignItems: "center", flexDirection: "column"}}>
  <div className="image-light-theme">
    <img src="https://github.com/danny-avila/LibreChat/assets/32828263/873bdba1-de1f-4b84-a996-b2dbfc866d55" alt="1-L" style={{borderRadius: "10px"}} />
  </div>

  <div className="image-dark-theme">
    <img src="https://github.com/danny-avila/LibreChat/assets/32828263/0ed6ea88-5840-4dda-8f8b-305a4c34a050" alt="1-D" style={{borderRadius: "10px"}} />
  </div>
</div>


### Include related branches:
This option forks the visible messages, along with related branches; in other words, the direct path to the target message, including branches along the path.

<div style={{padding: "20px", display: "flex", justifyContent: "center", alignItems: "center", flexDirection: "column"}}>
  <div className="image-light-theme">
    <img src="https://github.com/danny-avila/LibreChat/assets/32828263/e633f701-acf5-4878-bdd1-29abacb3e3e7" alt="2-L" style={{borderRadius: "10px"}} />
  </div>

  <div className="image-dark-theme">
    <img src="https://github.com/danny-avila/LibreChat/assets/32828263/0c297451-990b-4ab2-9ff2-bc3958ab7129" alt="2-D" style={{borderRadius: "10px"}} />
  </div>
</div>

### Include all to/from here (default):
This option forks all messages leading up to the target message, including its neighbors; in other words, all message branches, whether or not they are visible or along the same path, are included.

<div style={{padding: "20px", display: "flex", justifyContent: "center", alignItems: "center", flexDirection: "column"}}>
  <div className="image-light-theme">
    <img src="https://github.com/danny-avila/LibreChat/assets/32828263/d19b427b-e018-41e6-ab1a-6306a94be26b" alt="3-L" style={{borderRadius: "10px"}} />
  </div>

  <div className="image-dark-theme">
    <img src="https://github.com/danny-avila/LibreChat/assets/32828263/ae3e5086-7b8f-417f-8b6e-073776536a49" alt="3-D" style={{borderRadius: "10px"}} />
  </div>
</div>

## Additional Options

- **Start fork here:** If checked, forking will commence from this message to the latest message in the conversation, according to the behavior selected above.

<div style={{padding: "20px", display: "flex", justifyContent: "center", alignItems: "center", flexDirection: "column"}}>
  <div className="image-light-theme">
    <img src="https://github.com/danny-avila/LibreChat/assets/32828263/801e50e4-749a-42f3-83bd-a3fc06c6e189" alt="4-L" style={{borderRadius: "10px"}} />
  </div>

  <div className="image-dark-theme">
    <img src="https://github.com/danny-avila/LibreChat/assets/32828263/bb2f2e39-091e-4b5b-926d-bf36c7a65079" alt="4-D" style={{borderRadius: "10px"}} />
  </div>
</div>

- **Remember:** Check to remember the options you select for future usage, making it quicker to fork conversations as preferred.

<div style={{padding: "20px", display: "flex", justifyContent: "center", alignItems: "center", flexDirection: "column"}}>
  <div className="image-light-theme">
    <img src="https://github.com/danny-avila/LibreChat/assets/32828263/9a9f61db-c3ec-4139-8f3a-e25557d95066" alt="5-L" style={{borderRadius: "10px"}} />
  </div>

  <div className="image-dark-theme">
    <img src="https://github.com/danny-avila/LibreChat/assets/32828263/a567965f-881e-423b-9eec-e3004643a560" alt="5-D" style={{borderRadius: "10px"}} />
  </div>
</div>

- Alternatively you can control the default behavior in the settings menu:

<div style={{padding: "20px", display: "flex", justifyContent: "center", alignItems: "center", flexDirection: "column"}}>
  <div className="image-light-theme">
    <img src="https://github.com/danny-avila/LibreChat/assets/32828263/c85fabb7-7d92-4e63-9190-ac3f4470b505" alt="6-L" />
  </div>

  <div className="image-dark-theme">
    <img src="https://github.com/danny-avila/LibreChat/assets/32828263/2ba9dfc0-8b21-4297-bf67-9bf6b2ff0aa2" alt="6-D" />
  </div>
</div>
