arkaos 2.2.0 → 2.2.1
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.
package/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
2.2.
|
|
1
|
+
2.2.1
|
|
Binary file
|
package/core/knowledge/ingest.py
CHANGED
|
@@ -106,16 +106,30 @@ class IngestEngine:
|
|
|
106
106
|
# Chunk and index
|
|
107
107
|
progress(75, "Chunking content...")
|
|
108
108
|
chunks = chunk_markdown(text, max_tokens=512, source=source)
|
|
109
|
+
total_chunks = len(chunks)
|
|
109
110
|
|
|
110
|
-
|
|
111
|
+
if total_chunks == 0:
|
|
112
|
+
progress(100, "No chunks to index")
|
|
113
|
+
return IngestResult(source=source, source_type=source_type, text_length=len(text), chunks_created=0, title=title, success=True)
|
|
114
|
+
|
|
115
|
+
# Index in batches with granular progress (85→99%)
|
|
111
116
|
texts = [c.text for c in chunks]
|
|
112
117
|
headings = [c.heading for c in chunks]
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
118
|
+
batch_size = 10
|
|
119
|
+
count = 0
|
|
120
|
+
|
|
121
|
+
for i in range(0, total_chunks, batch_size):
|
|
122
|
+
batch_end = min(i + batch_size, total_chunks)
|
|
123
|
+
pct = 85 + int((i / total_chunks) * 14)
|
|
124
|
+
progress(pct, f"Embedding & indexing chunks {i + 1}—{batch_end} of {total_chunks}...")
|
|
125
|
+
|
|
126
|
+
batch_count = self._store.index_chunks(
|
|
127
|
+
texts=texts[i:batch_end],
|
|
128
|
+
headings=headings[i:batch_end] if headings else None,
|
|
129
|
+
source=source,
|
|
130
|
+
metadata={"type": source_type, "title": title, **(metadata or {})},
|
|
131
|
+
)
|
|
132
|
+
count += batch_count
|
|
119
133
|
|
|
120
134
|
progress(100, f"Done — {count} chunks indexed")
|
|
121
135
|
|
package/package.json
CHANGED