refactor(config): centralize storage and graph file paths

- Added `constants.mjs` defining `STORAGE_DIR` and `GRAPH_FILE`.
- Replaced hard‑coded path strings in `agent.mjs`, `build_graph.mjs`, and `ingest.mjs` with imports from the new constants module.
- Updated console log in `ingest.mjs` to reference `STORAGE_DIR`.
- Adjusted `GRAPH_FILE` path to `./graphology/graph.json` via the constant.
This commit is contained in:
2026-03-27 09:40:54 +05:30
parent b8812b9eb7
commit 4a4b4971dd
4 changed files with 6 additions and 5 deletions
+2 -2
View File
@@ -18,7 +18,7 @@ Settings.embedModel = new OllamaEmbedding({
const SPEC_DIR = './spec-built/multipage';
const CODE_DIR = './engine262/src';
const STORAGE_DIR = './storage';
import { STORAGE_DIR } from './constants.mjs';
// Initialize a SentenceSplitter with even smaller chunk size
const sentenceSplitter = new SentenceSplitter({ chunkSize: 256, chunkOverlap: 20 });
@@ -113,7 +113,7 @@ async function main() {
}
}
console.log("Index built and persisted to ./storage");
console.log(`Index built and persisted to ${STORAGE_DIR}`);
}
main().catch(console.error);