points by kreyenborgi 1 year ago

> If you use Org mode, you can have branching conversations in gptel where each path through the document's outline tree is a separate conversation branch. This way you can explore tangential topics while retaining the lineage of the conversation that led to them, while excluding the other branches. This keeps the context window from blowing up and your API inference costs (if any) down.

Can you give an example of how this looks? I see it's mentioned in https://github.com/karthink/gptel/?tab=readme-ov-file#extra-... but I feel like I need an example. It sounds quite interesting and useful, I've often done this "manually" by saving to a new buffer when I go on a tangent.

EDIT: Nevermind, C-h v gptel-org-branching-context gives:

    Use the lineage of the current heading as the context for gptel in Org buffers.
    
    This makes each same level heading a separate conversation
    branch.
    
    By default, gptel uses a linear context: all the text up to the
    cursor is sent to the LLM.  Enabling this option makes the
    context the hierarchical lineage of the current Org heading.  In
    this example:
    
    -----
    Top level text
    
    * Heading 1
    heading 1 text
    
    * Heading 2
    heading 2 text
    
    ** Heading 2.1
    heading 2.1 text
    ** Heading 2.2
    heading 2.2 text
    -----
    
    With the cursor at the end of the buffer, the text sent to the
    LLM will be limited to
    
    -----
    Top level text
    
    * Heading 2
    heading 2 text
    
    ** Heading 2.2
    heading 2.2 text
    -----
    
    This makes it feasible to have multiple conversation branches.

Cool :-D