Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions reference/packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -773,3 +773,8 @@ packages:
path: libs/voyageai
downloads: 55000
downloads_updated_at: "2025-11-10T00:06:22.543193+00:00"
- name: langchain-oracledb
name_title: Oracle AI Vector Search
repo: oracle/langchain-oracle
downloads: 700
downloads_updated_at: "2025-11-25T00:06:22.543193+00:00"
23 changes: 13 additions & 10 deletions src/oss/python/integrations/document_loaders/oracleadb_loader.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,24 @@ title: Oracle Autonomous Database

Oracle Autonomous Database is a cloud database that uses machine learning to automate database tuning, security, backups, updates, and other routine management tasks traditionally performed by DBAs.

This notebook covers how to load documents from Oracle Autonomous Database, the loader supports connection with connection string or tns configuration.
This notebook covers how to load documents from Oracle Autonomous Database.

## Prerequisites

1. Install `python-oracledb`: `pip install oracledb`
1. See [Installing `python-oracledb`](https://python-oracledb.readthedocs.io/en/latest/user_guide/installation.html).
A database that `python-oracledb`'s default `'Thin'` mode can connected to. This is true of Oracle Autonomous Database, see [`python-oracledb` Architecture](https://python-oracledb.readthedocs.io/en/latest/user_guide/introduction.html#architecture).

## Instructions
You'll need to install `langchain-oracledb` to use this integration.

The `python-oracledb` driver is installed automatically as a dependency of langchain-oracledb.

```python
pip install oracledb
# python -m pip install -U langchain-oracledb
```

## Instructions

```python
from langchain_community.document_loaders import OracleAutonomousDatabaseLoader
from langchain_oracledb.document_loaders import OracleAutonomousDatabaseLoader
from settings import s
```

Expand All @@ -35,7 +38,7 @@ doc_loader_1 = OracleAutonomousDatabaseLoader(
config_dir=s.CONFIG_DIR,
wallet_location=s.WALLET_LOCATION,
wallet_password=s.PASSWORD,
tns_name=s.TNS_NAME,
dsn=s.DSN,
)
doc_1 = doc_loader_1.load()

Expand All @@ -44,7 +47,7 @@ doc_loader_2 = OracleAutonomousDatabaseLoader(
user=s.USERNAME,
password=s.PASSWORD,
schema=s.SCHEMA,
connection_string=s.CONNECTION_STRING,
dsn=s.DSN,
wallet_location=s.WALLET_LOCATION,
wallet_password=s.PASSWORD,
)
Expand All @@ -62,7 +65,7 @@ doc_loader_3 = OracleAutonomousDatabaseLoader(
password=s.PASSWORD,
schema=s.SCHEMA,
config_dir=s.CONFIG_DIR,
tns_name=s.TNS_NAME,
dsn=s.DSN,
parameters=["Direct Sales"],
)
doc_3 = doc_loader_3.load()
Expand All @@ -72,7 +75,7 @@ doc_loader_4 = OracleAutonomousDatabaseLoader(
user=s.USERNAME,
password=s.PASSWORD,
schema=s.SCHEMA,
connection_string=s.CONNECTION_STRING,
dsn=s.DSN,
parameters=["Direct Sales"],
)
doc_4 = doc_loader_4.load()
Expand Down
24 changes: 11 additions & 13 deletions src/oss/python/integrations/document_loaders/oracleai.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,12 @@ If you are just starting with Oracle Database, consider exploring the [free Orac

### Prerequisites

Please install Oracle Python Client driver to use LangChain with Oracle AI Vector Search.
You'll need to install `langchain-oracledb` to use this integration.

The `python-oracledb` driver is installed automatically as a dependency of langchain-oracledb.

```python
# pip install oracledb
# python -m pip install -U langchain-oracledb
```

### Connect to Oracle Database
Expand All @@ -43,17 +45,13 @@ import sys

import oracledb

# please update with your username, password, hostname and service_name
# Please update with your username, password, hostname, port and service_name
username = "<username>"
password = "<password>"
dsn = "<hostname>/<service_name>"
dsn = "<hostname>:<port>/<service_name>"

try:
conn = oracledb.connect(user=username, password=password, dsn=dsn)
print("Connection successful!")
except Exception as e:
print("Connection failed!")
sys.exit(1)
connection = oracledb.connect(user=username, password=password, dsn=dsn)
print("Connection successful!")
```

Now let's create a table and insert some sample docs to test.
Expand Down Expand Up @@ -102,10 +100,10 @@ Users have the flexibility to load documents from either the Oracle Database, a

A significant advantage of utilizing OracleDocLoader is its capability to process over 150 distinct file formats, eliminating the need for multiple loaders for different document types. For a complete list of the supported formats, please refer to the [Oracle Text Supported Document Formats](https://docs.oracle.com/en/database/oracle/oracle-database/23/ccref/oracle-text-supported-document-formats.html).

Below is a sample code snippet that demonstrates how to use OracleDocLoader
Below is a sample code snippet that demonstrates how to use `OracleDocLoader`:

```python
from langchain_community.document_loaders.oracleai import OracleDocLoader
from langchain_oracledb.document_loaders.oracleai import OracleDocLoader
from langchain_core.documents import Document

"""
Expand Down Expand Up @@ -141,7 +139,7 @@ The documents may vary in size, ranging from small to very large. Users often pr
Below is a sample code illustrating how to implement this:

```python
from langchain_community.document_loaders.oracleai import OracleTextSplitter
from langchain_oracledb.document_loaders.oracleai import OracleTextSplitter
from langchain_core.documents import Document

"""
Expand Down
39 changes: 19 additions & 20 deletions src/oss/python/integrations/providers/oracleai.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: OracleAI Vector Search
title: Oracle AI Vector Search
---

Oracle AI Vector Search is designed for Artificial Intelligence (AI) workloads that allows you to query data based on semantics, rather than keywords.
Expand All @@ -8,59 +8,58 @@ This is not only powerful but also significantly more effective because you don'

In addition, your vectors can benefit from all of Oracle Database’s most powerful features, like the following:

* [Partitioning Support](https://www.oracle.com/database/technologies/partitioning.html)
* [Real Application Clusters scalability](https://www.oracle.com/database/real-application-clusters/)
* [Exadata smart scans](https://www.oracle.com/database/technologies/exadata/software/smartscan/)
* [Shard processing across geographically distributed databases](https://www.oracle.com/database/distributed-database/)
* [Transactions](https://docs.oracle.com/en/database/oracle/oracle-database/23/cncpt/transactions.html)
* [Parallel SQL](https://docs.oracle.com/en/database/oracle/oracle-database/21/vldbg/parallel-exec-intro.html#GUID-D28717E4-0F77-44F5-BB4E-234C31D4E4BA)
* [Disaster recovery](https://www.oracle.com/database/data-guard/)
* [Security](https://www.oracle.com/security/database-security/)
* [Oracle Machine Learning](https://www.oracle.com/artificial-intelligence/database-machine-learning/)
* [Oracle Graph Database](https://www.oracle.com/database/integrated-graph-database/)
* [Oracle Spatial and Graph](https://www.oracle.com/database/spatial/)
* [Oracle Blockchain](https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/dbms_blockchain_table.html#GUID-B469E277-978E-4378-A8C1-26D3FF96C9A6)
* [JSON](https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/json-in-oracle-database.html)

* [Partitioning Support](https://www.oracle.com/database/technologies/partitioning.html)
* [Real Application Clusters scalability](https://www.oracle.com/database/real-application-clusters/)
* [Exadata smart scans](https://www.oracle.com/database/technologies/exadata/software/smartscan/)
* [Shard processing across geographically distributed databases](https://www.oracle.com/database/distributed-database/)
* [Transactions](https://docs.oracle.com/en/database/oracle/oracle-database/23/cncpt/transactions.html)
* [Parallel SQL](https://docs.oracle.com/en/database/oracle/oracle-database/21/vldbg/parallel-exec-intro.html#GUID-D28717E4-0F77-44F5-BB4E-234C31D4E4BA)
* [Disaster recovery](https://www.oracle.com/database/data-guard/)
* [Security](https://www.oracle.com/security/database-security/)
* [Oracle Machine Learning](https://www.oracle.com/artificial-intelligence/database-machine-learning/)
* [Oracle Graph Database](https://www.oracle.com/database/integrated-graph-database/)
* [Oracle Spatial and Graph](https://www.oracle.com/database/spatial/)
* [Oracle Blockchain](https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/dbms_blockchain_table.html#GUID-B469E277-978E-4378-A8C1-26D3FF96C9A6)
* [JSON](https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/json-in-oracle-database.html)

## Document loaders

Please check the [usage example](/oss/integrations/document_loaders/oracleai).

```python
from langchain_community.document_loaders.oracleai import OracleDocLoader
from langchain_oracledb.document_loaders.oracleai import OracleDocLoader
```

## Text Splitter

Please check the [usage example](/oss/integrations/document_loaders/oracleai).

```python
from langchain_community.document_loaders.oracleai import OracleTextSplitter
from langchain_oracledb.document_loaders.oracleai import OracleTextSplitter
```

## Embeddings

Please check the [usage example](/oss/integrations/text_embedding/oracleai).

```python
from langchain_community.embeddings.oracleai import OracleEmbeddings
from langchain_oracledb.embeddings.oracleai import OracleEmbeddings
```

## Summary

Please check the [usage example](/oss/integrations/tools/oracleai).

```python
from langchain_community.utilities.oracleai import OracleSummary
from langchain_oracledb.utilities.oracleai import OracleSummary
```

## Vector Store

Please check the [usage example](/oss/integrations/vectorstores/oracle).

```python
from langchain_community.vectorstores.oraclevs import OracleVS
from langchain_oracledb.vectorstores.oraclevs import OracleVS
```

## End to End Demo
Expand Down
22 changes: 10 additions & 12 deletions src/oss/python/integrations/text_embedding/oracleai.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,12 @@ If you are just starting with Oracle Database, consider exploring the [free Orac

### Prerequisites

Ensure you have the Oracle Python Client driver installed to facilitate the integration of LangChain with Oracle AI Vector Search.
You'll need to install `langchain-oracledb` to use this integration.

The `python-oracledb` driver is installed automatically as a dependency of langchain-oracledb.

```python
# pip install oracledb
# python -m pip install -U langchain-oracledb
```

### Connect to Oracle Database
Expand All @@ -43,17 +45,13 @@ import sys

import oracledb

# Update the following variables with your Oracle database credentials and connection details
# Please update with your username, password, hostname, port and service_name
username = "<username>"
password = "<password>"
dsn = "<hostname>/<service_name>"
dsn = "<hostname>:<port>/<service_name>"

try:
conn = oracledb.connect(user=username, password=password, dsn=dsn)
print("Connection successful!")
except Exception as e:
print("Connection failed!")
sys.exit(1)
connection = oracledb.connect(user=username, password=password, dsn=dsn)
print("Connection successful!")
```

For embedding generation, several provider options are available to users, including embedding generation within the database and third-party services such as OcigenAI, Hugging Face, and OpenAI. Users opting for third-party providers must establish credentials that include the requisite authentication information. Alternatively, if users select 'database' as their provider, they are required to load an ONNX model into the Oracle Database to facilitate embeddings.
Expand All @@ -69,7 +67,7 @@ A significant advantage of utilizing an ONNX model directly within Oracle is the
Below is the example code to upload an ONNX model into Oracle Database:

```python
from langchain_community.embeddings.oracleai import OracleEmbeddings
from langchain_oracledb.embeddings.oracleai import OracleEmbeddings

# Update the directory and file names for your ONNX model
# make sure that you have onnx file in the system
Expand Down Expand Up @@ -144,7 +142,7 @@ proxy = "<proxy>"
The following sample code will show how to generate embeddings:

```python
from langchain_community.embeddings.oracleai import OracleEmbeddings
from langchain_oracledb.embeddings.oracleai import OracleEmbeddings
from langchain_core.documents import Document

"""
Expand Down
24 changes: 10 additions & 14 deletions src/oss/python/integrations/tools/oracleai.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -28,32 +28,28 @@ If you are just starting with Oracle Database, consider exploring the [free Orac

### Prerequisites

Please install Oracle Python Client driver to use LangChain with Oracle AI Vector Search.
You'll need to install `langchain-oracledb` to use this integration.

The `python-oracledb` driver is installed automatically as a dependency of langchain-oracledb.

```python
# pip install oracledb
# python -m pip install -U langchain-oracledb
```

### Connect to Oracle Database

The following sample code will show how to connect to Oracle Database. By default, python-oracledb runs in a ‘Thin’ mode which connects directly to Oracle Database. This mode does not need Oracle Client libraries. However, some additional functionality is available when python-oracledb uses them. Python-oracledb is said to be in ‘Thick’ mode when Oracle Client libraries are used. Both modes have comprehensive functionality supporting the Python Database API v2.0 Specification. See the following [guide](https://python-oracledb.readthedocs.io/en/latest/user_guide/appendix_a.html#featuresummary) that talks about features supported in each mode. You might want to switch to thick-mode if you are unable to use thin-mode.

```python
import sys

import oracledb

# please update with your username, password, hostname and service_name
# Please update with your username, password, hostname, port and service_name
username = "<username>"
password = "<password>"
dsn = "<hostname>/<service_name>"

try:
conn = oracledb.connect(user=username, password=password, dsn=dsn)
print("Connection successful!")
except Exception as e:
print("Connection failed!")
sys.exit(1)
dsn = "<hostname>:<port>/<service_name>"

connection = oracledb.connect(user=username, password=password, dsn=dsn)
print("Connection successful!")
```

### Generate Summary
Expand All @@ -70,7 +66,7 @@ proxy = "<proxy>"
The following sample code will show how to generate summary:

```python
from langchain_community.utilities.oracleai import OracleSummary
from langchain_oracledb.utilities.oracleai import OracleSummary
from langchain_core.documents import Document

"""
Expand Down
2 changes: 2 additions & 0 deletions src/oss/python/integrations/vectorstores/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -666,6 +666,7 @@ vector_store = QdrantVectorStore(
| [`Weaviate`](/oss/integrations/vectorstores/weaviate) | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ | ✅ | ✅ |
| [`SQLServer`](/oss/integrations/vectorstores/sqlserver) | ✅ | ✅ | ✅ | ✅ | ❌ | ❌ | ❌ | ✅ |
| [`ZeusDB`](/oss/integrations/vectorstores/zeusdb) | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ | ✅ |
| [`Oracle AI Vector Search`](/oss/integrations/vectorstores/oracle) | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ | ✅ |

## All vector stores

Expand Down Expand Up @@ -787,5 +788,6 @@ vector_store = QdrantVectorStore(
<Card title="Zep Cloud" icon="link" href="/oss/integrations/vectorstores/zep_cloud" arrow="true" cta="View guide"/>
<Card title="ZeusDB" icon="link" href="/oss/integrations/vectorstores/zeusdb" arrow="true" cta="View guide"/>
<Card title="Zilliz" icon="link" href="/oss/integrations/vectorstores/zilliz" arrow="true" cta="View guide"/>
<Card title="Oracle AI Vector Search" icon="link" href="/oss/integrations/vectorstores/oracle" arrow="true" cta="View guide"/>
</Columns>

Loading