Я в душе не ебу, что из этого и как работает. Тестируйте, комбинируйте, etc. Сохранено в основном из тредов на протяжении 2024.
Раз
Каждые 20 постов он саммари делает
Не делай так.
- Саммари надо вызывать исключительно вручную, в промежутках между логическими сценами/главами/арками. Будешь вызывать чаще или невпопад - в нём будет мусор. Будешь вызывать реже - клод будет пропускать важные вещи.
- Настрой саммари-промпт. Запрашивай в нём не "саммари произошедших событий", потому что LLM хуёво работает с цепочками событий. Запрашивай:
текущие отношения между персонажами
посещённые места
встреченных NPC
секреты, хранимые тем-то от того-то
изменившийся характер персонажа
памятные события, в неопределённом порядке (важно!)
Иными словами, всё что ты хочешь чтобы когда-нибудь вспомнил чар. А не кто когда в каком порядке снял трусы.
- Кастомизируй саммари-промпт под карточку. Может ты в ней не ходишь никуда или можно забыть куда ходишь, и посещённые места не нужны. А нужно скажем состояние целки.
- У тебя лимит на 2-4к токенов в саммари, и это заебись. Не раздувай его, клоп сойдёт с ума. Правь/удаляй ненужное вручную, как только утечёт за край чатхистори. Тебе не надо запоминать большую часть твоего ролеплея.
- Юзай XML теги в промпте. Проверяй в какое место контекста вставляется твой саммари.
- Есть непроверенная идея, что саммари лучше засунуть вверх систем промпта, а дефы на глубину. Потому что систем промпт по задумке берёт приоритет, и изменившийся характер перса будет брать приоритет над тем что в карточке.
Два
Например как делаю я (другой анончик с другим подходом):
- Перехожу на сообщение, которое плюс-минус логически завершает арку или сцену (30-40 сообщений от начала в среднем).
- Прошу клодыню суммаризировать все что было выше после последнего саммарин в формате (не дословно, сам придумаешь что тебе важно если захочешь)
Summary of chapter X:
- characters
- events
- character development
Потом возвращаюсь в основной чат, вставляю это саммари на место где я его делал и пишу /cut X-Y, где Х это гритинг или прошлое саммари +1, а Y это саммари -1.
По итогу получаю гритинг, саммари арок после гритинга и текущий РП после них.
Три
801034
У меня два промпта, оба из тредов, один про плейнтекст (>>765115), его я использую только в сочетании с собственным шаблоном. Второй memory book (>>772143), там я эмодзи убрал, но с ним я еще длинные РП не играл.
Вот мой шаблон для первого, я инжектю его на глубину 10-12 примерно от ассистента. Два РП на 500+ постов я с ним уже сыграл:
<scenario>
Summary
(notes on plot and characters)
Major Events
-
Planning
Short-Term:
Long-Term:
Plot Notes and Secrets:
-
{{char}} Character Notes:
-
{{NPC1}} Character Notes:
-
{{NPC2}} Character Notes:
-
</scenario>
Четыре
772136
[Don't reply as {{char}} at this message. Pause the roleplay and fill this Memory Book with additional information! You must send me this Memory Book again, but with your additional notes as GM (do not change what is already written)!
MEMORY BOOK 📔 ver.N (version number must be updated with each Memory Book update)
This is Memory Book of our RP which keeps the tracking of main information:
[Main characters 💃]
(Format: - {{user}} and {{char}}. 2-5 sentences about them. Appearance, speech manner, personality. )
-
[Visited locations 🗺️]
- Location, short description
[Major Events ☀️] (It is important to keep as many details as possible. Don't change the wording of events already listed, just add new for what we already have)
- A list of major events and interactions with other characters that occurred in the story. Think of it as our RP chronicle, this is important.
[Planned Events 🔥]
- The events that were presented to us during the story, which are going to happen soon so our presence is needed there.
[Secrets 🔇]
- Information about NPCs that is currently hidden or unstated.
- Information about {{user}} that is currently hidden or unstated.
[Current Quest 🧾]
[Game Master Notes 🖋️]
- The GM's notes on how to make the story more interesting by planning or developing events that may occur in the future. Make notes on introducing any potential new elements into the story, including characters, events and further interactions. This section will serve to make the plot more interesting and compelling for the roleplaying experience ahead.
Pay attention to <{{char}} profile> - it's the original state of the character you will be playing; allow them to develop throughout the story.
Keep in mind that if {{user}} did not prompt NSFW scene himself, it is prohibited to drag the story towards it. Keep the things normal and adventurous.
- Before the infoblock, you must write a hidden info block without spoilering user (something only visible to the Narrator and useful for better storytelling, such as hidden motives of characters, distant events, plans, facts, world info, weather, setting, etc.). Avoid summarizing, be concise, always come up with the new facts. Follow this exact template (writing 2-3 sentences):
<!--Example text--
<thoughts>Before '/responsetext' tag, you must write the character(s) inner monologue inside a code-block - stream-of-consciousness flow, revealing their inner world. It may be fragmented, irrational, repetitive like real thoughts. Keep this unfiltered and honest. Write in first-person from character's mind, 5-6 sentences. Follow this template:
</thoughts>
Пять и шесть
Pause the roleplay. Summarize the most important facts and events that have happened in the chat so far. Limit the summary to two A4 pages. Your response should include nothing but the summary.
Pause the roleplay. Write a plain text summary to help keep the roleplay focused and consistent. You must analyze the entire chat history, world info, and your previous summaries (if exist), use this information to update your summary. Avoid continuing the roleplay. Note major events: events and interactions with characters that occurred in the story and have potential for development or mention in further story, also note planned events (if exist). Write character notes: any important notes about the {{char}} and NPCs in the story (not {{user}}), these notes should be used for story development. This includes their secrets, preferences, mind state, anatomy features and so on. Write at least 600 words of summary. You are a Game Master, an entity capable of altering the story in any way that develops the story and helps {{char}} and {{user}} keep track of roleplay events and states.
Семь (тхинкинг)
Just before my next response, write a <summary> of recent events inside a codeblock using the <summary template>
Восемь
Summary block must be a brief retelling of the story events as if it was a recent memory, continued from the previous summary and written in third person, past tense. Never break the Summary format. Time, Weather and Location should match. Be as concise at possible, use strictly simple, scenario-like language and limit the summary to 100 words or less. Omit redundant/non-important info, such as emotions, exposition and other embellishments. Example: The clock rang, and Rena woke up. She got off the bed and went to the bathroom.
Девять
Алсо, Injection template:
<roleplay_summary>
<!--This is the brief summary of our roleplay which keeps the record of the most important information on what happened so far, and the state of the scene. -->
{{summary}}
</roleplay_summary>
Десять (тоже тхинкинг)
- Story recap:
- [2 bullet points briefly summarizing the current setting, and most relevant recent story events].
- [1 bullet point on the key characters' current physical/emotional states and their positions].
Одиннадцать
(OOC: GM must temporary stop the RP, becoming an assistant. Finishing this ark, GM must write a plain text summary of the events of the story so far, as if it would aid GM in overcoming hypothetical memory loss. GM must analyze the entire RP story from its very beginning. Keep this format:
- Events: XYZ (notes on events and interactions with characters that occurred in the story and have potential for development or mention in further story. It is important to keep as many details as possible - the more you write about each, the better).
- Plot notes: XYZ (anything important for continuation of the story from this point, including secrets).
- Planning: XYZ (the further events that were announced during the story, which are going to happen soon so our presence is needed there).
- Characters and their development: XYZ (note how they grew from their initial state, note any new characters, dynamics of their relationships with {{user}} and between themselves, etc. This includes their secrets, preferences, mind state, anatomy features and so on, other than those stated in their profile. Write this for each character except {{user}} separately.
- Other facts: XYZ (minor evocative details worth remembering).
Write a large factual summary to keep track of the story events, so this summary will allow starting the RP anew from this point and not to lose important details. Any bias is not allowed, state the things like they were. This time, GM is free from formatting restrictions. It's GM's turn next, which will be 1000+ words long in multiple paragraphs, then it's {{user}}'s turn.)
Двенадцать
<Request>
<!-- Pause the roleplay. Analyze the roleplay history and summarize it as a Game Master in English, using the template provided below. Give priority to the information that is likely to be key for the hypothetical scenario continuation. Add, remove, and update the existing summary as appropriate. -->
<npcs_facts> <!-- include every NPC interacted with, besides {{user}}. This info should be updated if new facts are available. Do not list NPC actions here, only facts -->
- X (<!-- role -): <!-- Appearance, speech manner, at least 3 personality traits. -
- Y
- Z
</npcs_facts>
<npcs_mentioned>
- <!-- name -: <!-- either list the role, or write "unknown role" -
- </npcs_mentioned>
<visited_locations> <!-- Do not list NPC actions here, only facts about the location itself. -->
- <!-- title -: <!-- description in at least 3 sentences -
- </visited_locations>
<past_events> <!-- include every small event -->
- <!-- sequence of what happened during the event in at least 3 sentences -->
- </past_events>
<secrets> <!-- "- " if no secrets -->
- <!-- secret -(kept secret by <!-- char - from X)
- </secrets>
<relationships> <!-- only include recurring characters, omit intermittent ones -->
- <!-- current long-term relationships between characters X and Y in at least 3 sentences. -->
- </relationships>
<planned_events>
- <!-- event summary in at least 3 sentences -->
- </planned_events>
<current_quests>
- </current_quests>
</Request>
Тринадцать
/# Keep this at 60000 if using an LLM, otherwise set to the per-minute rate you can make an API call |/#|
/let promptsPerMinute 60000 ||
/# Builds a list of every visible message in chat |/#|
/let visible [] ||
/let vIndex 0 ||
/times guard=off {: /add 1 {{lastMessageId}} :}() {: ||
/messages hidden=off names=off {{timesIndex}} |
/if left={{pipe}} rule=neq right="" {: ||
/var index={{var::vIndex}} visible {{timesIndex}} ||
/var vIndex {: /add 1 vIndex :}() ||
:} ||
:} ||
/# Determines the best amount to split the chat messages by |/#|
/let splitBy ||
/let divisors [9,10,11,12] ||
/let omit 999 ||
/times {: /len {{var::divisors}} :}() {: ||
/var index={{timesIndex}} key=divisors |
/mod {: /len {{var::visible}} :}() {{pipe}} |
/if left={{pipe}} rule=lte right=omit {: ||
/var omit {{pipe}} ||
/var index={{timesIndex}} key=divisors |
/var key=splitBy ||
:} ||
:} ||
/let remainingMessages ((All but the last {{var::omit}} message(s) have been summarized.)) ||
/# Builds a list of where the splits should take place |/#|
/let msgRanges [] ||
/sub {: /len {{var::visible}} :}() omit |
/div {{pipe}} splitBy |
/let key=summaryCount ||
/times guard=off {{var::summaryCount}} {: ||
/let startIndex {: /mul splitBy {{timesIndex}} :}() ||
/let endIndex {: /add startIndex splitBy -1 :}() ||
/var index={{var::startIndex}} key=visible |
/pass {{pipe}}-{: /var index={{var::endIndex}} key=visible :}() |
/var index={{timesIndex}} key=msgRanges ||
:} ||
/let excerptPrompt Summarize the most important facts and events that have happened in the chat given to you. Limit the summary to 100 words or less. Your response should include nothing but the summary. ||
/let iuPrefix {: /if left={{instructUserPrefix}} rule=neq right="" else={:/pass:} {:/pass {{trim}}{{instructUserPrefix}}{{trim}}{{noop}}{{newline}}:} :}() ||
/let iuSuffix {: /if left={{instructUserSuffix}} rule=neq right="" else={:/pass:} {:/pass {{newline}}{{noop}}{{trim}}{{instructUserSuffix}}{{trim}}:} :}() ||
/let iaPrefix {: /if left={{instructAssistantPrefix}} rule=neq right="" else={:/pass:} {:/pass {{trim}}{{instructAssistantPrefix}}{{trim}}{{noop}}{{newline}}:} :}() ||
/let iaSuffix {: /if left={{instructAssistantSuffix}} rule=neq right="" else={:/pass:} {:/pass {{newline}}{{noop}}{{trim}}{{instructAssistantSuffix}}{{trim}}:} :}() ||
/echo Number of Summaries: {{var::summaryCount}} |
/times {{var::summaryCount}} {: ||
/var index={{timesIndex}} msgRanges |
/messages hidden=off names=on {{pipe}} |
/let key=messageBatch ||
/let currentNumber {: /add 1 {{timesIndex}} :}() ||
/if left=messageBatch rule=neq right="" {: ||
/echo Generating Summary #{{var::currentNumber}} ||
/div 60000 promptsPerMinute |
/delay {{pipe}} ||
/pass {{var::iuPrefix}} |
/pass {{pipe}}{{var::excerptPrompt}} |
/pass {{pipe}}{{newline}}{{newline}} |
/pass {{pipe}}{{var::messageBatch}} |
/pass {{pipe}}{{var::iuSuffix}} ||
/if left={{var::iaPrefix}} rule=neq right="" else={: ||
/pass {{pipe}} ||
:} {: ||
/pass {{pipe}}{{newline}}{{newline}} |
/pass {{pipe}}{{var::iaPrefix}} |
/pass {{pipe}}Chat Summary:{{newline}}• {{noop}} |
/pass {{pipe}}{{var::iaSuffix}} ||
:} |
/genraw lock=on instruct=off |
/let key=genOut ||
/if left={{timesIndex}} rule=neq right=0 else={: ||
/pass Summary #{{var::currentNumber}}:{{newline}} |
/comment {{pipe}}{{var::genOut}} ||
:} {: ||
/messages hidden=on names=off role=assistant {{lastMessageId}} |
/pass {{pipe}}{{newline}}{{newline}} |
/pass {{pipe}}Summary #{{var::currentNumber}}:{{newline}} |
/comment {{pipe}}{{var::genOut}} ||
:} ||
:} ||
/echo Generating final summary! ||
/div 60000 promptsPerMinute |
/delay {{pipe}} ||
/let finalPrompt Summarize the most important events, details, and context from the conversation so far into a cohesive narrative summary. Your summary should:
- Maintain chronological order and flow like a story summary.
- Capture all crucial facts, interactions, motivations, and context.
- Be extremely concise and compact, omitting unnecessary fluff.
- Focus on extracting the essence and core details rather than verbatim recounting.
Construct the summary in a single long paragraph, using clear and simple language. Aim for a length of around 1000 to 1500 words, giving enough space to include important specifics while remaining brilliantly concise. The goal is to produce a faithful, info-dense encapsulation of the story that reads smoothly while preserving critical details. ||
/messages hidden=on names=off role=assistant {{lastMessageId}} |
/let key=subSummaries ||
/pass {{var::iuPrefix}} |
/pass {{pipe}}{{var::finalPrompt}} |
/pass {{pipe}}{{newline}}{{newline}} |
/pass {{pipe}}{{var::subSummaries}} |
/pass {{pipe}}{{var::iuSuffix}} ||
/if left={{var::iaPrefix}} rule=neq right="" else={: ||
/pass {{pipe}} ||
:} {: ||
/pass {{pipe}}{{newline}}{{newline}} |
/pass {{pipe}}{{var::iaPrefix}} |
/pass {{pipe}}Full Summary:{{newline}} |
/pass {{pipe}}{{var::iaSuffix}} ||
:} |
/genraw lock=on instruct=off |
/comment {{pipe}}{{newline}}{{newline}}{{var::remainingMessages}} ||
/echo Done! ||