mem-llm 1.0.4__tar.gz → 1.0.5__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of mem-llm might be problematic. Click here for more details.
- {mem_llm-1.0.4/mem_llm.egg-info → mem_llm-1.0.5}/PKG-INFO +1 -1
- {mem_llm-1.0.4 → mem_llm-1.0.5}/mem_llm/__init__.py +1 -1
- {mem_llm-1.0.4 → mem_llm-1.0.5}/mem_llm/memory_db.py +33 -7
- {mem_llm-1.0.4 → mem_llm-1.0.5/mem_llm.egg-info}/PKG-INFO +1 -1
- {mem_llm-1.0.4 → mem_llm-1.0.5}/setup.py +1 -1
- {mem_llm-1.0.4 → mem_llm-1.0.5}/CHANGELOG.md +0 -0
- {mem_llm-1.0.4 → mem_llm-1.0.5}/INTEGRATION_GUIDE.md +0 -0
- {mem_llm-1.0.4 → mem_llm-1.0.5}/MANIFEST.in +0 -0
- {mem_llm-1.0.4 → mem_llm-1.0.5}/QUICKSTART.md +0 -0
- {mem_llm-1.0.4 → mem_llm-1.0.5}/QUICKSTART_TR.md +0 -0
- {mem_llm-1.0.4 → mem_llm-1.0.5}/README.md +0 -0
- {mem_llm-1.0.4 → mem_llm-1.0.5}/STRUCTURE.md +0 -0
- {mem_llm-1.0.4 → mem_llm-1.0.5}/docs/CONFIG_GUIDE.md +0 -0
- {mem_llm-1.0.4 → mem_llm-1.0.5}/docs/INDEX.md +0 -0
- {mem_llm-1.0.4 → mem_llm-1.0.5}/docs/README.md +0 -0
- {mem_llm-1.0.4 → mem_llm-1.0.5}/mem_llm/config.yaml.example +0 -0
- {mem_llm-1.0.4 → mem_llm-1.0.5}/mem_llm/config_from_docs.py +0 -0
- {mem_llm-1.0.4 → mem_llm-1.0.5}/mem_llm/config_manager.py +0 -0
- {mem_llm-1.0.4 → mem_llm-1.0.5}/mem_llm/knowledge_loader.py +0 -0
- {mem_llm-1.0.4 → mem_llm-1.0.5}/mem_llm/llm_client.py +0 -0
- {mem_llm-1.0.4 → mem_llm-1.0.5}/mem_llm/mem_agent.py +0 -0
- {mem_llm-1.0.4 → mem_llm-1.0.5}/mem_llm/memory_manager.py +0 -0
- {mem_llm-1.0.4 → mem_llm-1.0.5}/mem_llm/memory_tools.py +0 -0
- {mem_llm-1.0.4 → mem_llm-1.0.5}/mem_llm/prompt_templates.py +0 -0
- {mem_llm-1.0.4 → mem_llm-1.0.5}/mem_llm.egg-info/SOURCES.txt +0 -0
- {mem_llm-1.0.4 → mem_llm-1.0.5}/mem_llm.egg-info/dependency_links.txt +0 -0
- {mem_llm-1.0.4 → mem_llm-1.0.5}/mem_llm.egg-info/requires.txt +0 -0
- {mem_llm-1.0.4 → mem_llm-1.0.5}/mem_llm.egg-info/top_level.txt +0 -0
- {mem_llm-1.0.4 → mem_llm-1.0.5}/requirements.txt +0 -0
- {mem_llm-1.0.4 → mem_llm-1.0.5}/setup.cfg +0 -0
- {mem_llm-1.0.4 → mem_llm-1.0.5}/tests/test_integration.py +0 -0
- {mem_llm-1.0.4 → mem_llm-1.0.5}/tests/test_llm_client.py +0 -0
- {mem_llm-1.0.4 → mem_llm-1.0.5}/tests/test_mem_agent.py +0 -0
- {mem_llm-1.0.4 → mem_llm-1.0.5}/tests/test_memory_manager.py +0 -0
- {mem_llm-1.0.4 → mem_llm-1.0.5}/tests/test_memory_tools.py +0 -0
|
@@ -295,7 +295,7 @@ class SQLMemoryManager:
|
|
|
295
295
|
def search_knowledge(self, query: str, category: Optional[str] = None,
|
|
296
296
|
limit: int = 5) -> List[Dict]:
|
|
297
297
|
"""
|
|
298
|
-
Bilgi bankasında arama yapar
|
|
298
|
+
Bilgi bankasında arama yapar (gelişmiş keyword matching)
|
|
299
299
|
|
|
300
300
|
Args:
|
|
301
301
|
query: Arama sorgusu
|
|
@@ -307,25 +307,51 @@ class SQLMemoryManager:
|
|
|
307
307
|
"""
|
|
308
308
|
cursor = self.conn.cursor()
|
|
309
309
|
|
|
310
|
+
# Extract important keywords from query (remove question words)
|
|
311
|
+
import re
|
|
312
|
+
stopwords = ['ne', 'kadar', 'nedir', 'nasıl', 'için', 'mı', 'mi', 'mu', 'mü',
|
|
313
|
+
'what', 'how', 'when', 'where', 'is', 'are', 'the', 'a', 'an']
|
|
314
|
+
|
|
315
|
+
# Clean query and extract keywords
|
|
316
|
+
query_lower = query.lower()
|
|
317
|
+
words = re.findall(r'\w+', query_lower)
|
|
318
|
+
keywords = [w for w in words if w not in stopwords and len(w) > 2]
|
|
319
|
+
|
|
320
|
+
# If no keywords, use original query
|
|
321
|
+
if not keywords:
|
|
322
|
+
keywords = [query_lower]
|
|
323
|
+
|
|
324
|
+
# Build search conditions for each keyword
|
|
325
|
+
conditions = []
|
|
326
|
+
params = []
|
|
327
|
+
|
|
328
|
+
for keyword in keywords[:5]: # Max 5 keywords
|
|
329
|
+
conditions.append("(question LIKE ? OR answer LIKE ? OR keywords LIKE ?)")
|
|
330
|
+
params.extend([f"%{keyword}%", f"%{keyword}%", f"%{keyword}%"])
|
|
331
|
+
|
|
332
|
+
where_clause = " OR ".join(conditions) if conditions else "1=1"
|
|
333
|
+
|
|
310
334
|
if category:
|
|
311
|
-
|
|
335
|
+
sql = f"""
|
|
312
336
|
SELECT category, question, answer, priority
|
|
313
337
|
FROM knowledge_base
|
|
314
338
|
WHERE active = 1
|
|
315
339
|
AND category = ?
|
|
316
|
-
AND (
|
|
340
|
+
AND ({where_clause})
|
|
317
341
|
ORDER BY priority DESC, id DESC
|
|
318
342
|
LIMIT ?
|
|
319
|
-
"""
|
|
343
|
+
"""
|
|
344
|
+
cursor.execute(sql, [category] + params + [limit])
|
|
320
345
|
else:
|
|
321
|
-
|
|
346
|
+
sql = f"""
|
|
322
347
|
SELECT category, question, answer, priority
|
|
323
348
|
FROM knowledge_base
|
|
324
349
|
WHERE active = 1
|
|
325
|
-
AND (
|
|
350
|
+
AND ({where_clause})
|
|
326
351
|
ORDER BY priority DESC, id DESC
|
|
327
352
|
LIMIT ?
|
|
328
|
-
"""
|
|
353
|
+
"""
|
|
354
|
+
cursor.execute(sql, params + [limit])
|
|
329
355
|
|
|
330
356
|
return [dict(row) for row in cursor.fetchall()]
|
|
331
357
|
|
|
@@ -11,7 +11,7 @@ long_description = (this_directory / "README.md").read_text(encoding='utf-8')
|
|
|
11
11
|
|
|
12
12
|
setup(
|
|
13
13
|
name="mem-llm",
|
|
14
|
-
version="1.0.
|
|
14
|
+
version="1.0.5",
|
|
15
15
|
author="C. Emre Karataş",
|
|
16
16
|
author_email="karatasqemre@gmail.com", # PyPI için gerekli - kendi emailinizi yazın
|
|
17
17
|
description="Memory-enabled AI assistant with local LLM support",
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|