# 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:
```bash
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:
```python
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()`.
```python
response = multitenancy_rag_pack.run(
"<user query>", user="<user>", similarity_top_k=2
)
```
You can also use modules individually.
```python
# 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>",
)
]
)
)
```
Raw data
{
"_id": null,
"home_page": null,
"name": "llama-index-packs-multi-tenancy-rag",
"maintainer": "ravi03071991",
"docs_url": null,
"requires_python": "<4.0,>=3.9",
"maintainer_email": null,
"keywords": "multi, multi-tenancy, rag, tenancy",
"author": "Your Name",
"author_email": "you@example.com",
"download_url": "https://files.pythonhosted.org/packages/17/a6/972b39a5dc9e5e25ffe15863ca2be6b52ea19f55f260dbd5713442fea8c7/llama_index_packs_multi_tenancy_rag-0.4.0.tar.gz",
"platform": null,
"description": "# Multi-Tenancy RAG Pack\n\nCreate a Multi-Tenancy RAG using VectorStoreIndex.\n\n## CLI Usage\n\nYou can download llamapacks directly using `llamaindex-cli`, which comes installed with the `llama-index` python package:\n\n```bash\nllamaindex-cli download-llamapack MultiTenancyRAGPack --download-dir ./multitenancy_rag_pack\n```\n\nYou can then inspect the files at `./multitenancy_rag_pack` and use them as a template for your own project.\n\n## Code Usage\n\nYou can download the pack to a the `./multitenancy_rag_pack` directory:\n\n```python\nfrom llama_index.core.llama_pack import download_llama_pack\n\n# download and install dependencies\nMultiTenancyRAGPack = download_llama_pack(\n \"MultiTenancyRAGPack\", \"./multitenancy_rag_pack\"\n)\n\n# You can use any llama-hub loader to get documents and add them to index for a user!\nmultitenancy_rag_pack = MultiTenancyRAGPack()\nmultitenancy_rag_pack.add(documents, \"<user>\")\n```\n\nFrom here, you can use the pack, or inspect and modify the pack in `./multitenancy_rag_pack`.\n\nThe `run()` function is a light wrapper around `index.as_query_engine().query()`.\n\n```python\nresponse = multitenancy_rag_pack.run(\n \"<user query>\", user=\"<user>\", similarity_top_k=2\n)\n```\n\nYou can also use modules individually.\n\n```python\n# Use the index directly\nindex = multitenancy_rag_pack.index\nquery_engine = index.as_query_engine(\n filters=MetadataFilters(\n filters=[\n ExactMatchFilter(\n key=\"user\",\n value=\"<user>\",\n )\n ]\n )\n)\nretriever = index.as_retriever(\n filters=MetadataFilters(\n filters=[\n ExactMatchFilter(\n key=\"user\",\n value=\"<user>\",\n )\n ]\n )\n)\n```\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "llama-index packs multi_tenancy_rag integration",
"version": "0.4.0",
"project_urls": null,
"split_keywords": [
"multi",
" multi-tenancy",
" rag",
" tenancy"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "7e55137adfc648940e4743148894e7733d0c2f558651be40123a9b0a7c0a1db5",
"md5": "9ed2e44ada5f73baf5ca4d58182b9305",
"sha256": "2c085cbe82533f695114d985b4affaa38ff59a79d45218e36e30c4d3c4bab48d"
},
"downloads": -1,
"filename": "llama_index_packs_multi_tenancy_rag-0.4.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "9ed2e44ada5f73baf5ca4d58182b9305",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.9",
"size": 3199,
"upload_time": "2024-11-18T01:32:29",
"upload_time_iso_8601": "2024-11-18T01:32:29.238332Z",
"url": "https://files.pythonhosted.org/packages/7e/55/137adfc648940e4743148894e7733d0c2f558651be40123a9b0a7c0a1db5/llama_index_packs_multi_tenancy_rag-0.4.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "17a6972b39a5dc9e5e25ffe15863ca2be6b52ea19f55f260dbd5713442fea8c7",
"md5": "9a89d007fd380a01f7d8de01e57b901d",
"sha256": "374cf5f7991aa007f505fc93528193197526547311b2b9d7c5ae314785fdcc2c"
},
"downloads": -1,
"filename": "llama_index_packs_multi_tenancy_rag-0.4.0.tar.gz",
"has_sig": false,
"md5_digest": "9a89d007fd380a01f7d8de01e57b901d",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.9",
"size": 2863,
"upload_time": "2024-11-18T01:32:31",
"upload_time_iso_8601": "2024-11-18T01:32:31.497664Z",
"url": "https://files.pythonhosted.org/packages/17/a6/972b39a5dc9e5e25ffe15863ca2be6b52ea19f55f260dbd5713442fea8c7/llama_index_packs_multi_tenancy_rag-0.4.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-11-18 01:32:31",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "llama-index-packs-multi-tenancy-rag"
}