Skip to main content

LlamaIndex retriever integration for Dewey — managed RAG backend

Project description

LlamaIndex Dewey Retriever

Dewey is a managed document intelligence backend that handles the full RAG pipeline — PDF conversion, section extraction, chunking, embedding, and hybrid retrieval — behind a single REST API.

This package provides a DeweyRetriever that integrates Dewey's hybrid semantic + BM25 search directly into LlamaIndex pipelines.

Installation

pip install llama-index-retrievers-dewey

Usage

from llama_index.retrievers.dewey import DeweyRetriever
from llama_index.core.query_engine import RetrieverQueryEngine
from llama_index.llms.anthropic import Anthropic

retriever = DeweyRetriever(
    api_key="dwy_live_...",       # Dewey project API key
    collection_id="3f7a1b2c-...", # Collection to search
    k=8,                          # Number of chunks to retrieve
)

# Use with any LlamaIndex query engine
query_engine = RetrieverQueryEngine.from_args(
    retriever=retriever,
    llm=Anthropic(model="claude-haiku-4-5-20251001"),
)
response = query_engine.query("What are the main findings?")
print(response)

Direct retrieval

nodes = retriever.retrieve("attention mechanism scaling")
for n in nodes:
    print(f"[{n.score:.3f}] {n.node.metadata['filename']}{n.node.metadata['section_title']}")
    print(f"  {n.node.text[:120]}...")

As part of an agent

from llama_index.core.tools import RetrieverTool
from llama_index.core.agent import ReActAgent
from llama_index.llms.openai import OpenAI

tool = RetrieverTool.from_defaults(
    retriever=retriever,
    description="Search AI research papers for relevant information.",
)
agent = ReActAgent.from_tools([tool], llm=OpenAI(model="gpt-4o-mini"), verbose=True)
agent.chat("Compare the Transformer and RAG architectures.")

Parameters

Parameter Type Default Description
api_key str required Dewey project API key (dwy_live_...)
collection_id str required UUID of the collection to search
k int 10 Max chunks to retrieve (1–50)
base_url str https://api.meetdewey.com/v1 Override for local dev

What Dewey returns

Each retrieved node includes:

  • node.text — chunk content
  • node.metadata["filename"] — source document filename
  • node.metadata["section_title"] — section heading
  • node.metadata["section_level"] — heading depth (1 = top-level)
  • node.metadata["document_id"] — document UUID
  • node.metadata["section_id"] — section UUID
  • score — relevance score from hybrid RRF ranking

Resources

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

llama_index_retrievers_dewey-0.1.0.tar.gz (4.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

llama_index_retrievers_dewey-0.1.0-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

File details

Details for the file llama_index_retrievers_dewey-0.1.0.tar.gz.

File metadata

File hashes

Hashes for llama_index_retrievers_dewey-0.1.0.tar.gz
Algorithm Hash digest
SHA256 374440573d3c249c77be9b7ba5c8a857e540e8618609bf43fbe891e0ad9b16fb
MD5 29f09b33294235507d313c496c78efde
BLAKE2b-256 28d9f7ec26bbce1f105b9973c17c098212e628b167d26ee0bfb95b9c6702e385

See more details on using hashes here.

File details

Details for the file llama_index_retrievers_dewey-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for llama_index_retrievers_dewey-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1b99d6b704f27c998c2a3c7f2d4f1044a1b41ddf29e3e1b5350832902f6b111a
MD5 b9e351e2d60a756858b675a241fa2c84
BLAKE2b-256 acf7571add3d590aac86c31f89b6d9504c3426b4c4892de5e55471c54eb038cc

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page