Skip to content

Add Oracle AI Database vector store support#5003

Open
hogaku wants to merge 21 commits intomem0ai:mainfrom
hogaku:feature/oracle-vector-store
Open

Add Oracle AI Database vector store support#5003
hogaku wants to merge 21 commits intomem0ai:mainfrom
hogaku:feature/oracle-vector-store

Conversation

@hogaku
Copy link
Copy Markdown

@hogaku hogaku commented Apr 28, 2026

Linked Issue

N/A

Description

This PR adds Oracle AI Database vector store support to Mem0.

Why this is needed:

  • Mem0 supports multiple vector store backends, but Oracle AI Database is not currently supported.
  • Oracle AI Database provides native vector search and JSON indexing, which map well to Mem0's semantic, keyword, hybrid, and metadata-filtered retrieval paths.
  • This allows users already running on Oracle or OCI to use Mem0 without adding a separate vector database.
  • Although this PR is scoped to Mem0's vector store interface, Oracle AI Database also gives enterprise users a governed backend that can support richer memory architectures over time.

What is included:

  • Added a new Oracle vector store backend
  • Added native Oracle VECTOR-based semantic search support
  • Added Oracle keyword search support using JSON search indexing
  • Added hybrid retrieval support combining semantic search and keyword search
  • Added metadata filtering support for scoped memory retrieval
  • Added score normalization to align Oracle search results with Mem0's retrieval and ranking expectations
  • Added vector index creation with safe fallback behavior when approximate index creation is not available
  • Added Oracle AI Database documentation and usage guidance
  • Added a standalone Oracle Autonomous AI Database vector store example
  • Added and updated unit tests for the Oracle backend

Implementation notes:

  • The backend uses Oracle's native vector capabilities for semantic retrieval
  • Keyword search is implemented with Oracle JSON search indexing
  • Hybrid retrieval combines semantic and keyword signals within Mem0's ranking flow
  • The implementation preserves compatibility with Mem0's existing vector store interface

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Refactor (no functional changes)
  • Documentation update

Breaking Changes

N/A

Test Coverage

  • I added/updated unit tests
  • I added/updated integration tests
  • I tested manually (describe below)
  • No tests needed (explain why)

Validation performed:

  • Ran pytest tests/ -q in a Python 3.12 environment aligned with the repository CI setup
    • Result: 1088 passed, 31 skipped, 5 warnings, 2 subtests passed
  • Ran pytest tests/vector_stores/test_oracle.py -q
    • Result: 19 passed, 2 subtests passed
  • Ran the standalone Oracle Autonomous AI Database smoke test:
    • python examples/misc/oracle_aidb_vector_store.py
    • Confirmed wallet-based connection, insert/search/cleanup, VECTOR index creation, and JSON search index creation against a real Oracle Autonomous AI Database environment
  • Ran the GitHub Actions Oracle validation workflow:

Reviewer / maintenance notes:

  • The Oracle-specific behavior is covered by unit tests that use mocked connections, so the main backend logic can be reviewed without requiring a live Oracle database.
  • A live Oracle environment can be created with OCI Always Free Autonomous AI Database, subject to Oracle's documented limits and regional availability.
  • The live smoke test is optional and intended for end-to-end validation of wallet connectivity, index creation, insert/search, and cleanup.
  • The implementation is scoped to Mem0's existing vector store interface and does not introduce a new memory abstraction.
  • Oracle-specific dependencies are kept behind the existing vector_stores extra.
  • Please feel free to mention me with any questions or implementation concerns. I am happy to adjust the PR to better fit Mem0's conventions and help with ongoing Oracle-related maintenance if useful.

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my code
  • I have added tests that prove my fix/feature works
  • New and existing tests pass locally
  • I have updated documentation if needed

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Apr 28, 2026

CLA assistant check
All committers have signed the CLA.

@hogaku
Copy link
Copy Markdown
Author

hogaku commented Apr 28, 2026

Thanks, the CLA check is now passing. The remaining checks appear to be waiting for maintainer approval to run workflows from the fork. Please let me know if there is anything else I should adjust on my side.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants