Skip to main content

llama-index packs multi_tenancy_rag integration

Project description

Multi-Tenancy RAG Pack

Create a Multi-Tenancy RAG using VectorStoreIndex.

CLI Usage

You can download llamapacks directly using llamaindex-cli, which comes installed with the llama-index python package:

llamaindex-cli download-llamapack MultiTenancyRAGPack --download-dir ./multitenancy_rag_pack

You can then inspect the files at ./multitenancy_rag_pack and use them as a template for your own project.

Code Usage

You can download the pack to a the ./multitenancy_rag_pack directory:

from llama_index.core.llama_pack import download_llama_pack

# download and install dependencies
MultiTenancyRAGPack = download_llama_pack(
    "MultiTenancyRAGPack", "./multitenancy_rag_pack"
)

# You can use any llama-hub loader to get documents and add them to index for a user!
multitenancy_rag_pack = MultiTenancyRAGPack()
multitenancy_rag_pack.add(documents, "<user>")

From here, you can use the pack, or inspect and modify the pack in ./multitenancy_rag_pack.

The run() function is a light wrapper around index.as_query_engine().query().

response = multitenancy_rag_pack.run(
    "<user query>", user="<user>", similarity_top_k=2
)

You can also use modules individually.

# Use the index directly
index = multitenancy_rag_pack.index
query_engine = index.as_query_engine(
    filters=MetadataFilters(
        filters=[
            ExactMatchFilter(
                key="user",
                value="<user>",
            )
        ]
    )
)
retriever = index.as_retriever(
    filters=MetadataFilters(
        filters=[
            ExactMatchFilter(
                key="user",
                value="<user>",
            )
        ]
    )
)

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_packs_multi_tenancy_rag-0.6.0.tar.gz (4.3 kB view details)

Uploaded Source

Built Distribution

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

File details

Details for the file llama_index_packs_multi_tenancy_rag-0.6.0.tar.gz.

File metadata

  • Download URL: llama_index_packs_multi_tenancy_rag-0.6.0.tar.gz
  • Upload date:
  • Size: 4.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for llama_index_packs_multi_tenancy_rag-0.6.0.tar.gz
Algorithm Hash digest
SHA256 2c973205a2ba57a7b2e36aaa2ba62f707fd9df62d13bc361eb110e953dd297b4
MD5 a36c7e3d9db206795dfec364cd4f24e9
BLAKE2b-256 3d0fc74a0ea905e59d818deff279e1ded403a67429ccd13cefe609beb0dbdb68

See more details on using hashes here.

File details

Details for the file llama_index_packs_multi_tenancy_rag-0.6.0-py3-none-any.whl.

File metadata

  • Download URL: llama_index_packs_multi_tenancy_rag-0.6.0-py3-none-any.whl
  • Upload date:
  • Size: 4.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for llama_index_packs_multi_tenancy_rag-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4a7c6ec1bfd5525cd27b8b35ef842eaeb10bc605fb30a29c24c900ceb703208e
MD5 b64f42e4dc3106d6458a334a73abe54c
BLAKE2b-256 b740115ee547c76e16070822eb99e12c719c6ac7537414b26913515c9e4d665d

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