Skills

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
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 into history.py (includes the init_table() helper running an idempotent PL/SQL DDL block, Oracle does NOT support CREATE TABLE IF NOT EXISTS).
  • shared/snippets/in_db_embeddings.py, copy verbatim into store.py when embedder == "in-db-onnx" (this is THE InDBEmbeddings subclass 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 if embedder == "in-db-onnx".

Step 1, Validate inputs

  • target_dir/.env exists and has DB_DSN, DB_USER, DB_PASSWORD. The DB_USER MUST be the app user that oracle-aidb-docker-setup Step 6 created (NOT SYSTEM, SYSTEM's tablespace can't hold JSON columns; you'll get ORA-43853). If not, stop, tell the user to run oracle-aidb-docker-setup first.
  • package_slug matches [a-z][a-z0-9_]*. Reject otherwise.
  • collections non-empty. Naming: <PROJECT_PREFIX>_<KIND> enforced, e.g. for slug pdf_chat and kind DOCUMENTS, the actual table name is PDF_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 at shared/references/onnx-in-db-embeddings.md step 3 (the onnx2oracle recipe).

Step 2, Pick embedding dim

Read the whole SKILL.md on GitHub

More in Engineering