@danielzfliu/memory 1.0.0 → 1.0.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/README.md CHANGED
@@ -1,3 +1,5 @@
1
+ [![npm version](https://img.shields.io/npm/v/@danielzfliu/memory.svg)](https://www.npmjs.com/package/@danielzfliu/memory)
2
+
1
3
  # Memory
2
4
  A fully local Node.js library and REST API for storing, searching, and querying tagged text pieces using ChromaDB for vector storage and Ollama for embeddings + generation.
3
5
 
@@ -8,46 +10,45 @@ A fully local Node.js library and REST API for storing, searching, and querying
8
10
  - **ChromaDB** server running locally
9
11
 
10
12
  ### Start Ollama & pull models
11
-
13
+ To pull models, run:
12
14
  ```bash
13
15
  ollama pull nomic-embed-text-v2-moe
14
16
  ollama pull llama3.2
15
- npm run ollama
16
17
  ```
17
18
 
18
- or on a specific port:
19
-
19
+ If used as api:
20
20
  ```bash
21
+ npm run ollama # or
21
22
  npm run ollama:port 11435
22
23
  ```
23
24
 
24
- ### Start ChromaDB
25
+ If used as a npm package:
25
26
  ```bash
26
- npm run db
27
+ ollama serve
27
28
  ```
28
29
 
29
- or on a specific port:
30
-
30
+ ### Start ChromaDB
31
+ If used as api:
31
32
  ```bash
33
+ npm run db # or
32
34
  npm run db:port 9000
33
35
  ```
34
36
 
37
+ If used as a npm package:
38
+ ```bash
39
+ chroma run --port 8000
40
+ ```
41
+
35
42
  **Windows note:** If `chroma` is not recognized, the `Scripts` directory may not be on your PATH. Either add it (e.g. `%APPDATA%\Python\Python3xx\Scripts`) or run the executable directly:
36
43
  ```powershell
37
44
  & "$env:APPDATA\Python\Python313\Scripts\chroma.exe" run --port 8000
38
45
  ```
39
46
 
40
- ## Install
41
-
42
- ```bash
43
- npm install
44
- ```
45
-
46
47
  ## Usage
47
48
 
48
49
  ### REST API Server
49
-
50
50
  ```bash
51
+ npm install
51
52
  npm run dev
52
53
  ```
53
54
 
@@ -116,7 +117,7 @@ Returns:
116
117
  ### Programmatic Usage (Library)
117
118
 
118
119
  ```typescript
119
- import { PieceStore, RagPipeline, MemoryConfig } from "memory";
120
+ import { PieceStore, RagPipeline, MemoryConfig } from "@danielzfliu/memory";
120
121
 
121
122
  async function main() {
122
123
  const config: MemoryConfig = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@danielzfliu/memory",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "A local RAG system for storing, searching, and querying tagged text pieces using ChromaDB and Ollama",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -13,8 +13,7 @@
13
13
  "files": [
14
14
  "dist",
15
15
  "README.md",
16
- "LICENSE",
17
- "package_scripts"
16
+ "LICENSE"
18
17
  ],
19
18
  "repository": {
20
19
  "type": "git",
@@ -1,17 +0,0 @@
1
- const { spawn } = require("child_process");
2
-
3
- // Get port from argument or default to 8000
4
- const port = process.argv[2] || "8000";
5
-
6
- console.log(`🚀 Starting ChromaDB on port ${port}`);
7
-
8
- const command = `chroma run --port ${port}`;
9
-
10
- const child = spawn(command, [], {
11
- stdio: "inherit",
12
- shell: true,
13
- });
14
-
15
- child.on("close", (code) => {
16
- process.exit(code);
17
- });
@@ -1,20 +0,0 @@
1
- const { spawn } = require("child_process");
2
-
3
- // Get the port from the command line argument, or default to 11434
4
- const port = process.argv[2] || "11434";
5
-
6
- console.log(`🚀 Starting Ollama on 127.0.0.1:${port}`);
7
-
8
- // Run the command with the modified environment variable
9
- const child = spawn("ollama serve", [], {
10
- stdio: "inherit", // Show Ollama's output in your terminal
11
- shell: true, // Ensure compatibility across OS
12
- env: {
13
- ...process.env, // Keep existing environment variables
14
- OLLAMA_HOST: `127.0.0.1:${port}`,
15
- },
16
- });
17
-
18
- child.on("close", (code) => {
19
- process.exit(code);
20
- });