Query fusion
BaseRetriever #
Bases: PromptMixin, DispatcherSpanMixin
Base retriever.
Source code in llama_index/core/base/base_retriever.py
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 | |
retrieve #
retrieve(str_or_query_bundle: QueryType) -> List[NodeWithScore]
Retrieve nodes given query.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
str_or_query_bundle
|
QueryType
|
Either a query string or a QueryBundle object. |
required |
Source code in llama_index/core/base/base_retriever.py
185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 | |
BaseImageRetriever #
Bases: PromptMixin, DispatcherSpanMixin
Base Image Retriever Abstraction.
Source code in llama_index/core/image_retriever.py
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 | |
text_to_image_retrieve #
text_to_image_retrieve(str_or_query_bundle: QueryType) -> List[NodeWithScore]
Retrieve image nodes given query or single image input.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
str_or_query_bundle
|
QueryType
|
a query text |
required |
Source code in llama_index/core/image_retriever.py
13 14 15 16 17 18 19 20 21 22 23 24 25 26 | |
image_to_image_retrieve #
image_to_image_retrieve(str_or_query_bundle: QueryType) -> List[NodeWithScore]
Retrieve image nodes given single image input.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
str_or_query_bundle
|
QueryType
|
a image path |
required |
Source code in llama_index/core/image_retriever.py
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 | |
EmptyIndexRetriever #
Bases: BaseRetriever
EmptyIndex query.
Passes the raw LLM call to the underlying LLM model.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
input_prompt
|
Optional[BasePromptTemplate]
|
A Simple Input Prompt
(see :ref: |
None
|
Source code in llama_index/core/indices/empty/retrievers.py
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 | |
KeywordTableSimpleRetriever #
Bases: BaseKeywordTableRetriever
Keyword Table Index Simple Retriever.
Extracts keywords using simple regex-based keyword extractor.
Set when retriever_mode="simple".
See BaseGPTKeywordTableQuery for arguments.
Source code in llama_index/core/indices/keyword_table/retrievers.py
167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 | |
KGTableRetriever #
Bases: BaseRetriever
KG Table Retriever.
Arguments are shared among subclasses.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
query_keyword_extract_template
|
Optional[QueryKGExtractPrompt]
|
A Query
KG Extraction
Prompt (see :ref: |
None
|
refine_template
|
Optional[BasePromptTemplate]
|
A Refinement Prompt
(see :ref: |
required |
text_qa_template
|
Optional[BasePromptTemplate]
|
A Question Answering Prompt
(see :ref: |
required |
max_keywords_per_query
|
int
|
Maximum number of keywords to extract from query. |
10
|
num_chunks_per_query
|
int
|
Maximum number of text chunks to query. |
10
|
include_text
|
bool
|
Use the document text source from each relevant triplet during queries. |
True
|
retriever_mode
|
KGRetrieverMode
|
Specifies whether to use keywords, embeddings, or both to find relevant triplets. Should be one of "keyword", "embedding", or "hybrid". |
KEYWORD
|
similarity_top_k
|
int
|
The number of top embeddings to use (if embeddings are used). |
2
|
graph_store_query_depth
|
int
|
The depth of the graph store query. |
2
|
use_global_node_triplets
|
bool
|
Whether to get more keywords(entities) from text chunks matched by keywords. This helps introduce more global knowledge. While it's more expensive, thus to be turned off by default. |
False
|
max_knowledge_sequence
|
int
|
The maximum number of knowledge sequence to include in the response. By default, it's 30. |
REL_TEXT_LIMIT
|
Source code in llama_index/core/indices/knowledge_graph/retrievers.py
61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 | |
KnowledgeGraphRAGRetriever #
Bases: BaseRetriever
Knowledge Graph RAG retriever.
Retriever that perform SubGraph RAG towards knowledge graph.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
storage_context
|
Optional[StorageContext]
|
A storage context to use. |
None
|
entity_extract_fn
|
Optional[Callable]
|
A function to extract entities. |
None
|
entity_extract_template Optional[BasePromptTemplate])
|
A Query Key Entity
Extraction Prompt (see :ref: |
required | |
entity_extract_policy
|
Optional[str]
|
The entity extraction policy to use. default: "union" possible values: "union", "intersection" |
'union'
|
synonym_expand_fn
|
Optional[Callable]
|
A function to expand synonyms. |
None
|
synonym_expand_template
|
Optional[QueryKeywordExpandPrompt]
|
A Query Key Entity
Expansion Prompt (see :ref: |
None
|
synonym_expand_policy
|
Optional[str]
|
The synonym expansion policy to use. default: "union" possible values: "union", "intersection" |
'union'
|
max_entities
|
int
|
The maximum number of entities to extract. default: 5 |
5
|
max_synonyms
|
int
|
The maximum number of synonyms to expand per entity. default: 5 |
5
|
retriever_mode
|
Optional[str]
|
The retriever mode to use. default: "keyword" possible values: "keyword", "embedding", "keyword_embedding" |
'keyword'
|
with_nl2graphquery
|
bool
|
Whether to combine NL2GraphQuery in context. default: False |
False
|
graph_traversal_depth
|
int
|
The depth of graph traversal. default: 2 |
2
|
max_knowledge_sequence
|
int
|
The maximum number of knowledge sequence to include in the response. By default, it's 30. |
REL_TEXT_LIMIT
|
verbose
|
bool
|
Whether to print out debug info. |
False
|
Source code in llama_index/core/indices/knowledge_graph/retrievers.py
410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 | |
SummaryIndexEmbeddingRetriever #
Bases: BaseRetriever
Embedding based retriever for SummaryIndex.
Generates embeddings in a lazy fashion for all nodes that are traversed.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
index
|
SummaryIndex
|
The index to retrieve from. |
required |
similarity_top_k
|
Optional[int]
|
The number of top nodes to return. |
1
|
Source code in llama_index/core/indices/list/retrievers.py
65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 | |
SummaryIndexLLMRetriever #
Bases: BaseRetriever
LLM retriever for SummaryIndex.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
index
|
SummaryIndex
|
The index to retrieve from. |
required |
choice_select_prompt
|
Optional[PromptTemplate]
|
A Choice-Select Prompt
(see :ref: |
None
|
choice_batch_size
|
int
|
The number of nodes to query at a time. |
10
|
format_node_batch_fn
|
Optional[Callable]
|
A function that formats a batch of nodes. |
None
|
parse_choice_select_answer_fn
|
Optional[Callable]
|
A function that parses the choice select answer. |
None
|
Source code in llama_index/core/indices/list/retrievers.py
146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 | |
SummaryIndexRetriever #
Bases: BaseRetriever
Simple retriever for SummaryIndex that returns all nodes.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
index
|
SummaryIndex
|
The index to retrieve from. |
required |
Source code in llama_index/core/indices/list/retrievers.py
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 | |
BasePGRetriever #
Bases: BaseRetriever
The base class for property graph retrievers.
By default, will retrieve nodes from the graph store and add source text to the nodes if needed.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
graph_store
|
PropertyGraphStore
|
The graph store to retrieve data from. |
required |
include_text
|
bool
|
Whether to include source text in the retrieved nodes. Defaults to True. |
True
|
include_text_preamble
|
Optional[str]
|
The preamble to include before the source text. Defaults to DEFAULT_PREAMBLE. |
DEFAULT_PREAMBLE
|
Source code in llama_index/core/indices/property_graph/sub_retrievers/base.py
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 | |
add_source_text #
add_source_text(nodes: List[NodeWithScore]) -> List[NodeWithScore]
Combine retrieved nodes/triplets with their source text.
Source code in llama_index/core/indices/property_graph/sub_retrievers/base.py
123 124 125 126 127 128 129 130 | |
async_add_source_text
async
#
async_add_source_text(nodes: List[NodeWithScore]) -> List[NodeWithScore]
Combine retrieved nodes/triplets with their source text.
Source code in llama_index/core/indices/property_graph/sub_retrievers/base.py
132 133 134 135 136 137 138 139 140 141 | |
retrieve_from_graph
abstractmethod
#
retrieve_from_graph(query_bundle: QueryBundle) -> List[NodeWithScore]
Retrieve nodes from the labelled property graph.
Source code in llama_index/core/indices/property_graph/sub_retrievers/base.py
155 156 157 158 | |
aretrieve_from_graph
abstractmethod
async
#
aretrieve_from_graph(query_bundle: QueryBundle) -> List[NodeWithScore]
Retrieve nodes from the labelled property graph.
Source code in llama_index/core/indices/property_graph/sub_retrievers/base.py
160 161 162 163 164 165 | |
CustomPGRetriever #
Bases: BasePGRetriever
A retriever meant to be easily subclassed to implement custom retrieval logic.
The user only has to implement:
- init to initialize the retriever and assign any necessary attributes.
- custom_retrieve to implement the custom retrieval logic.
- aretrieve_custom (optional) to implement asynchronous retrieval logic.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
graph_store
|
PropertyGraphStore
|
The graph store to retrieve data from. |
required |
include_text
|
bool
|
Whether to include text in the retrieved nodes. Only works for kg nodes inserted by LlamaIndex. |
False
|
**kwargs
|
Any
|
Additional keyword arguments passed to init(). |
{}
|
Source code in llama_index/core/indices/property_graph/sub_retrievers/custom.py
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 | |
init
abstractmethod
#
init(**kwargs: Any) -> None
Initialize the retriever.
Has access to all keyword arguments passed to the retriever, as well as:
- self.graph_store: The graph store to retrieve data from.
- `self.include_text``: Whether to include text in the retrieved nodes.
Source code in llama_index/core/indices/property_graph/sub_retrievers/custom.py
52 53 54 55 56 57 58 59 60 61 | |
custom_retrieve
abstractmethod
#
custom_retrieve(query_str: str) -> CUSTOM_RETRIEVE_TYPE
Retrieve data from the graph store based on the query string.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
query_str
|
str
|
The query string to retrieve data for. |
required |
Returns:
| Type | Description |
|---|---|
CUSTOM_RETRIEVE_TYPE
|
The retrieved data. The return type can be one of: |
CUSTOM_RETRIEVE_TYPE
|
|
CUSTOM_RETRIEVE_TYPE
|
|
CUSTOM_RETRIEVE_TYPE
|
|
CUSTOM_RETRIEVE_TYPE
|
|
CUSTOM_RETRIEVE_TYPE
|
|
CUSTOM_RETRIEVE_TYPE
|
|
Source code in llama_index/core/indices/property_graph/sub_retrievers/custom.py
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 | |
acustom_retrieve
async
#
acustom_retrieve(query_str: str) -> CUSTOM_RETRIEVE_TYPE
Asynchronously retrieve data from the graph store based on the query string.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
query_str
|
str
|
The query string to retrieve data for. |
required |
Returns:
| Type | Description |
|---|---|
CUSTOM_RETRIEVE_TYPE
|
The retrieved data. The return type can be one of: |
CUSTOM_RETRIEVE_TYPE
|
|
CUSTOM_RETRIEVE_TYPE
|
|
CUSTOM_RETRIEVE_TYPE
|
|
CUSTOM_RETRIEVE_TYPE
|
|
CUSTOM_RETRIEVE_TYPE
|
|
CUSTOM_RETRIEVE_TYPE
|
|
Source code in llama_index/core/indices/property_graph/sub_retrievers/custom.py
83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 | |
CypherTemplateRetriever #
Bases: BasePGRetriever
A Cypher retriever that fills in params for a cypher query using an LLM.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
graph_store
|
PropertyGraphStore
|
The graph store to retrieve data from. |
required |
output_cls
|
Type[BaseModel]
|
The output class to use for the LLM. Should contain the params needed for the cypher query. |
required |
cypher_query
|
str
|
The cypher query to use, with templated params. |
required |
llm
|
Optional[LLM]
|
The language model to use. Defaults to Settings.llm. |
None
|
Source code in llama_index/core/indices/property_graph/sub_retrievers/cypher_template.py
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 | |
LLMSynonymRetriever #
Bases: BasePGRetriever
A retriever that uses a language model to expand a query with synonyms. The synonyms are then used to retrieve nodes from a property graph.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
graph_store
|
PropertyGraphStore
|
The graph store to retrieve data from. |
required |
include_text
|
bool
|
Whether to include source text in the retrieved nodes. Defaults to True. |
True
|
synonym_prompt
|
Union[BasePromptTemplate, str]
|
The template to use for the synonym expansion query. Defaults to DEFAULT_SYNONYM_EXPAND_TEMPLATE. |
DEFAULT_SYNONYM_EXPAND_TEMPLATE
|
max_keywords
|
int
|
The maximum number of synonyms to generate. Defaults to 10. |
10
|
path_depth
|
int
|
The depth of the path to retrieve for each node. Defaults to 1 (i.e. a triple). |
1
|
output_parsing_fn
|
Optional[callable]
|
A callable function to parse the output of the language model. Defaults to None. |
None
|
llm
|
Optional[LLM]
|
The language model to use. Defaults to Settings.llm. |
None
|
Source code in llama_index/core/indices/property_graph/sub_retrievers/llm_synonym.py
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 | |
PGRetriever #
Bases: BaseRetriever
A retriever that uses multiple sub-retrievers to retrieve nodes from a property graph.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sub_retrievers
|
List[BasePGRetriever]
|
The sub-retrievers to use. |
required |
num_workers
|
int
|
The number of workers to use for async retrieval. Defaults to 4. |
4
|
use_async
|
bool
|
Whether to use async retrieval. Defaults to True. |
True
|
show_progress
|
bool
|
Whether to show progress bars. Defaults to False. |
False
|
Source code in llama_index/core/indices/property_graph/retriever.py
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 | |
TextToCypherRetriever #
Bases: BasePGRetriever
A Text-to-Cypher retriever that uses a language model to generate Cypher queries.
NOTE: Executing arbitrary cypher has its risks. Ensure you take the needed measures (read-only roles, sandboxed env, etc.) to ensure safe usage in a production environment.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
graph_store
|
PropertyGraphStore
|
The graph store to retrieve data from. |
required |
llm
|
Optional[LLM]
|
The language model to use. Defaults to Settings.llm. |
None
|
text_to_cypher_template
|
Optional[Union[PromptTemplate, str]]
|
The template to use for the text-to-cypher query. Defaults to None. |
None
|
response_template
|
Optional[str]
|
The template to use for the response. Defaults to None. |
None
|
cypher_validator
|
Optional[callable]
|
A callable function to validate the generated Cypher query. Defaults to None. |
None
|
allowed_query_fields
|
Optional[List[str]]
|
The fields to allow in the query output. Defaults to ["text", "label", "type"]. |
required |
include_raw_response_as_metadata
|
Optional[bool]
|
If True this will add the query and raw response data to the metadata property. Defaults to False. |
False
|
summarize_response
|
Optional[bool]
|
If True this will run the response through the provided LLM to create a more human readable response, If False this uses the provided or default response_template. Defaults to False. |
False
|
summarization_template
|
Optional[str]
|
The template to use for summarizing the response. Defaults to None. |
None
|
Source code in llama_index/core/indices/property_graph/sub_retrievers/text_to_cypher.py
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 | |
VectorContextRetriever #
Bases: BasePGRetriever
A retriever that uses a vector store to retrieve nodes based on a query.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
graph_store
|
PropertyGraphStore
|
The graph store to retrieve data from. |
required |
include_text
|
bool
|
Whether to include source text in the retrieved nodes. Defaults to True. |
True
|
embed_model
|
Optional[BaseEmbedding]
|
The embedding model to use. Defaults to Settings.embed_model. |
None
|
vector_store
|
Optional[BasePydanticVectorStore]
|
The vector store to use. Defaults to None. Should be supplied if the graph store does not support vector queries. |
None
|
similarity_top_k
|
int
|
The number of top similar kg nodes to retrieve. Defaults to 4. |
4
|
path_depth
|
int
|
The depth of the path to retrieve for each node. Defaults to 1 (i.e. a triple). |
1
|
similarity_score
|
float
|
The minimum similarity score to retrieve the nodes. Defaults to None. |
None
|
Source code in llama_index/core/indices/property_graph/sub_retrievers/vector.py
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 | |
NLSQLRetriever #
Bases: BaseRetriever, PromptMixin
Text-to-SQL Retriever.
Retrieves via text.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sql_database
|
SQLDatabase
|
SQL database. |
required |
text_to_sql_prompt
|
BasePromptTemplate
|
Prompt template for text-to-sql. Defaults to DEFAULT_TEXT_TO_SQL_PROMPT. |
None
|
context_query_kwargs
|
dict
|
Mapping from table name to context query. Defaults to None. |
None
|
tables
|
Union[List[str], List[Table]]
|
List of table names or Table objects. |
None
|
table_retriever
|
ObjectRetriever[SQLTableSchema]
|
Object retriever for SQLTableSchema objects. Defaults to None. |
None
|
rows_retriever
|
Dict[str, VectorIndexRetriever]
|
a mapping between table name and a vector index retriever of its rows. Defaults to None. |
required |
context_str_prefix
|
str
|
Prefix for context string. Defaults to None. |
None
|
return_raw
|
bool
|
Whether to return plain-text dump of SQL results, or parsed into Nodes. |
True
|
handle_sql_errors
|
bool
|
Whether to handle SQL errors. Defaults to True. |
True
|
sql_only (bool)
|
Whether to get only sql and not the sql query result. Default to False. |
required | |
llm
|
Optional[LLM]
|
Language model to use. |
None
|
Source code in llama_index/core/indices/struct_store/sql_retriever.py
179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 | |
retrieve_with_metadata #
retrieve_with_metadata(str_or_query_bundle: QueryType) -> Tuple[List[NodeWithScore], Dict]
Retrieve with metadata.
Source code in llama_index/core/indices/struct_store/sql_retriever.py
301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 | |
aretrieve_with_metadata
async
#
aretrieve_with_metadata(str_or_query_bundle: QueryType) -> Tuple[List[NodeWithScore], Dict]
Async retrieve with metadata.
Source code in llama_index/core/indices/struct_store/sql_retriever.py
349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 | |
SQLParserMode #
Bases: str, Enum
SQL Parser Mode.
Source code in llama_index/core/indices/struct_store/sql_retriever.py
118 119 120 121 122 | |
SQLRetriever #
Bases: BaseRetriever
SQL Retriever.
Retrieves via raw SQL statements.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sql_database
|
SQLDatabase
|
SQL database. |
required |
return_raw
|
bool
|
Whether to return raw results or format results. Defaults to True. |
True
|
Source code in llama_index/core/indices/struct_store/sql_retriever.py
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 | |
retrieve_with_metadata #
retrieve_with_metadata(str_or_query_bundle: QueryType) -> Tuple[List[NodeWithScore], Dict]
Retrieve with metadata.
Source code in llama_index/core/indices/struct_store/sql_retriever.py
73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 | |
TreeAllLeafRetriever #
Bases: BaseRetriever
GPT all leaf retriever.
This class builds a query-specific tree from leaf nodes to return a response. Using this query mode means that the tree index doesn't need to be built when initialized, since we rebuild the tree for each query.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
text_qa_template
|
Optional[BasePromptTemplate]
|
Question-Answer Prompt
(see :ref: |
required |
Source code in llama_index/core/indices/tree/all_leaf_retriever.py
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 | |
TreeSelectLeafEmbeddingRetriever #
Bases: TreeSelectLeafRetriever
Tree select leaf embedding retriever.
This class traverses the index graph using the embedding similarity between the query and the node text.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
query_template
|
Optional[BasePromptTemplate]
|
Tree Select Query Prompt
(see :ref: |
None
|
query_template_multiple
|
Optional[BasePromptTemplate]
|
Tree Select
Query Prompt (Multiple)
(see :ref: |
None
|
text_qa_template
|
Optional[BasePromptTemplate]
|
Question-Answer Prompt
(see :ref: |
None
|
refine_template
|
Optional[BasePromptTemplate]
|
Refinement Prompt
(see :ref: |
None
|
child_branch_factor
|
int
|
Number of child nodes to consider at each level. If child_branch_factor is 1, then the query will only choose one child node to traverse for any given parent node. If child_branch_factor is 2, then the query will choose two child nodes. |
1
|
embed_model
|
Optional[BaseEmbedding]
|
Embedding model to use for embedding similarity. |
None
|
Source code in llama_index/core/indices/tree/select_leaf_embedding_retriever.py
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 | |
TreeSelectLeafRetriever #
Bases: BaseRetriever
Tree select leaf retriever.
This class traverses the index graph and searches for a leaf node that can best answer the query.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
query_template
|
Optional[BasePromptTemplate]
|
Tree Select Query Prompt
(see :ref: |
None
|
query_template_multiple
|
Optional[BasePromptTemplate]
|
Tree Select
Query Prompt (Multiple)
(see :ref: |
None
|
child_branch_factor
|
int
|
Number of child nodes to consider at each level. If child_branch_factor is 1, then the query will only choose one child node to traverse for any given parent node. If child_branch_factor is 2, then the query will choose two child nodes. |
1
|
Source code in llama_index/core/indices/tree/select_leaf_retriever.py
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 | |
TreeRootRetriever #
Bases: BaseRetriever
Tree root retriever.
This class directly retrieves the answer from the root nodes.
Unlike GPTTreeIndexLeafQuery, this class assumes the graph already stores the answer (because it was constructed with a query_str), so it does not attempt to parse information down the graph in order to synthesize an answer.
Source code in llama_index/core/indices/tree/tree_root_retriever.py
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 | |
VectorIndexAutoRetriever #
Bases: BaseAutoRetriever
Vector store auto retriever.
A retriever for vector store index that uses an LLM to automatically set vector store query parameters.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
index
|
VectorStoreIndex
|
vector store index |
required |
vector_store_info
|
VectorStoreInfo
|
additional information about vector store content and supported metadata filters. The natural language description is used by an LLM to automatically set vector store query parameters. |
required |
prompt_template_str
|
Optional[str]
|
custom prompt template string for LLM. Uses default template string if None. |
None
|
similarity_top_k
|
int
|
number of top k results to return. |
DEFAULT_SIMILARITY_TOP_K
|
empty_query_top_k
|
Optional[int]
|
number of top k results to return if the inferred query string is blank (uses metadata filters only). Can be set to None, which would use the similarity_top_k instead. By default, set to 10. |
10
|
max_top_k
|
int
|
the maximum top_k allowed. The top_k set by LLM or similarity_top_k will be clamped to this value. |
10
|
vector_store_query_mode
|
str
|
vector store query mode See reference for VectorStoreQueryMode for full list of supported modes. |
DEFAULT
|
default_empty_query_vector
|
Optional[List[float]]
|
default empty query vector. Defaults to None. If not None, then this vector will be used as the query vector if the query is empty. |
None
|
callback_manager
|
Optional[CallbackManager]
|
callback manager |
None
|
verbose
|
bool
|
verbose mode |
False
|
Source code in llama_index/core/indices/vector_store/retrievers/auto_retriever/auto_retriever.py
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 | |
VectorIndexRetriever #
Bases: BaseRetriever
Vector index retriever.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
index
|
VectorStoreIndex
|
vector store index. |
required |
similarity_top_k
|
int
|
number of top k results to return. |
DEFAULT_SIMILARITY_TOP_K
|
vector_store_query_mode
|
str
|
vector store query mode See reference for VectorStoreQueryMode for full list of supported modes. |
DEFAULT
|
filters
|
Optional[MetadataFilters]
|
metadata filters, defaults to None |
None
|
alpha
|
float
|
weight for sparse/dense retrieval, only used for hybrid query mode. |
None
|
doc_ids
|
Optional[List[str]]
|
list of documents to constrain search. |
None
|
vector_store_kwargs
|
dict
|
Additional vector store specific kwargs to pass through to the vector store at query time. |
required |
Source code in llama_index/core/indices/vector_store/retrievers/retriever.py
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 | |
AutoMergingRetriever #
Bases: BaseRetriever
This retriever will try to merge context into parent context.
The retriever first retrieves chunks from a vector store. Then, it will try to merge the chunks into a single context.
Source code in llama_index/core/retrievers/auto_merging_retriever.py
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 | |
QueryFusionRetriever #
Bases: BaseRetriever
Source code in llama_index/core/retrievers/fusion_retriever.py
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 | |
RecursiveRetriever #
Bases: BaseRetriever
Recursive retriever.
This retriever will recursively explore links from nodes to other retrievers/query engines.
For any retrieved nodes, if any of the nodes are IndexNodes, then it will explore the linked retriever/query engine, and query that.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
root_id
|
str
|
The root id of the query graph. |
required |
retriever_dict
|
Optional[Dict[str, BaseRetriever]]
|
A dictionary of id to retrievers. |
required |
query_engine_dict
|
Optional[Dict[str, BaseQueryEngine]]
|
A dictionary of id to query engines. |
None
|
Source code in llama_index/core/retrievers/recursive_retriever.py
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 | |
retrieve_all #
retrieve_all(query_bundle: QueryBundle) -> Tuple[List[NodeWithScore], List[NodeWithScore]]
Retrieve all nodes.
Unlike default retrieve method, this also fetches additional sources.
Source code in llama_index/core/retrievers/recursive_retriever.py
212 213 214 215 216 217 218 219 220 221 | |
RouterRetriever #
Bases: BaseRetriever
Router retriever.
Selects one (or multiple) out of several candidate retrievers to execute a query.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
selector
|
BaseSelector
|
A selector that chooses one out of many options based on each candidate's metadata and query. |
required |
retriever_tools
|
Sequence[RetrieverTool]
|
A sequence of candidate retrievers. They must be wrapped as tools to expose metadata to the selector. |
required |
Source code in llama_index/core/retrievers/router_retriever.py
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 | |
TransformRetriever #
Bases: BaseRetriever
Transform Retriever.
Takes in an existing retriever and a query transform and runs the query transform before running the retriever.
Source code in llama_index/core/retrievers/transform_retriever.py
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 | |
options: members: - QueryFusionRetriever