trace-memory 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.
- {trace_memory-1.0.4/trace_memory.egg-info → trace_memory-1.0.5}/PKG-INFO +17 -7
- {trace_memory-1.0.4 → trace_memory-1.0.5}/README.md +16 -6
- {trace_memory-1.0.4 → trace_memory-1.0.5}/pyproject.toml +1 -1
- {trace_memory-1.0.4 → trace_memory-1.0.5}/trace_memory/prompt_synthesizer.py +2 -2
- {trace_memory-1.0.4 → trace_memory-1.0.5}/trace_memory/vector_db.py +1 -1
- {trace_memory-1.0.4 → trace_memory-1.0.5/trace_memory.egg-info}/PKG-INFO +17 -7
- {trace_memory-1.0.4 → trace_memory-1.0.5}/LICENSE +0 -0
- {trace_memory-1.0.4 → trace_memory-1.0.5}/NOTICE +0 -0
- {trace_memory-1.0.4 → trace_memory-1.0.5}/setup.cfg +0 -0
- {trace_memory-1.0.4 → trace_memory-1.0.5}/trace_memory/__init__.py +0 -0
- {trace_memory-1.0.4 → trace_memory-1.0.5}/trace_memory/_llm_utils.py +0 -0
- {trace_memory-1.0.4 → trace_memory-1.0.5}/trace_memory/ctree.py +0 -0
- {trace_memory-1.0.4 → trace_memory-1.0.5}/trace_memory.egg-info/SOURCES.txt +0 -0
- {trace_memory-1.0.4 → trace_memory-1.0.5}/trace_memory.egg-info/dependency_links.txt +0 -0
- {trace_memory-1.0.4 → trace_memory-1.0.5}/trace_memory.egg-info/requires.txt +0 -0
- {trace_memory-1.0.4 → trace_memory-1.0.5}/trace_memory.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: trace-memory
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.5
|
|
4
4
|
Summary: TRACE — Temporal Retrieval And Context Engine: self-healing hierarchical memory for LLM agents.
|
|
5
5
|
License: Apache-2.0
|
|
6
6
|
Project-URL: Homepage, https://github.com/husain34/TRACE
|
|
@@ -641,15 +641,25 @@ tree = CTree(api_key="sk-...", model="gpt-4o-mini")
|
|
|
641
641
|
|
|
642
642
|
### 7.3 With NVIDIA NIM / any OpenAI-compatible endpoint
|
|
643
643
|
|
|
644
|
-
|
|
645
|
-
import os
|
|
646
|
-
os.environ["OPENAI_BASE_URL"] = "https://integrate.api.nvidia.com/v1"
|
|
647
|
-
os.environ["OPENAI_API_KEY"] = "nvapi-..."
|
|
644
|
+
Point the `base_url` to your endpoint.
|
|
648
645
|
|
|
649
|
-
|
|
650
|
-
tree = CTree(
|
|
646
|
+
```python
|
|
647
|
+
tree = CTree(
|
|
648
|
+
api_key="your-nvidia-api-key",
|
|
649
|
+
base_url="https://integrate.api.nvidia.com/v1",
|
|
650
|
+
model="meta/llama-3.1-8b-instruct"
|
|
651
|
+
)
|
|
651
652
|
```
|
|
652
653
|
|
|
654
|
+
### 7.4 Best Practices for LLM Selection
|
|
655
|
+
|
|
656
|
+
**Do not use "Reasoning" models (DeepSeek R1, Claude 3.7 Sonnet thinking mode, o1) for the internal `CTree` engine.**
|
|
657
|
+
|
|
658
|
+
When `CTree` runs in the background, it performs simple, deterministic classification tasks (e.g., naming a topic in 3 words, or extracting a JSON boolean). Reasoning models are built for complex logic and will waste massive amounts of compute "thinking" about simple tasks. Worse, reasoning models often exceed TRACE's strict internal token limits (`max_tokens=50` or `200`) designed to keep background operations fast, causing the LLM to get cut off mid-thought and breaking the internal JSON parsers.
|
|
659
|
+
|
|
660
|
+
* **For the `CTree` internal model:** Always use a fast, standard model (e.g., `gpt-4o-mini`, `meta-llama-3.1-8b-instruct`).
|
|
661
|
+
* **For your actual chat application:** You can (and should!) use whatever massive reasoning model you prefer to generate the final response to the user. TRACE is completely decoupled from your front-end chat completion.
|
|
662
|
+
|
|
653
663
|
---
|
|
654
664
|
|
|
655
665
|
## 8. Edge-Case Stress Tests & Validation
|
|
@@ -612,15 +612,25 @@ tree = CTree(api_key="sk-...", model="gpt-4o-mini")
|
|
|
612
612
|
|
|
613
613
|
### 7.3 With NVIDIA NIM / any OpenAI-compatible endpoint
|
|
614
614
|
|
|
615
|
-
|
|
616
|
-
import os
|
|
617
|
-
os.environ["OPENAI_BASE_URL"] = "https://integrate.api.nvidia.com/v1"
|
|
618
|
-
os.environ["OPENAI_API_KEY"] = "nvapi-..."
|
|
615
|
+
Point the `base_url` to your endpoint.
|
|
619
616
|
|
|
620
|
-
|
|
621
|
-
tree = CTree(
|
|
617
|
+
```python
|
|
618
|
+
tree = CTree(
|
|
619
|
+
api_key="your-nvidia-api-key",
|
|
620
|
+
base_url="https://integrate.api.nvidia.com/v1",
|
|
621
|
+
model="meta/llama-3.1-8b-instruct"
|
|
622
|
+
)
|
|
622
623
|
```
|
|
623
624
|
|
|
625
|
+
### 7.4 Best Practices for LLM Selection
|
|
626
|
+
|
|
627
|
+
**Do not use "Reasoning" models (DeepSeek R1, Claude 3.7 Sonnet thinking mode, o1) for the internal `CTree` engine.**
|
|
628
|
+
|
|
629
|
+
When `CTree` runs in the background, it performs simple, deterministic classification tasks (e.g., naming a topic in 3 words, or extracting a JSON boolean). Reasoning models are built for complex logic and will waste massive amounts of compute "thinking" about simple tasks. Worse, reasoning models often exceed TRACE's strict internal token limits (`max_tokens=50` or `200`) designed to keep background operations fast, causing the LLM to get cut off mid-thought and breaking the internal JSON parsers.
|
|
630
|
+
|
|
631
|
+
* **For the `CTree` internal model:** Always use a fast, standard model (e.g., `gpt-4o-mini`, `meta-llama-3.1-8b-instruct`).
|
|
632
|
+
* **For your actual chat application:** You can (and should!) use whatever massive reasoning model you prefer to generate the final response to the user. TRACE is completely decoupled from your front-end chat completion.
|
|
633
|
+
|
|
624
634
|
---
|
|
625
635
|
|
|
626
636
|
## 8. Edge-Case Stress Tests & Validation
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "trace-memory"
|
|
7
|
-
version = "1.0.
|
|
7
|
+
version = "1.0.5"
|
|
8
8
|
description = "TRACE — Temporal Retrieval And Context Engine: self-healing hierarchical memory for LLM agents."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
license = { text = "Apache-2.0" }
|
|
@@ -159,8 +159,8 @@ class PromptSynthesizer:
|
|
|
159
159
|
query_vector: list,
|
|
160
160
|
active_node,
|
|
161
161
|
recent_messages: list,
|
|
162
|
-
top_k_history: int =
|
|
163
|
-
min_history_similarity: float = 0.
|
|
162
|
+
top_k_history: int = 5,
|
|
163
|
+
min_history_similarity: float = 0.25,
|
|
164
164
|
) -> str:
|
|
165
165
|
"""
|
|
166
166
|
Assemble the full enriched system prompt for the next LLM turn.
|
|
@@ -94,7 +94,7 @@ class VectorDatabase:
|
|
|
94
94
|
|
|
95
95
|
|
|
96
96
|
|
|
97
|
-
def search_conversation(self, query_vector, top_k=
|
|
97
|
+
def search_conversation(self, query_vector, top_k=5, min_similarity=0.25):
|
|
98
98
|
if not query_vector:
|
|
99
99
|
return []
|
|
100
100
|
conn = sqlite3.connect(self.db_path)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: trace-memory
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.5
|
|
4
4
|
Summary: TRACE — Temporal Retrieval And Context Engine: self-healing hierarchical memory for LLM agents.
|
|
5
5
|
License: Apache-2.0
|
|
6
6
|
Project-URL: Homepage, https://github.com/husain34/TRACE
|
|
@@ -641,15 +641,25 @@ tree = CTree(api_key="sk-...", model="gpt-4o-mini")
|
|
|
641
641
|
|
|
642
642
|
### 7.3 With NVIDIA NIM / any OpenAI-compatible endpoint
|
|
643
643
|
|
|
644
|
-
|
|
645
|
-
import os
|
|
646
|
-
os.environ["OPENAI_BASE_URL"] = "https://integrate.api.nvidia.com/v1"
|
|
647
|
-
os.environ["OPENAI_API_KEY"] = "nvapi-..."
|
|
644
|
+
Point the `base_url` to your endpoint.
|
|
648
645
|
|
|
649
|
-
|
|
650
|
-
tree = CTree(
|
|
646
|
+
```python
|
|
647
|
+
tree = CTree(
|
|
648
|
+
api_key="your-nvidia-api-key",
|
|
649
|
+
base_url="https://integrate.api.nvidia.com/v1",
|
|
650
|
+
model="meta/llama-3.1-8b-instruct"
|
|
651
|
+
)
|
|
651
652
|
```
|
|
652
653
|
|
|
654
|
+
### 7.4 Best Practices for LLM Selection
|
|
655
|
+
|
|
656
|
+
**Do not use "Reasoning" models (DeepSeek R1, Claude 3.7 Sonnet thinking mode, o1) for the internal `CTree` engine.**
|
|
657
|
+
|
|
658
|
+
When `CTree` runs in the background, it performs simple, deterministic classification tasks (e.g., naming a topic in 3 words, or extracting a JSON boolean). Reasoning models are built for complex logic and will waste massive amounts of compute "thinking" about simple tasks. Worse, reasoning models often exceed TRACE's strict internal token limits (`max_tokens=50` or `200`) designed to keep background operations fast, causing the LLM to get cut off mid-thought and breaking the internal JSON parsers.
|
|
659
|
+
|
|
660
|
+
* **For the `CTree` internal model:** Always use a fast, standard model (e.g., `gpt-4o-mini`, `meta-llama-3.1-8b-instruct`).
|
|
661
|
+
* **For your actual chat application:** You can (and should!) use whatever massive reasoning model you prefer to generate the final response to the user. TRACE is completely decoupled from your front-end chat completion.
|
|
662
|
+
|
|
653
663
|
---
|
|
654
664
|
|
|
655
665
|
## 8. Edge-Case Stress Tests & Validation
|
|
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
|