@eidentic/rag 0.1.1 → 0.1.3
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/README.md +15 -17
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -22,23 +22,21 @@ pnpm add pdf-parse
|
|
|
22
22
|
import { ingestDocument, loadMarkdown, chunkText } from "@eidentic/rag";
|
|
23
23
|
import { Memory } from "@eidentic/memory";
|
|
24
24
|
|
|
25
|
-
// Ingest a URL directly into agent memory
|
|
26
|
-
await ingestDocument(
|
|
27
|
-
|
|
28
|
-
memory,
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
scope: { userId: "u-1" },
|
|
41
|
-
});
|
|
25
|
+
// Ingest a URL directly into agent memory (source first, options second)
|
|
26
|
+
await ingestDocument(
|
|
27
|
+
{ url: "https://docs.example.com/guide" },
|
|
28
|
+
{ memory, scope: { userId: "u-1" } },
|
|
29
|
+
);
|
|
30
|
+
|
|
31
|
+
// Or ingest pre-loaded typed content — type is "markdown" | "html" | "pdf"
|
|
32
|
+
await ingestDocument(
|
|
33
|
+
{ type: "markdown", data: "# My Doc\n\nHello.", source: "my-doc" },
|
|
34
|
+
{ memory, scope: { userId: "u-1" } },
|
|
35
|
+
);
|
|
36
|
+
|
|
37
|
+
// Or load and chunk manually (loadMarkdown takes the content string)
|
|
38
|
+
const doc = loadMarkdown("# My Doc\n\nHello.");
|
|
39
|
+
const chunks = chunkText(doc.text, { size: 512, overlap: 64 });
|
|
42
40
|
```
|
|
43
41
|
|
|
44
42
|
## Links
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eidentic/rag",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"publishConfig": {
|
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
],
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"node-html-parser": "^7.1.0",
|
|
32
|
-
"@eidentic/
|
|
33
|
-
"@eidentic/
|
|
32
|
+
"@eidentic/tools": "0.1.3",
|
|
33
|
+
"@eidentic/types": "0.2.0"
|
|
34
34
|
},
|
|
35
35
|
"peerDependencies": {
|
|
36
36
|
"pdf-parse": "^1.1.1"
|