How khadir-syed/k_ai-basics works
k_ai-basics is a collection of ten self-contained, runnable AI concept demos, not a shared framework. The main workflow is to choose a demo, provide an example or your own input, and inspect its explanation or output in a terminal or browser. The demos cover tokenization, retrieval, tool use and routing, context limits, hallucination, prompt design and injection, PII redaction, and agent handoffs. Browser pages run demo code locally through Pyodide; some terminal demos also offer optional live-LLM modes. Browser wiring is sampled for several demos and otherwise follows the README’s stated browser capability.
Main entry points: web Browser Runners · ask.py Document Retrieval · router.py Skill Routing · compare.py Hallucination Comparison
Components 15
Core AI Concepts
- Tokenization
01-tokenizer-playground/run.py - Document Retrieval
02-mini-rag/ask.py - Agent Trace
03-agent-trace/trace.py - Skill Routing
04-router-playground/router.py - Context Window
05-context-window/explore.py
Reliability And Agents
- Hallucination Comparison
06-hallucination-demo/compare.py - Prompt Playground
07-prompt-playground/playground.py - Injection Demo
08-prompt-injection/inject.py - PII Redaction
09-pii-redaction/redact.py - Agent Handoff
10-multi-agent-handoff/handoff.py
Browser Experience
- Browser Demo Index
web/index.html - Browser Runners
web
Optional AI
- LLM Helper
02-mini-rag/llm.py
Other components
- Learner
- AI Service
Connections 29
- Learner → Browser Demo Index: opens
- Browser Demo Index → Browser Runners: offers demos
- Browser Runners → Tokenization: runs locally
- Browser Runners → Document Retrieval: runs locally
- Browser Runners → Agent Trace: runs locally
- Browser Runners → Skill Routing: runs locally
- Browser Runners → Context Window: runs locally
- Browser Runners → Hallucination Comparison: runs locally
- Browser Runners → Prompt Playground: runs locally
- Browser Runners → Injection Demo: runs locally
- Browser Runners → PII Redaction: runs locally
- Browser Runners → Agent Handoff: runs locally
- Learner → Tokenization: runs CLI
- Learner → Document Retrieval: runs CLI
- Learner → Agent Trace: runs CLI
- Learner → Skill Routing: runs CLI
- Learner → Context Window: runs CLI
- Learner → Hallucination Comparison: runs CLI
- Learner → Prompt Playground: runs CLI
- Learner → Injection Demo: runs CLI
- Learner → PII Redaction: runs CLI
- Learner → Agent Handoff: runs CLI
- Document Retrieval → LLM Helper: optional request
- Skill Routing → AI Service: optional routing
- Hallucination Comparison → AI Service: optional answer
- Prompt Playground → AI Service: optional answers
- Injection Demo → AI Service: optional agent
- Agent Handoff → AI Service: optional agents
- LLM Helper → AI Service: sends prompt