Self-evolving Context Database for AI Agents. Unify Agent Memory, Knowledge RAG and Skills.
Python agent-contextagent-memoryagent-pluginsagentic-ragcontext-databasedsh-pluginknowledge-basememorymemory-managementself-evolvingvector-database
fix(bot): fix Telegram channel init crash and empty content for Claude (#421)
ponsde791fa3c428c1
diff --git a/bot/vikingbot/agent/context.py b/bot/vikingbot/agent/context.pyindex 23684b96c..83a9a44cb 100644--- a/bot/vikingbot/agent/context.py+++ b/bot/vikingbot/agent/context.py@@ -6,8 +6,6 @@ import platformfrom pathlib import Pathfrom typing import Any-from loguru import logger-from vikingbot.agent.memory import MemoryStorefrom vikingbot.agent.skills import SkillsLoaderfrom vikingbot.config.schema import SessionKey@@ -89,7 +87,7 @@ class ContextBuilder:if self.sandbox_manager:sandbox_cwd = await self.sandbox_manager.get_sandbox_cwd(session_key)parts.append(- f"## Sandbox Environment\nYou are running in a sandboxed environment. All file operations and command execution are restricted to the sandbox directory.\nThe sandbox root directory is `{sandbox_cwd}` (use relative paths for all operations)."+ f"## Sandbox Environment\n\nYou are running in a sandboxed environment. All file operations and command execution are restricted to the sandbox directory.\nThe sandbox root directory is `{sandbox_cwd}` (use relative paths for all operations).")# Add session context@@ -150,8 +148,8 @@ Skills with available="false" need dependencies installed first - you can try inasync def _get_identity(self, session_key: SessionKey) -> str:"""Get the core identity section."""- from datetime import datetimeimport time as _time+ from datetime import datetimenow = datetime.now().strftime("%Y-%m-%d %H:%M (%A)")tz = _time.strftime("%Z") or "UTC"@@ -166,6 +164,7 @@ Skills with available="false" need dependencies installed first - you can try inworkspace_display = workspace_pathreturn f"""# vikingbot 🐈+You are VikingBot, an AI assistant built based on the OpenViking context database.When acquiring information, data, and knowledge, you **prioritize using openviking tools to read and search OpenViking (a context database) above all other sources**.You have access to tools that allow you to:@@ -307,7 +306,10 @@ Always be helpful, accurate, and concise. When using tools, think step by step:Returns:Updated message list."""- msg: dict[str, Any] = {"role": "assistant", "content": content or ""}+ msg: dict[str, Any] = {"role": "assistant"}++ if content:+ msg["content"] = contentif tool_calls:msg["tool_calls"] = tool_calls