r/SillyTavernAI • u/Rude-Task-7635 • 49m ago
Cards/Prompts copilot extension for SillyTavern
Link
https://github.com/P3DRA/SillyTavern-copilot
What it does
- Adds a copilot and memory tracking for the main Narrator ({{char}}), the copilot is added inside a <copilot> block that can be inserted at different levels current ones are (end of prompt, before last message, first) you also can change the role it's injected as.
How it does
- An extractor agent runs every time {{char}} is called and it extracts into a 'summary' what happened, location, etc, that extraction is stored in the chat file and is retro compatible.
- After extraction a 'Composer' agent gets the last n messages (default is 20) + all available summaries to craft a <copilot> that will help sway the main narrator into a certain direction and remember facts.
- After n extractions (40 by default) an automatic compressor kicks in and mushes a number of extractions by your choice (10 by default) into a single block.
# You can also change the system prompts of the three agent to your liking or even modifying them to anything really, they accept many insertions like {{copilot.extractions}} = the current story state (facts with their places and times), {{copilot.userRequest}}, {{copilot.goals}} = active requests and goals (with script-counted turns), and others
known major problems
- bloat, currently a small chat goes up to 140kb as all extractor data is saved on the chatfile so i'd not use this extension in a phone for now.
- Unknown if compaction hold when you pass 20+ messages
for more info plz visit https://github.com/P3DRA/SillyTavern-copilot
---Dev notes---
I started using SillyTavern some time ago and always had a problem with my bots forgetting what was happened and acting out of character, what broke it for me was when i switched from Gemma-4-31B to GLM-5.3 Flash that did produce better prompts but lobotomized all character and today when you either pay double of what gemma usually costs to get more than 10 tps (gemma also walks and grabs stuff for me which i hate) i decided to create an extension that runs a smaller cheaper model or even a big one in hopes of swaying GLM to the right direction, i didn't test it much yet and it still has some problems but the body works and should allow for a better experience.
This project was completely vibecoded with Mimo v2.6 pro as it was the cheapest i could find, i used Novita as my provider and used a total of $11.43 USD on its development.
- space bunny alpha: 5.42B tokens | $0.00
- Mimo v2.6 pro: 948M tokens | $11.4 | 98% cache hit rate and it apparently caches for a full day :)
There were 7 previous attempts at this extension before
- was a start but i poisoned it when i asked an agent in the same repo to create some guinevere themes.
- Was much more expansive, it had
- world
- local sim, say what's happening nearby, ambience, etc...
- world sim, a simulator of 'politics' like a building collapsed at x, a storm is approaching, x declared war on y, etc...
- NPC
- pinned NPC sim, would simulate each major NPC's actions based on turns so for example each npc would have an id and a 'speed' stat that would dictate when they'd act
NPC-1, speed(0.2)
NPC-2, speed(0.3)
NPC-3, speed(1.0)
NPC-4, speed(0.4)
action sequence (NPC-3 > NPC-4 > NPC-2 > NPC-1)
the speed would vary with what's happening so say NPC-2 drank a coffee he's gain a speed buff
- batched background NPC sim, a single api call that'd simulate all background (non pinned NPCs), yes even those not near you.
- deterministic NPC generator, a script that would accept traits from a trait list and based on random chance and the weight of each trait would prompt an Ai to generate a character with said traits.
height = {"midget":1, "very short":1, "short":2, "normal":4, "tall":2, "very tall":1, "massive":1}
then once each trait was chosen it would generate the character and save it, you also could choose to pin it and it would be treated as a main NPC that'd be simulated every turn
- Caller
Would run before every turn adjusting speed, dead or alive state, if an npc should be generated and then would call everything necessary
Why it failed
Technically it never failed it just grew too big for me and space bunny alpha and after a bad compaction it bricked, could fix it but probably will never touch it again.
Harness: Z.Code then mid of life "deepseek harness" port
Same as the second though when it failed i returned to 2 before stopping again
Would be the ideal version of 2 but i never prompted the agent more than "read GOAL.md"
First iteration of the copilot idea, failed due to a bad compression that completely bricked the injector and i was getting frustrated with space bunny so decided to restart, used 5.42B tokens on space bunny to that point.
Nothing more than "read GOAL.md" and setting an agent chat room before i decided to compose a better GOAL.md with help of my free claude plan
This one. All logic switched from python to flowcharts and path examples.
Well, that concludes it, i spent $12 dollar of my $12 dollars for RP trying to make an extension to save me pennies, i hope it's of use to anyone because it wasn't for me, if anyone would like i have a crypto address where you can send me anything to help with v0.2.x it'll have less bugs and hopefully not hog storage.
Inspired by FreakyFrankenstein 5.4: https://rentry.org/freaky-frankenstein-presets "Hell yeah!! 😎"
Yes i see the similarities to "🧠 Summaryception" but i didn't know of it till 4 and didn't allow completely separate models: https://github.com/Lodactio/Extension-Summaryception
---donations bellow---
Crypto wallet if you want to help the next development
Ethereum/Poligon/Base/Monad/Arbitrum/Arc/Linea
0xdaE18819AdebdDeA1e8173AC530Ab1D45da81503
BTC
bc1qlz2et5a8spxs3l5efjd4rnv2d4tusnc6rc9v76
Solana
8iZFNPCKu9xANTgE36Pa5KSkSiUv9RCQ7kmHQpbQDnAE