@eidentic/rag 0.1.2 → 0.1.4

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.
Files changed (2) hide show
  1. package/README.md +15 -17
  2. 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
- source: { type: "url", url: "https://docs.example.com/guide" },
28
- memory,
29
- scope: { userId: "u-1" },
30
- });
31
-
32
- // Or load and chunk manually
33
- const doc = await loadMarkdown({ path: "./docs/guide.md" });
34
- const chunks = chunkText(doc.text, { chunkSize: 512, overlap: 64 });
35
-
36
- // Or ingest typed content
37
- await ingestDocument({
38
- source: { type: "text", text: "...", mimeType: "text/plain", title: "My Doc" },
39
- memory,
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: { kind: "user", agentId: "my-agent", 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: { kind: "user", agentId: "my-agent", 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.2",
3
+ "version": "0.1.4",
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/tools": "0.1.2",
33
- "@eidentic/types": "0.2.0"
32
+ "@eidentic/types": "0.2.1",
33
+ "@eidentic/tools": "0.1.4"
34
34
  },
35
35
  "peerDependencies": {
36
36
  "pdf-parse": "^1.1.1"