Skip to content

feat: add Claude + Oracle AI Database Vector Search RAG cookbook example#396

Open
Ela689 wants to merge 3 commits intoanthropics:mainfrom
Ela689:feat/oracle-ai-db-vector-search
Open

feat: add Claude + Oracle AI Database Vector Search RAG cookbook example#396
Ela689 wants to merge 3 commits intoanthropics:mainfrom
Ela689:feat/oracle-ai-db-vector-search

Conversation

@Ela689
Copy link

@Ela689 Ela689 commented Feb 25, 2026

What this PR adds

This PR adds a new third-party cookbook example for building an end-to-end Retrieval-Augmented Generation (RAG) pipeline using:

  • Claude (Anthropic) for answer generation
  • Oracle AI Database Vector Search for retrieval

The notebook is designed as a practical, runnable walkthrough and goes beyond a minimal demo by showcasing Oracle-native vector capabilities in a realistic RAG flow.

Highlights of the example

This cookbook demonstrates:

  • Oracle native vector storage using VECTOR(1024, FLOAT32)
  • Real similarity scoring in the database via VECTOR_DISTANCE
  • Hybrid search (vector similarity + relational SQL filters, e.g. category)
  • HNSW vector indexing for scalable approximate nearest neighbor search
  • End-to-end RAG flow: ingest → embed → store → retrieve → generate with Claude

What’s included

  • third_party/OracleAI/rag_using_oracle_ai_db.ipynb
  • third_party/OracleAI/Readme.md

The notebook covers:

  1. Dependency installation
  2. Environment variable setup (.env)
  3. Oracle AI Database connection (oracledb)
  4. Vector table creation with relational metadata
  5. Embedding generation and document ingestion
  6. Similarity search with real distance scores
  7. Hybrid queries (vector + SQL filters)
  8. Grounded answer generation with Claude

Environment support

The example is written to support both:

  • Oracle Autonomous Database (recommended for cloud demos / production)
  • Oracle AI Database Free (local) via Docker/Podman

Both use the same Python oracledb client API, with only connection configuration changes.

Why this is valuable

This example helps users understand how to build a production-oriented RAG pipeline with Oracle AI Database Vector Search while preserving the strengths of relational SQL (metadata filtering, structured queries) alongside vector retrieval.

Testing status

  • Notebook tested end-to-end with Oracle AI Database Vector Search
  • Retrieval and generation flow executed successfully
  • README and notebook content updated based on review feedback

Happy to iterate on any additional feedback. 🙌

Ela689 and others added 3 commits February 22, 2026 21:10
- Add prerequisites section (Oracle DB setup)
- Fix pip deps (sentence-transformers)
- Add cleanup cell (close DB connection)
- Clarify Claude model recommendation (4.5+ suggested, Haiku fallback)
- Clean notebook outputs
- replace mocked similarity scores with real   VECTOR_DISTANCE(COSINE) queries
- add hybrid search (vector + SQL WHERE)
- add HNSW vector index creation step, and use VECTOR(1024, FLOAT32) for strong typing suggestions tot he database
  -  Tested end-to-end against Oracle AI DB
…hybrid search, HNSW)

- Replace mocked similarity with VECTOR_DISTANCE(COSINE)
- Add hybrid search (vector + SQL WHERE)
- Add HNSW vector index creation
- Use strongly typed vectors VECTOR(1024, FLOAT32)
- Polish wording and clarify setup steps
- Clean and rerun notebook outputs
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