Bootstrap hong_kb_bot: educational LLM chatbot repo with docs, reusable package, and practice notebooks#1
Draft
MacroMagic with Copilot wants to merge 2 commits into
Draft
Bootstrap hong_kb_bot: educational LLM chatbot repo with docs, reusable package, and practice notebooks#1MacroMagic with Copilot wants to merge 2 commits into
MacroMagic with Copilot wants to merge 2 commits into
Conversation
Agent-Logs-Url: https://github.com/MacroMagic/hong_kb_bot/sessions/d9ba29b4-32e2-4765-bb6e-f85df56d33dd Co-authored-by: MacroMagic <162652138+MacroMagic@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Create repo for building a chat bot using LLM models in Python
Bootstrap hong_kb_bot: educational LLM chatbot repo with docs, reusable package, and practice notebooks
Apr 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Builds the repo from scratch as a step-by-step learning resource for engineering a Python chatbot with open-source LLMs, structured for a future Phase 2 RAG/knowledge-base upgrade.
Package (
src/hong_kb_bot/)config.py—BotConfigviapydantic-settings; env-driven, supports HuggingFace / OpenAI / local (Ollama) providers with all generation hyperparameters (temperature,top_p,max_new_tokens, etc.)memory.py— three interchangeable strategies sharingBaseMemory:BufferMemory(keep all),WindowMemory(last k turns),SummaryMemory(LLM-compressed old context)chatbot.py— provider-agnosticChatbot; dispatches to HF Inference API, OpenAI, or any OpenAI-compatible local server._build_context()is a deliberate no-op stub — Phase 2 drops a retriever in there without touching anything elseDocumentation (
docs/)01_overview.md— learning objectives, guiding principles02_llm_options.md— detailed comparison of OpenAI API / HF Inference API / local transformers / Ollama / LangChain with code examples, trade-off table, and decision guide03_architecture.md— component breakdown with ASCII diagrams; explains stateless LLM calls, token budget, and the Phase 2 retrieval hook04_roadmap.md— Phase 2 RAG plan: ingestion pipeline, retriever design, embedding model choices, vector store options (FAISS vs ChromaDB vs Pinecone)Notebooks (
notebooks/)Five sequential Jupyter notebooks designed for hands-on practice:
01_hello_llmfinish_reason, temperature effect02_huggingface_basicstop_p/top_k/repetition_penalty, side-by-side model comparison03_conversation_memory04_prompt_engineering05_rag_foundationsRetrieverpreviewTests (
tests/)29 unit tests (all LLM calls mocked — no API keys required): 14 for memory strategies, 15 for
Chatbotincluding multi-turn history accumulation, provider dispatch, and config validation.Original prompt