kwaroran 876130fc68 feat: Implement HypaV3 ratio-based memory (Variation of HypaV2) (#717)
# PR Checklist
- [x] Have you checked if it works normally in all models? *Ignore this
if it doesn't use models.*
- [x] Have you checked if it works normally in all web, local, and node
hosted versions? If it doesn't, have you blocked it in those versions?
- [x] Have you added type definitions?

# Preview

![preview](https://github.com/user-attachments/assets/6555534b-d798-49bf-a0d5-79148c3445b3)

# Description
Implemented HypaV3, a variation of the HypaV2 memory.

---
Key Changes:
- Ratio-based token management instead of fixed token counts
(memoryTokensRatio, extraSummarizationRatio)
- Improved memory selection with adjustable ratios
(recent/similar/random memory)
- Similar memory selection now uses parent summaries instead of
individual chunks
- Selected memories are chronologically ordered
- Control over summary units (maxChatsPerSummary)
- Added orphaned memory preservation option (preserveOrphanedMemory)

---
New Settings:
- memoryTokensRatio: Ratio of memory prompt in max context size
- extraSummarizationRatio: Extra margin ratio of max context size to
keep more free space when summarizing begins
- maxChatsPerSummary: Maximum chats per summary
- similarMemoryRatio: Ratio for similarity-based memory selection
- randomMemoryRatio: Ratio for random memory selection
- enableSimilarityCorrection: Compare chunks with both raw and
summarized version of last 3 chats for better similarity matching
- preserveOrphanedMemory: Keep summaries even when original chats are
deleted

---
Summarization Conditions:
- Start: When current tokens exceed max context size
- End: When either:
- Current tokens drop below maxContextTokens * (1 - memoryTokensRatio -
extraSummarizationRatio)
- Current tokens are within max context size and only minimum required
messages (3) remain

---
Memory Selection Process:
- Recent: Newest summaries up to recentMemoryRatio (1 -
similarMemoryRatio - randomMemoryRatio)
- Random: Unused summaries selected randomly up to randomMemoryRatio
- Similar: Unused summaries selected by similarity to last 3 messages
- Each summary is split into chunks and compared with raw recent
messages for similarity scoring
- When similarity correction enabled, also compares with summarized
version of recent messages
  - Parent summaries of the most similar chunks are selected
- Unused token space from recent and random selections is added to
similar memory's token limit

---
Key Differences from HypaV2:
- Flexible ratio-based memory management instead of absolute values
- Selects parent summaries instead of individual chunks for similar
memory
- UI shows original chat's memos linked to each summary
2025-01-12 23:59:03 +09:00
2024-12-25 22:27:48 +09:00
2024-09-06 02:45:49 +09:00
2024-10-13 01:29:12 +09:00
2024-08-12 23:48:14 +09:00
2024-10-13 01:29:12 +09:00
2024-09-10 22:09:58 +09:00
2024-09-10 22:09:58 +09:00
2025-01-06 00:30:33 +09:00
2024-12-27 05:09:32 +09:00
2025-01-06 00:30:33 +09:00
2024-10-13 01:46:57 +09:00
2024-10-25 18:11:00 +09:00

RisuAI

text

Svelte Typescript Tauri

RisuAI, or Risu for short, is a cross platform AI chatting software / web application with powerful features such as multiple API support, assets in the chat, regex functions and much more.

Screenshots

Screenshot 1 Screenshot 2
Screenshot 1 Screenshot 2
Screenshot 3 Screenshot 4

Features

  • Multiple API Supports: Supports OAI, Claude, Ooba, OpenRouter... and More!
  • Emotion Images: Display the image of the current character, according to his/her expressions!
  • Group Chats: Multiple characters in one chat.
  • Plugins: Add your features and providers, and simply share.
  • Regex Script: Modify model's output by regex, to make a custom GUI and others
  • Powerful Translators: Automatically translate the input/output, so you can roleplay without knowing model's language.
  • Lorebook: Also known as world infos or memory book, which can make character memorize more.
  • Themes: Choose it from 3 themes, Classic, WaifuLike, WaifuCut.
  • Powerful Prompting: Change the prompting order easily, Impersonate inside prompts, Use conditions, variables... and more!
  • Customizable, Friendly UI: Great Accessibility and mobile friendly
  • TTS: Use TTS to make the output text into voice.
  • Additonal Assets: Embed your images, audios and videos to bot, and make it display at chat or background!
  • And More!

You can get detailed information on https://github.com/kwaroran/RisuAI/wiki (Work in Progress)

Discord

Installation

Docker Installation

You can also run RisuAI using Docker. This method is particularly useful for web hosting.

  1. Clone the repository:

    git clone https://github.com/kwaroran/RisuAI.git
    cd RisuAI
    
  2. Build and run the Docker container:

    docker-compose up -d
    
  3. Access RisuAI at http://localhost:6001 in your web browser.

Description
No description provided
Readme 62 MiB
Languages
TypeScript 58.9%
Svelte 35.1%
JavaScript 4.4%
Rust 0.5%
Lua 0.3%
Other 0.7%