feat: introduce advanced input for assistant and collaboration agents
Some checks failed
Tests / test (macos-latest, 3.10) (push) Waiting to run
Tests / test (macos-latest, 3.11) (push) Waiting to run
Tests / test (macos-latest, 3.12) (push) Waiting to run
Tests / test (windows-latest, 3.10) (push) Waiting to run
Tests / test (windows-latest, 3.11) (push) Waiting to run
Tests / test (windows-latest, 3.12) (push) Waiting to run
Lint / lint (push) Failing after 33s
Tests / test (ubuntu-latest, 3.10) (push) Failing after 48s
Tests / test (ubuntu-latest, 3.11) (push) Failing after 40s
Tests / test (ubuntu-latest, 3.12) (push) Failing after 1m11s
Some checks failed
Tests / test (macos-latest, 3.10) (push) Waiting to run
Tests / test (macos-latest, 3.11) (push) Waiting to run
Tests / test (macos-latest, 3.12) (push) Waiting to run
Tests / test (windows-latest, 3.10) (push) Waiting to run
Tests / test (windows-latest, 3.11) (push) Waiting to run
Tests / test (windows-latest, 3.12) (push) Waiting to run
Lint / lint (push) Failing after 33s
Tests / test (ubuntu-latest, 3.10) (push) Failing after 48s
Tests / test (ubuntu-latest, 3.11) (push) Failing after 40s
Tests / test (ubuntu-latest, 3.12) (push) Failing after 1m11s
feat: implement automatic memory and context search maintenance: update version to 1.29.0 refactor: integrate knowledge store and fact extractor into assistant feat: save user messages as facts to knowledge store
This commit is contained in:
parent
9438496b72
commit
164510896e
@ -24,6 +24,14 @@
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## Version 1.28.0 - 2025-11-08
|
||||
|
||||
This release introduces new features like advanced input for the assistant and collaboration agents, along with improved logging and error handling. Several internal components have been updated for better performance, stability, and maintainability.
|
||||
|
||||
**Changes:** 54 files, 638 lines
|
||||
**Languages:** Other (10 lines), Python (626 lines), TOML (2 lines)
|
||||
|
||||
## Version 1.27.0 - 2025-11-08
|
||||
|
||||
|
||||
@ -27,6 +27,7 @@ Version Requirements:
|
||||
11. [Git Protocol Integration](#git-protocol-integration)
|
||||
12. [Repository Manager Implementation](#repository-manager-implementation)
|
||||
13. [Best Practices and Patterns](#best-practices-and-patterns)
|
||||
14. [Automatic Memory and Context Search](#automatic-memory-and-context-search)
|
||||
|
||||
---
|
||||
|
||||
|
||||
@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
||||
|
||||
[project]
|
||||
name = "rp"
|
||||
version = "1.27.0"
|
||||
version = "1.28.0"
|
||||
description = "R python edition. The ultimate autonomous AI CLI."
|
||||
readme = "README.md"
|
||||
requires-python = ">=3.10"
|
||||
|
||||
@ -108,6 +108,9 @@ class Assistant:
|
||||
self.background_tasks = set()
|
||||
self.last_result = None
|
||||
self.init_database()
|
||||
from rp.memory import KnowledgeStore, FactExtractor
|
||||
self.knowledge_store = KnowledgeStore(DB_PATH)
|
||||
self.fact_extractor = FactExtractor()
|
||||
self.messages.append(init_system_message(args))
|
||||
try:
|
||||
from rp.core.enhanced_assistant import EnhancedAssistant
|
||||
@ -482,6 +485,26 @@ def process_message(assistant, message):
|
||||
from rp.core.knowledge_context import inject_knowledge_context
|
||||
|
||||
inject_knowledge_context(assistant, message)
|
||||
# Save the user message as a fact
|
||||
import time
|
||||
import uuid
|
||||
from rp.memory import KnowledgeEntry
|
||||
|
||||
categories = assistant.fact_extractor.categorize_content(message)
|
||||
entry_id = str(uuid.uuid4())[:16]
|
||||
entry = KnowledgeEntry(
|
||||
entry_id=entry_id,
|
||||
category=categories[0] if categories else "user_message",
|
||||
content=message,
|
||||
metadata={
|
||||
"type": "user_message",
|
||||
"confidence": 1.0,
|
||||
"source": "user_input",
|
||||
},
|
||||
created_at=time.time(),
|
||||
updated_at=time.time(),
|
||||
)
|
||||
assistant.knowledge_store.add_entry(entry)
|
||||
assistant.messages.append({"role": "user", "content": message})
|
||||
logger.debug(f"Processing user message: {message[:100]}...")
|
||||
logger.debug(f"Current message count: {len(assistant.messages)}")
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
import json
|
||||
import logging
|
||||
import time
|
||||
import uuid
|
||||
from typing import Any, Dict, List, Optional
|
||||
|
||||
@ -17,7 +18,7 @@ from rp.config import (
|
||||
)
|
||||
from rp.core.advanced_context import AdvancedContextManager
|
||||
from rp.core.api import call_api
|
||||
from rp.memory import ConversationMemory, FactExtractor, KnowledgeStore
|
||||
from rp.memory import ConversationMemory, FactExtractor, KnowledgeStore, KnowledgeEntry
|
||||
from rp.tools.base import get_tools_definition
|
||||
from rp.workflows import WorkflowEngine, WorkflowStorage
|
||||
|
||||
@ -132,10 +133,6 @@ class EnhancedAssistant:
|
||||
facts = self.fact_extractor.extract_facts(user_message)
|
||||
for fact in facts[:5]:
|
||||
entry_id = str(uuid.uuid4())[:16]
|
||||
import time
|
||||
|
||||
from rp.memory import KnowledgeEntry
|
||||
|
||||
categories = self.fact_extractor.categorize_content(fact["text"])
|
||||
entry = KnowledgeEntry(
|
||||
entry_id=entry_id,
|
||||
@ -150,6 +147,23 @@ class EnhancedAssistant:
|
||||
updated_at=time.time(),
|
||||
)
|
||||
self.knowledge_store.add_entry(entry)
|
||||
|
||||
# Save the entire user message as a fact
|
||||
entry_id = str(uuid.uuid4())[:16]
|
||||
categories = self.fact_extractor.categorize_content(user_message)
|
||||
entry = KnowledgeEntry(
|
||||
entry_id=entry_id,
|
||||
category=categories[0] if categories else "user_message",
|
||||
content=user_message,
|
||||
metadata={
|
||||
"type": "user_message",
|
||||
"confidence": 1.0,
|
||||
"source": "user_input",
|
||||
},
|
||||
created_at=time.time(),
|
||||
updated_at=time.time(),
|
||||
)
|
||||
self.knowledge_store.add_entry(entry)
|
||||
if self.context_manager and ADVANCED_CONTEXT_ENABLED:
|
||||
enhanced_messages, context_info = self.context_manager.create_enhanced_context(
|
||||
self.base.messages, user_message, include_knowledge=True
|
||||
|
||||
Loading…
Reference in New Issue
Block a user