Made a new web search system, instead of relying on keywords, AI questions itself if it wants to research

This commit is contained in:
Luna
2026-03-01 12:48:20 +01:00
parent 610ca9970b
commit ec9553a817
2 changed files with 90 additions and 6 deletions

View File

@@ -6,6 +6,9 @@ Nova is a friendly, slightly witty Discord companion that chats naturally in DMs
- Conversational replies in DMs automatically; replies in servers when mentioned or in a pinned channel.
- Chat model (defaults to `meta-llama/llama-3-8b-instruct` when using OpenRouter) for dialogue and a low-cost embedding model (`nvidia/llama-nemotron-embed-vl-1b-v2` by default). OpenAI keys/models may be used as a fallback.
- Short-term, long-term, and summarized memory layers with cosine-similarity retrieval.
- **Rotating “daily mood” engine** that adjusts Novas personality each day (calm, goblin, philosopher, etc.). Mood influences emoji use, sarcasm, response length, and hype.
- **Smarter liveintel web search**: Nova now tries to detect when youre discussing a specific topic (games, movies, propernouns) and will automatically Google it to enrich context. Its not triggered by every message, just enough to catch “outside” topics.
- Automatic memory pruning, importance scoring, and transcript summarization when chats grow long.
- Local SQLite memory file (no extra infrastructure) powered by `sql.js`, plus graceful retries for the model API (OpenRouter/OpenAI).
- Optional "miss u" pings that DM your coder at random intervals (06h) when `CODER_USER_ID` is set.
@@ -83,7 +86,8 @@ Nova is a friendly, slightly witty Discord companion that chats naturally in DMs
## Conversation Flow
1. Incoming message triggers only if it is a DM, mentions the bot, or appears in the configured channel.
2. The user turn is appended to short-term memory immediately.
3. The memory engine retrieves relevant long-term memories and summary text.
3. The memory engine also factors in todays “mood” directive (e.g. calm, goblin, philosopher) when building the prompt, so the bots style changes daily.
4. The memory engine retrieves relevant long-term memories and summary text.
4. A compact system prompt injects personality, summary, and relevant memories before passing short-term history to the model API (OpenRouter/OpenAI).
5. The reply is sent back to Discord. If Nova wants to send a burst of thoughts, she emits the `<SPLIT>` token and the runtime fans it out into multiple sequential Discord messages.
6. Long chats automatically summarize; low-value memories eventually get pruned.