How vinukj/microbi-bot works
Microbi-Agri Bot is a Streamlit assistant that gives farmers conversational, personalized organic-farming advice. Farmers enter questions and farming interests; the app retrieves relevant PDF knowledge, generates an answer, and displays the conversation. Its knowledge base can be extended by uploading or manually placing documents, converting Word files to PDFs, and indexing extracted text in Chroma. The README also describes online-resource search, though the sampled code does not establish its implementation. Edges reflect sampled calls or documented workflows; reindexing is a separate maintenance path.
Main entry points: reindex.py Full reindex · ui2.py Incremental ingestion · tempfolder PDF collection · custom_loaders.py PDF text extraction
Components 19
Farmer interaction
- Streamlit app
ui2.py - Farm profile and language
ui2.py - Chat and history
ui2.py
Knowledge ingestion
- Document uploads
ui2.py - Word documents
worddocs - Word-to-PDF conversion
convert_docs_to_pdf.py - PDF collection
tempfolder - Incremental ingestion
ui2.py - PDF text extraction
custom_loaders.py - Text chunking
ui2.py - Cohere embeddings
ui2.py - Chroma knowledge base
ui2.py
Answer generation
- Relevant context retrieval
ui2.py - Retrieval QA
ui2.py - Cohere response generation
ui2.py - Online resources
Index maintenance
- Full reindex
reindex.py - Processed-file tracker
.processed_pdfs.json
Other components
- Farmer
Connections 30
- Farmer → Streamlit app: asks questions
README.md - Streamlit app → Farm profile and language: collects interests
README.md - Streamlit app → Chat and history: accepts and displays
ui2.py - Streamlit app → Document uploads: offers upload
README.md - Document uploads → Word documents: saves Word files
README.md - Document uploads → PDF collection: saves PDFs
README.md - Word documents → Word-to-PDF conversion: converts
README.md - Word-to-PDF conversion → PDF collection: writes PDFs
convert_docs_to_pdf.py - Document uploads → Incremental ingestion: processes new PDF
ui2.py - PDF collection → Incremental ingestion: checks new PDFs
README.md - Incremental ingestion → PDF text extraction: loads PDF text
ui2.py - PDF text extraction → Text chunking: returns page text
custom_loaders.py - Incremental ingestion → Text chunking: splits documents
ui2.py - Text chunking → Cohere embeddings: vectorizes chunks
README.md - Incremental ingestion → Chroma knowledge base: adds documents
ui2.py - Cohere embeddings → Chroma knowledge base: indexes vectors
README.md - Chat and history → Retrieval QA: submits query
ui2.py - Retrieval QA → Relevant context retrieval: gets relevant context
ui2.py - Relevant context retrieval → Chroma knowledge base: searches knowledge
README.md - Retrieval QA → Cohere response generation: generates answer
README.md - Farm profile and language → Cohere response generation: sets response language
ui2.py - Cohere response generation → Chat and history: returns response
ui2.py - Retrieval QA → Online resources: may search
README.md - Full reindex → PDF collection: reads PDFs
reindex.py - Full reindex → PDF text extraction: loads PDF text
reindex.py - Full reindex → Text chunking: splits documents
reindex.py - Full reindex → Cohere embeddings: creates embeddings
reindex.py - Full reindex → Chroma knowledge base: recreates index
reindex.py - Incremental ingestion → Processed-file tracker: records processed files
README.md - Full reindex → Processed-file tracker: rewrites tracker
reindex.py