Spaces:
Sleeping
Sleeping
dylanglenister
commited on
Commit
·
e5c9fd8
1
Parent(s):
b529dd2
CHORE: Some planning notes.
Browse filesCommiting my planning notes before changing anything.
- src/core/memory_manager.py +11 -1
src/core/memory_manager.py
CHANGED
|
@@ -260,7 +260,8 @@ class MemoryManager:
|
|
| 260 |
logger().warning(f"Failed to perform LTM semantic search: {e}")
|
| 261 |
|
| 262 |
# 3. Consult knowledge base
|
| 263 |
-
|
|
|
|
| 264 |
|
| 265 |
# 4. Get current conversation context
|
| 266 |
try:
|
|
@@ -278,6 +279,15 @@ class MemoryManager:
|
|
| 278 |
|
| 279 |
# --- Private Helper Methods ---
|
| 280 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 281 |
async def _update_session_title_if_first_message(
|
| 282 |
self,
|
| 283 |
session_id: str,
|
|
|
|
| 260 |
logger().warning(f"Failed to perform LTM semantic search: {e}")
|
| 261 |
|
| 262 |
# 3. Consult knowledge base
|
| 263 |
+
info = self._consult_knowledge_base(question=question)
|
| 264 |
+
context_parts.append(info)
|
| 265 |
|
| 266 |
# 4. Get current conversation context
|
| 267 |
try:
|
|
|
|
| 279 |
|
| 280 |
# --- Private Helper Methods ---
|
| 281 |
|
| 282 |
+
def _consult_knowledge_base(self, question: str) -> str:
|
| 283 |
+
# 1. Embedding
|
| 284 |
+
# Cannot use src/utils/embeddings.py because it uses sentence transformers while the knowledge base uses torch for embedding.
|
| 285 |
+
# 2. Query
|
| 286 |
+
# Use src/data/repositories/information.py to access the knowledge base stored on mongodb.
|
| 287 |
+
# 3. Reponse
|
| 288 |
+
# The result will need to be semanticly ranked. Suggested: https://build.nvidia.com/nvidia/rerank-qa-mistral-4b
|
| 289 |
+
return ""
|
| 290 |
+
|
| 291 |
async def _update_session_title_if_first_message(
|
| 292 |
self,
|
| 293 |
session_id: str,
|