feat: Add Oracle AI Vector Database Integration - #2660
feat: Add Oracle AI Vector Database Integration#2660Elif Sema Balcioglu (fileames) wants to merge 3 commits into
Conversation
🦋 Changeset detectedLatest commit: a06d0a3 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
@langchain/langgraph-checkpoint
@langchain/langgraph-checkpoint-mongodb
@langchain/langgraph-checkpoint-oracledb
@langchain/langgraph-checkpoint-postgres
@langchain/langgraph-checkpoint-redis
@langchain/langgraph-checkpoint-sqlite
@langchain/langgraph-checkpoint-validation
create-langgraph
@langchain/langgraph-api
@langchain/langgraph-cli
@langchain/langgraph
@langchain/langgraph-cua
@langchain/langgraph-supervisor
@langchain/langgraph-swarm
@langchain/langgraph-ui
@langchain/langgraph-sdk
@langchain/angular
@langchain/react
@langchain/svelte
@langchain/vue
commit: |
679a1ca to
ed7cd3b
Compare
866f9b5 to
93d374e
Compare
a75b9e7 to
4aab295
Compare
Fede Kamelhar (fede-kamel)
left a comment
There was a problem hiding this comment.
Reviewed the full package and ran it end-to-end against an Oracle Database 23ai (Free, container) instance. LGTM — the core is solid (I don't have approve rights on this repo, so leaving this as a comment review). What I verified:
- Build clean (attw + publint), unit suite 132/132.
- Full integration suite: 817 passed / 1 intentional skip against a real database. One runbook note: on a small container (default
processes=200) the int files must run serialized (vitest run --mode int --no-file-parallelism); run in parallel they exhaust DB processes and cascade-fail withNJS-511/ORA-12516. - Cross-language compatibility verified live against the Python
langgraph-oracledbpackage, both directions: checkpoints (msgpackbyteschannel values, >1 MiB values routed toCHECKPOINT_BLOBS, nested metadata filters, pending writes incl.__error__), and the store — an identical index config derived the same table suffix from both languages, and each side vector-searched the other's embeddings with identical scores. - A real
StateGraphcompiled withOracleCheckpointSaverresumes state across invocations, with full checkpoint history. - Injection review: every interpolated identifier is validated, values are bound, JSON-path literals are escaped — I could not construct an injection through filter keys or index config values.
Inline comments below each include a reproduction. Two repo-level items without a good diff anchor:
- No
LICENSEfile — the package ships onlyLICENSE-3rd-party.txt; every sibling lib includes the MIT text andpackage.jsondeclares MIT. - Stale lockfile importer entry —
pnpm-lock.yamlrecords@langchain/core(specifier^1.2.1) under this package'sdependencies, butpackage.jsondeclares it only as a peerDependency (^1.1.44). Looks generated from an earlier package.json revision; worth regenerating the lockfile. (It does not breakpnpm install --frozen-lockfileon pnpm 9.15.9 — verified.)
Nice work overall — the byte-compatible pythonJsonDumps suffix hashing and the ORA-00001 retry paths are particularly carefully done.
| in Python. Specify the same suffix explicitly when applications in both | ||
| languages must share one Store. Empty keys are rejected because Oracle treats | ||
| an empty string as `NULL` and the shared key column is `NOT NULL`. | ||
| JavaScript currently supports `COSINE` vector distance; setup rejects a shared |
There was a problem hiding this comment.
Stale limitation: the package supports all three metrics. ORACLE_VECTOR_DISTANCE_METRICS is ["COSINE", "EUCLIDEAN", "DOT"], constructor validation accepts EUCLIDEAN/DOT (verified), and both the generated CREATE VECTOR INDEX ... DISTANCE <metric> and the VECTOR_DISTANCE(..., <metric>) search path honor them. Nothing rejects a shared Python store configured with a non-COSINE metric — assertStoredIndexConfigMatches only requires both sides to agree.
There was a problem hiding this comment.
Looks like README was stale after the latest changes, did the update.
| @@ -0,0 +1,5 @@ | |||
| --- | |||
| "@langchain/langgraph-checkpoint-oracledb": major | |||
There was a problem hiding this comment.
major on a package whose package.json is already at 1.0.0 means the first npm publish will be 2.0.0 (changeset status confirms the pending major bump). Other new packages in this repo started lower (sdk-angular at 0.1.0 via a minor changeset, checkpoint-redis at 0.0.x). Consider setting version to 0.0.0 and keeping this major changeset (first publish becomes 1.0.0), or downgrading the bump.
| `${path}[${index}]`, | ||
| ancestors | ||
| ); | ||
| predicates.push(`exists(${subject}[*]?(${itemPredicate}))`); |
There was a problem hiding this comment.
Array filter semantics diverge from the Python package this integration shares tables with. This compiles arrays to order-insensitive per-element containment, while Python's _build_metadata_predicates uses exact positional JSON_EQUAL (and its comments say so). Reproduced against the same checkpoint row (metadata {"tags": ["a", "b"]}) on 23ai:
list(filter=...) |
Python | JS |
|---|---|---|
{tags: ["a", "b"]} |
1 | 1 |
{tags: ["b", "a"]} |
0 | 1 |
{tags: ["a"]} |
0 | 1 |
JS matches checkpoint-postgres's @> containment semantics, so Python is arguably the outlier — but each implementation's comments currently claim to match the other. Suggest documenting the divergence in the README's cross-language section (and possibly filing an alignment issue on the Python side).
There was a problem hiding this comment.
Follow-up: the Python side is being aligned to this (containment) semantics rather than documenting the divergence — filed as oracle/langchain-oracle#296 with the repro table above, fix in oracle/langchain-oracle#293. With that change both packages return identical rows for list filters on shared tables (verified live with a seven-case typed-element matrix: dict containment/miss, null, true/false discrimination, numbers, nested arrays). So no README caveat needed here once that lands — this branch's containment behavior becomes the cross-language contract, and the Python comment claiming "lists keep exact-match semantics ... matching the JS saver" gets corrected in the same PR.
4aab295 to
5d46ee7
Compare
|
Thanks Fede Kamelhar (@fede-kamel) for the detailed review :) I did the changes requested. Hopefully all looks good now. |
5d46ee7 to
a06d0a3
Compare
Adds Oracle AI Database persistence support for LangGraph.js through the new
@langchain/langgraph-checkpoint-oracledbpackage.OracleCheckpointSaverfor durable graph checkpoints, pending writes, checkpoint listing, child namespaces, andthread deletion.
OracleStorefor long-term memory, filtering, batched operations, and namespace management.The code for this PR was primarily developed by Devansh Dhok (@Devx228) during his internship at Oracle.