An RAG Model based on StrainsDB. The Database for the project was provided by Kenneth Reitz.
- The SQLite DataBase consisted of 19 tables from which the
strains_strain
table was extracted.- Solution: extract data using SQLite module and create a
Strain
class (that inheritspydantic.BaseModel
) for data validation
- Solution: extract data using SQLite module and create a
- Then the table's data cells consisted of lists in string format which needed to be converted back
- Solution:
eval("[1, 2, 3]")
returns[1, 2, 3]
- Solution:
- The data needs to be saved.
- Solution: dump data in JSON format.
- The Data was embedded into ChromaDB (persistent client) using the
OpenAIEmbeddings
function.- Solution:
OpenAIEmbeddings
function from thelangchain_openai
package.
- Solution:
- The data was retrieved from the ChromaDB using the
Chroma
class.