# LangFlow Chain-based Architecture ### Components: 1. **LLM Chain** ([ref](https://python.langchain.com/docs/modules/chains/foundational/llm_chain)) This is the basic LLM chain which use LLM to ask something with a certain prompt. The implementation of this component in the LangFlow is `[ADV] LLM Chain`, `[ADV] Output Parser` (Optional), and regular `PromptTemplate` ![image](https://hackmd.io/_uploads/ryTIHp0B6.png) You can chain this chain with the other chains by connecting the output to the next `Previous Chain`'s chain input. This applies to the other basic chain components. 2. **Custom Python Function / Transform Chain** ([ref](https://python.langchain.com/docs/modules/chains/foundational/transformation)) This is a custom Python function of transformation chain. This chain **should not use LLM**. The purpose of this chain is to have a special function (e.g. call an API and get the data, change the input to a certain command for the next chain, mapping the result of the previous chain, etc.). The implementation of this component in the LangFlow is `[ADV] Python Function Chain` and `[ADV] Python Function` ![image](https://hackmd.io/_uploads/SJxHB6Rrp.png) You always need to connect the `Python Function` input of `[ADV] Python Function Chain` to `[ADV] Python Function` output. You will write the custom python function inside `[ADV] Python Function`'s' `Code` input. The function will receive `Input Variable` and output `Output Variable` as the key name. You need to match the output variable to the next chain's input variable. In short, any return value of the function will be wrapped inside a dictionary with `Output Variable` as the key name. 3. **Simple Sequential Wrapper** ([ref](https://python.langchain.com/docs/modules/chains/foundational/sequential_chains)) This custom component will help to wrap all of your chains (sequence of chains) into a single chain component. This will make all of the chains runnable, else it will not be runnable. ![image](https://hackmd.io/_uploads/Hk86L60Sa.png) Just simply connect the last chain output to `Serial Chains` input of `[ADV] Sequential Wrapper`, and you are good to go.