{"id":48617921,"url":"https://github.com/hsleonis/llama3_qa_chatbot_mongodb","last_synced_at":"2026-04-09T02:13:08.755Z","repository":{"id":212730720,"uuid":"732177370","full_name":"hsleonis/llama3_qa_chatbot_mongodb","owner":"hsleonis","description":"Llama3 in MongoDB: Conversational QA App with Langchain + Ollama + MongoDB + Streamlit. ","archived":false,"fork":false,"pushed_at":"2025-08-09T12:32:33.000Z","size":1303,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-21T07:42:53.277Z","etag":null,"topics":["chatbot","chatgpt","deep-learning","langchain","large-language-models","llama2","llama3","machine-learning","mongodb","natural-language-processing","ollama","openai","python","streamlit"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hsleonis.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-12-15T21:00:20.000Z","updated_at":"2025-08-19T08:59:25.000Z","dependencies_parsed_at":"2025-08-17T09:44:59.390Z","dependency_job_id":null,"html_url":"https://github.com/hsleonis/llama3_qa_chatbot_mongodb","commit_stats":{"total_commits":24,"total_committers":1,"mean_commits":24.0,"dds":0.0,"last_synced_commit":"eb9ace13f26791dca8dd06a4c99ddca0d449e9c9"},"previous_names":["hsleonis/llama2_qa_chatbot_mongodb"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/hsleonis/llama3_qa_chatbot_mongodb","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hsleonis%2Fllama3_qa_chatbot_mongodb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hsleonis%2Fllama3_qa_chatbot_mongodb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hsleonis%2Fllama3_qa_chatbot_mongodb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hsleonis%2Fllama3_qa_chatbot_mongodb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hsleonis","download_url":"https://codeload.github.com/hsleonis/llama3_qa_chatbot_mongodb/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hsleonis%2Fllama3_qa_chatbot_mongodb/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31096918,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-28T11:37:01.486Z","status":"ssl_error","status_checked_at":"2026-03-28T11:36:50.178Z","response_time":79,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["chatbot","chatgpt","deep-learning","langchain","large-language-models","llama2","llama3","machine-learning","mongodb","natural-language-processing","ollama","openai","python","streamlit"],"created_at":"2026-04-09T02:13:08.623Z","updated_at":"2026-04-09T02:13:08.735Z","avatar_url":"https://github.com/hsleonis.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Llama3 in MongoDB: Conversational QA App\nA conversational chat interface where users can interact with the `Llama-3` language model, and the conversation history is logged in `MongoDB` for future reference.\n\n\u003cimg src=\"QAapp.png\" width=\"650px\" /\u003e\n\n## Features:\n\n1. **Language Model Integration**:\n        The app integrates the `Llama-3` language model (LLM) for natural language processing. The model is initialized with a specified `Ollama` model and a callback manager for handling streaming standard output.\n\n2. **User Interface**:\n        The app's user interface is created using `Streamlit`. Users can input messages through the chat input interface. User messages are displayed in the chat, and the messages are added to the chat history.\n\n3. **Chat Initialization**:\n        The app starts with an initial prompt in the chat in `Langchain`, displaying a greeting message. The chat history is initialized if it doesn't exist in the session state.\n\n4. **MongoDB Integration**:\n        The app connects to `MongoDB`'s `Atlas` server. It retrieves the collection name and displays chat messages from the database on app rerun. The messages are fetched and displayed in the chat history container.\n\n5. **Response Processing**:\n        The app processes user input by obtaining a response from the Ollama language model. The response is then displayed in the chat interface, and the messages are added to the chat history.\n\n6. **Streaming Simulation**:\n        The app simulates the streaming of the AI's response with a spinner to indicate processing. It adds a delay to simulate a more dynamic chat experience.\n\n7. **MongoDB Logging**:\n        All user and AI messages are inserted into the `MongoDB` collection for logging and retrieval.\n\n## Demo:\n\u003cimg src=\"demo.png\" width=\"650px\" /\u003e\n\n## How to use\n1. Install requirements:\n```python\npip install -r requirements.txt\n```\n2. Install and run Ollama:\nhttps://python.langchain.com/docs/integrations/llms/ollama\n3. Fetch a model via `ollama pull \u003cmodel family\u003e`\ne.g., for Llama 3: \n```python\nollama pull llama3\n```\n4. Place your Environment variables in the `.env` file.\n5. Run the app:\n```python\nstreamlit run app.py\n```\n5. Visit http://localhost:8501 on your browser.\n\n## Links:\n1. **LangChain**: https://python.langchain.com/docs/get_started/introduction\n2. **Ollama**: https://ollama.ai/library/codellama\n3. **MongoDB**: https://www.mongodb.com\n4. **Streamlit**: https://streamlit.io\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhsleonis%2Fllama3_qa_chatbot_mongodb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhsleonis%2Fllama3_qa_chatbot_mongodb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhsleonis%2Fllama3_qa_chatbot_mongodb/lists"}