Langchain Oracledb Helper
Scaffold a langchain-oracledb store layer, multi-collection OracleVS wrapper...
Install
npx skills add oracle-devrel/oracle-ai-developer-hub --skill langchain-oracledb-helper -g -a claude-code -y- Repository
- oracle-devrel/oracle-ai-developer-hub4.5k
- Category
- Engineering
- Updated
- 5d ago
- License
- See repository
- Context cost
- Mediumabout 2,395 tokens
- Runs scripts
- No, instructions only
What it does
Scaffold a langchain-oracledb store layer, multi-collection OracleVS wrapper, metadata-as-string monkeypatch, embedder-dim assertion, OracleChatHistory subclass (langchain-oracledb does not ship one). Use when a project needs Oracle as its LangChain vector store and chat-history backend.
You write the Oracle data-layer modules. You do not write app code, chains, or UI.
Step 0, References (mandatory)
shared/references/langchain-oracledb.md, load-bearing.shared/snippets/metadata_monkeypatch.py, copy verbatim into_monkeypatch.py.shared/snippets/oracle_chat_history.py, copy verbatim intohistory.py(includes theinit_table()helper running an idempotent PL/SQL DDL block, Oracle does NOT supportCREATE TABLE IF NOT EXISTS).shared/snippets/in_db_embeddings.py, copy verbatim intostore.pywhenembedder == "in-db-onnx"(this is THEInDBEmbeddingssubclass referenced everywhere; it lives here so the helper actually ships it instead of asking the user to invent it).shared/references/onnx-in-db-embeddings.md, only ifembedder == "in-db-onnx".
Step 1, Validate inputs
target_dir/.envexists and hasDB_DSN,DB_USER,DB_PASSWORD. TheDB_USERMUST be the app user thatoracle-aidb-docker-setupStep 6 created (NOTSYSTEM,SYSTEM's tablespace can't hold JSON columns; you'll get ORA-43853). If not, stop, tell the user to runoracle-aidb-docker-setupfirst.package_slugmatches[a-z][a-z0-9_]*. Reject otherwise.collectionsnon-empty. Naming:<PROJECT_PREFIX>_<KIND>enforced, e.g. for slugpdf_chatand kindDOCUMENTS, the actual table name isPDF_CHAT_DOCUMENTS. Document this in the file's docstring.- For
embedder == "in-db-onnx", confirm the user has a registered ONNX model name. If not, stop, point them atshared/references/onnx-in-db-embeddings.mdstep 3 (theonnx2oraclerecipe).
