RAG LLM¶
- Setting up the retrival and using Lanchain APIs
Modify LLM Chain¶
- At the moment the LLM chain is a retriver, if you want to add functionality, you will need to modify the
LLMChainInitializer
function. - To change the way vectorstore is used, modify the
QASetup
function. - To change the way Ollama works, caching works and add generation and stuff, modify the
LLMChainCreator
function.
LLMChainCreator
¶
Description: Gets Ollama, sends query, enables query caching
Source code in backend/modules/rag_llm.py
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 |
|
enable_cache()
¶
Description: Enable a cache for queries to prevent running the same query again for no reason.
Source code in backend/modules/rag_llm.py
103 104 105 106 107 108 109 110 111 |
|
get_llm_chain()
¶
Description: Send a query to Ollama using the paths.
Source code in backend/modules/rag_llm.py
93 94 95 96 97 98 99 100 101 |
|
LLMChainInitializer
¶
Description: Setup the vectordb (Chroma) as a retriever with parameters
Source code in backend/modules/rag_llm.py
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
|
QASetup
¶
Description: Setup the VectorDB, QA and initalize the LLM for each type of data
Source code in backend/modules/rag_llm.py
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 |
|