Inside MIKAI: How Retrieval-Augmented Generation (RAG) Makes Medical AI Reliable

Artificial intelligence in medicine must never guess.

When a doctor asks a question about a new diabetes guideline or a rare endocrine disorder, the answer must be accurate, transparent, and backed by data.

This is where Retrieval-Augmented Generation (RAG) becomes the foundation of reliability in MIKAI, our evolving medical AI system.

MIKAI’s mission is to learn continuously from trusted sources — guidelines, journals, and local knowledge — while always showing where the information comes from.

RAG is the method that allows this to happen.

🧠 What Is RAG?

RAG stands for Retrieval-Augmented Generation, a hybrid approach that combines two powerful components:

1. Retrieval — Searching a curated knowledge base for the most relevant documents.

2. Generation — Using a language model (like Mistral, LLaMA, or Magistral) to synthesize a natural-language answer from those retrieved facts.

Instead of relying purely on what’s inside the model’s parameters, RAG adds a real-time “memory” layer — a document store — where verified information is indexed and retrieved when needed.

This is crucial in medical use: guidelines update yearly, research evolves monthly, and each case may depend on local context.

With RAG, MIKAI can stay current without retraining the entire model.

🩺 Why RAG Matters for Medical Reliability

Traditional large language models (LLMs) like GPT or Mistral learn by pattern recognition — they generate fluent text but can “hallucinate” if the information isn’t in their training data.

In medicine, that’s unacceptable.

If an AI suggests an incorrect insulin dose or confuses a diagnostic criterion, it could cause harm.

In MIKAI, every response — from “best management of diabetic ketoacidosis” to “latest thyroid cancer guidelines” — is backed by retrieved excerpts from the medical literature stored locally and encrypted for security.

⚙️ The MIKAI RAG Pipeline: Step-by-Step

Here’s a simplified version of how RAG works inside MIKAI.

    +----------------+
    |  User Query    |
    +--------+-------+
             |
             v
  +----------+-----------+
  |  Retrieval Component |
  | (Vector DB / RAG DB) |
  +----------+-----------+
             |
             v
  +----------+-----------+
  |  LLM Generator (Mistral,|
  |  Magistral, or Llama)   |
  +----------+-----------+
             |
             v
     +-------+-------+
     | Final Answer  |
     | + Sources     |
     +---------------+

Let’s break down each part as implemented in MIKAI.

1. Document Ingestion

The ingestion pipeline is where MIKAI learns from trusted data.

Medical sources — PDF guidelines, research articles, textbooks, or hospital documents — are scanned, chunked, vectorized, and indexed.

Example:

When you upload the “2025 ADA Standards of Care in Diabetes”, MIKAI automatically:

• Extracts text using PyMuPDF or LangChain PDF loader

• Splits long paragraphs into manageable chunks (e.g., 512–1024 tokens)

• Embeds each chunk into a high-dimensional vector using SentenceTransformers or InstructorXL

• Stores the vectors in a Qdrant or FAISS database, linked with metadata (title, author, source date)

Each chunk becomes a searchable “knowledge atom” — small, precise, and encrypted

MIKAI’s local setup on Linux (with /opt/mikai/ SSD storage) keeps all ingested documents physically separated from the LLM runtime — ensuring data integrity and portability.

2. 

Retrieval

When a user asks, for example,

“What is the recommended HbA1c target for elderly diabetic patients according to ADA 2025?”

MIKAI doesn’t guess.

The retriever converts this query into a vector embedding and compares it to all stored chunks in the database using cosine similarity.

The top-ranked results (usually 3–5 chunks) are passed to the LLM as context.

This is the “grounding” process — the LLM only generates text based on verified, retrieved facts.

3. 

Generation

Once the context is retrieved, it’s injected into the prompt template.

Answer:

According to the ADA 2025 Standards, HbA1c targets for elderly patients should be individualized.

• Healthy older adults: <7.5%

• Frail or limited life expectancy: <8%

Sources: ADA 2025 Standards of Care, Section 13.

That’s RAG in action — retrieval ensures reliability, and generation ensures readability.

🔒 Encryption and Security

Medical AI must safeguard data as strongly as it serves it.

MIKAI employs multi-layer encryption across its RAG pipeline:

1. Database Encryption

• All vector stores and metadata in MariaDB/Qdrant are encrypted using AES-256.

• Access keys are stored in a local .env file not exposed via the web tunnel.

2. Transport Encryption

• When MIKAI communicates through a Cloudflare tunnel or API, all traffic is TLS 1.3 secured.

• No raw data or vector payloads are ever sent to public endpoints.

3. Local Sandboxing

• MIKAI runs its ingestion and inference services in Docker containers under –privileged=false mode.

• User-uploaded files never leave the /opt/mikai/ingest directory.

4. Optional Hash Verification

• Each ingested document is SHA-256 hashed.

• On retrieval, MIKAI verifies the hash to confirm that no tampering occurred.

This ensures data authenticity, a core principle for medical compliance and trustworthiness.

🧩 The Memory and Feedback Layer

In addition to the RAG database, MIKAI integrates a memory manager that records interactions and feedback.

Conversations are stored in two layers:

  • Session memory – temporary chat history within the active conversation.
  • Global memory – only high-rated or “approved” responses are promoted here.

This dual memory system lets MIKAI gradually learn from verified human feedback while maintaining strict separation between transient chat and permanent knowledge.

If a doctor flags an answer as correct (feedback = 5), that response is re-indexed into the RAG database — expanding MIKAI’s contextual reliability.

🧩 Example: Endocrine Case Consultation

Let’s imagine a real clinical scenario inside MIKAI’s chat:

Doctor:

A 68-year-old male with type 2 diabetes and mild cognitive impairment.

What is the ADA 2025 recommendation for HbA1c target?

Step 1:

Query embedding → Retrieval from ADA 2025 document store.

Step 2:

Top 3 text chunks retrieved from “Older Adults” section.

Step 3:

Prompt + context fed into Magistral-24B model.

Step 4:

Generated response (grounded in sources) displayed in the chat UI.

Step 5:

Doctor clicks 👍 “reliable” → stored into global_memory.

Later, another user’s query on the same topic retrieves both the ADA citation and MIKAI’s own verified explanation — forming a dynamic, ever-improving knowledge graph.

💽 Continuous Ingestion and Update

Medical science evolves daily, and MIKAI’s ingestion pipeline is built for continuous learning.

Every week or month, new PDFs or journal summaries can be placed into /opt/mikai/new_docs/.

RAG Reliability Metrics

To quantify reliability, MIKAI tracks several internal metrics:

  • Context precision: How many retrieved chunks are relevant
  • Answer faithfulness: Whether the LLM introduces unverified claims
  • Source transparency: Whether all statements cite retrievable sources
  • User feedback scores: Average confidence rating from doctors

For example, MIKAI’s current test on ADA-based queries yields:

MetricScore
Context precision94%
Faithfulness97%
Source transparency100%
User confidence4.8 / 5

These results show how retrieval + encryption + human feedback together make RAG trustworthy in clinical environments.

🌐 Deployment: From Local to Cloud-Linked

MIKAI primarily runs locally on Linux, with GPU acceleration via Tesla P40 and an RX 580 display card.

However, through Cloudflare Tunnels, it can safely expose a mini chat interface to the web for remote testing.

The system’s modular architecture keeps critical components separate

This separation supports high performance, strong privacy, and quick debugging when new models or sources are added.

🧭 The Philosophy: Reliable AI Through Grounded Knowledge

RAG isn’t just a technique — it’s a philosophy.

For medical AI like MIKAI, reliability doesn’t come from bigger models alone.

It comes from:

1. Grounded data – each answer built upon verified context.

2. Transparency – every citation traceable.

3. Security – encryption and local control.

4. Adaptability – continuous ingestion and feedback learning.

In this sense, MIKAI is more than a chatbot — it’s a digital medical librarian fused with a reasoning engine.

It remembers, retrieves, reasons, and respects confidentiality — the same way a good physician treats knowledge and patient trust.

The Future of Medical AI: Transforming Healthcare in the Age of Intelligent Machines

Medical AI is reshaping the way doctors and patients interact with medicine. The integration of algorithms, vast health datasets, and machine learning has brought us closer to an era where AI becomes a true partner to human clinicians.

What is Medical AI?

Medical AI refers to the use of machine learning algorithms, natural language processing (NLP), and advanced data analytics to analyze health information and assist in clinical decision-making. Unlike traditional software that follows predefined rules, AI systems can “learn” from large datasets of medical records, images, lab results, and even real-time patient monitoring devices.

The goal is not to replace doctors, but to augment human intelligence, reduce errors, and improve efficiency. By handling repetitive tasks and analyzing vast volumes of information quickly, AI enables physicians to focus on what they do best: caring for patients.

Key Applications of Medical AI

1. 

Medical Imaging and Diagnostics

AI has achieved remarkable accuracy in detecting diseases from medical images. Algorithms trained on thousands of X-rays, MRIs, or CT scans can identify subtle patterns often invisible to the human eye. For example:

  • Detecting lung nodules in chest CT scans for early lung cancer diagnosis.
  • Identifying diabetic retinopathy in retinal photographs.
  • Spotting brain hemorrhages or strokes on emergency CT scans within seconds.

In some cases, AI systems match or even surpass radiologists in diagnostic performance, especially when used as a second reader.

2. 

Predictive Analytics and Risk Stratification

By analyzing electronic health records (EHRs) and real-world patient data, AI can predict which patients are at risk of complications. Hospitals already use predictive models to:

  • Anticipate sepsis before symptoms fully develop.
  • Identify high-risk cardiac patients.
  • Forecast readmission rates, helping hospitals allocate resources more efficiently.

Such predictive insights allow preventive interventions, potentially saving lives and reducing costs.

3. 

Drug Discovery and Development

Traditional drug development is costly and time-consuming, often taking more than a decade. AI accelerates this process by:

  • Analyzing biological data to identify promising drug targets.
  • Running virtual simulations of molecular interactions.
  • Predicting potential side effects before clinical trials.

During the COVID-19 pandemic, AI helped researchers rapidly scan existing drugs for possible repurposing, demonstrating its real-world utility.

4. 

Virtual Health Assistants and Chatbots

AI-powered virtual assistants can guide patients through symptom checking, appointment scheduling, medication reminders, and even lifestyle coaching. For example:

  • A diabetic patient may receive personalized reminders to check blood sugar.
  • A post-surgery patient might get daily follow-up questions to track recovery progress.

When integrated with EHRs, these assistants become even more powerful, providing context-aware advice.

5. 

Natural Language Processing in Medicine

Much of medicine is buried in unstructured data—physician notes, discharge summaries, or academic journals. AI-driven NLP tools can:

  • Extract key information from clinical notes.
  • Summarize patient histories automatically.
  • Enable better search and knowledge retrieval for doctors.

This reduces documentation burden and makes critical information accessible at the right time.

6. 

Robotics and AI-assisted Surgery

Robotic systems already assist surgeons in precision tasks. With AI integration, these robots can learn from thousands of prior surgeries to provide real-time guidance, reduce tremors, and enhance surgical accuracy. Surgeons remain in control, but AI acts as a co-pilot.

Benefits of Medical AI

  1. Improved Accuracy – Reducing diagnostic errors, one of the leading causes of preventable harm.
  2. Efficiency – Automating routine tasks frees up doctors’ time.
  3. Personalization – Tailoring treatments to genetic, lifestyle, and environmental factors.
  4. Accessibility – AI tools can deliver medical expertise to underserved or rural areas.
  5. Cost Savings – Earlier diagnosis and efficient resource allocation reduce healthcare costs.

Challenges and Limitations

Despite its promise, medical AI faces important challenges:

  • Data Privacy and Security: Patient data is sensitive; robust safeguards are essential.
  • Bias in Algorithms: AI trained on biased datasets may produce inequitable outcomes (e.g., underdiagnosing minorities).
  • Regulation and Validation: Medical AI must undergo rigorous clinical validation before adoption.
  • Integration with Clinical Workflow: Doctors may resist tools that disrupt established routines.
  • Trust and Transparency: Physicians and patients need explainable AI, not “black box” decisions.

These challenges highlight the importance of developing AI responsibly, with both ethical and clinical considerations in mind.

The Human-AI Partnership

The question often arises: Will AI replace doctors? The answer, for the foreseeable future, is no. Medicine involves empathy, context, and judgment that machines cannot replicate. Instead, the most powerful model is a collaboration where AI handles data-heavy analysis, while doctors bring human insight, compassion, and ethical decision-making.

A practical vision is:

  • AI as the assistant – suggesting diagnoses, flagging anomalies, or offering treatment options.
  • Doctor as the decision-maker – validating insights, considering patient values, and making the final call.

Together, this partnership enhances both safety and patient care.

The Evolution of MIKAI: How We Built a Smarter RAG-Powered AI Assistant

When I first set out to build MIKAI, my goal was simple: a personal AI assistant capable of managing medical knowledge, learning from interactions, and providing intelligent responses in Thai and English. But achieving that goal demanded more than just a large language model — it required memory, context, reasoning, and the ability to pull in external knowledge when needed. That’s where the Retrieval-Augmented Generation (RAG) methodology came in.

The Early Days: Memory Without Structure

In the beginning, MIKAI relied on basic local memory and a single LLM. The model could answer questions based on its training, but it struggled with continuity across sessions and nuanced technical queries. I realized that without a structured way to recall prior conversations and integrate external sources, MIKAI would hallucinate or repeat mistakes.

The first iteration used a Postgres database with pgvector for storing embeddings of past interactions. Every user query was embedded, and cosine similarity was used to pull semantically similar prior exchanges. This approach gave MIKAI a sense of continuity — it could “remember” previous sessions — but there were limitations. Embeddings alone cannot capture subtle medical nuances, and context retrieval often included irrelevant or redundant information.

Introducing the RAG Pipeline

To address these challenges, we implemented a full RAG pipeline. At its core, MIKAI now uses a hybrid system: a combination of local memory (Postgres/pgvector) and external knowledge bases (via Qdrant) to provide answers grounded in both past experience and curated content.

The pipeline begins with Query Preprocessing. Using front_llm.sharpen_query(query), MIKAI cleans and rewrites incoming questions while detecting the user’s language. This ensures that ambiguous queries are clarified before retrieval.

Next comes Embedding + Memory Retrieval. The sharpened query is converted into a vector embedding (self.embeddings.embed_query) and compared against session and global memory using memory_manager.retrieve_similar(). This allows MIKAI to fetch the most semantically relevant past interactions.

For external knowledge, Retriever Manager queries Qdrant collections based on keywords and context. For instance, if a user asks about a rare endocrine disorder, MIKAI identifies the appropriate collection (data_kb, hospital guidelines, research articles) and retrieves top-matching documents. Deduplication ensures that the top-3 documents are formatted into concise snippets for context fusion.

Context Fusion and Professor Mode

A crucial innovation in MIKAI is Context Fusion. Instead of simply concatenating memory and external documents, the system merges:

  • Previous bot responses and user turns from local memory.
  • Retrieved documents from Qdrant.
  • Optional condensed summaries generated via memory_manager.condense_memory().

This combined context then enters Professor Mode, an extra reasoning layer (llm_manager.run_professor_mode()) where the model structures and interprets the context before generating a final answer. This step ensures that MIKAI doesn’t just regurgitate text but synthesizes a coherent response grounded in all available knowledge.

Finally, LLM Answer Generation (llm_manager.generate_rag_response) produces the answer. Clean-up steps remove repeated phrases, and optional back-translation ensures consistency if the query is not in English. If local memory or external knowledge fails to provide sufficient context, MIKAI can run a Web Search Fallback via DuckDuckGo, integrating the results into a regenerated answer.

Strengths of MIKAI’s RAG Approach

This pipeline has several notable strengths:

  • Dual Memory System: By combining local memory with external knowledge bases, MIKAI balances continuity with factual accuracy.
  • Condensation Step: Reduces irrelevant context and prevents context overflow in long conversations.
  • Professor Mode: Adds reasoning and structure, transforming raw data into coherent, context-aware answers.
  • Web Fallback: Ensures coverage even when the knowledge base lacks specific information.
  • Importance Scoring & Scopes: Allows prioritization of critical knowledge over less relevant information.

These features make MIKAI more robust than a standard LLM and help maintain reliability in medical or technical domains.

Challenges and Limitations

Despite these strengths, the current system isn’t perfect:

  • Embedding-Only Retrieval: Cosine similarity can drift for nuanced queries, potentially retrieving partially relevant memories.
  • Echoing Past Mistakes: Using prior bot answers as context can propagate errors.
  • Context Injection Gaps: generate_rag_response() currently seems to receive only the query, not the fully curated context, which may bypass context fusion benefits.
  • Shallow Deduplication: Only compares first 200 characters of documents, risking subtle repetition.
  • No Re-Ranking Across Sources: Memory and KB results are joined but not scored against each other for relevance.

Addressing these limitations will require passing the final fused context into the generation step, adding a re-ranking layer (e.g., BM25 or cross-encoder), and separating bot memory from external documents to prevent hallucinations.

MIKAI RAG in Practice

In practical use, MIKAI’s RAG system allows multiturn medical consultations, Thai-English language support, and intelligent reasoning over both past interactions and curated external knowledge. A patient can ask about leg edema, for example, and MIKAI retrieves previous session history, relevant hospital documents, and research articles, fusing them into a coherent explanation. If needed, it can augment its answer with a web search.

This pipeline has also enabled continuous learning. Every interaction is stored with embeddings and metadata (session/global/correction), allowing MIKAI to refine its memory, track repetition, and avoid redundant or low-quality responses over time.

The Road Ahead

Looking forward, the next steps for MIKAI involve:

  • Ensuring final context injection into the generation step.
  • Adding cross-source re-ranking to select the most relevant information.
  • Improving deduplication and similarity scoring.
  • Expanding external knowledge integration beyond Qdrant to include specialized medical databases and real-time research feeds.

The goal is to make MIKAI a fully reliable, continuously learning assistant that synthesizes knowledge across multiple modalities and timeframes.

Conclusion

From its early days as a simple memory-enabled LLM to today’s RAG-powered, professor-mode-enhanced assistant, MIKAI’s journey reflects the evolution of AI beyond static knowledge. By combining embeddings, vector databases, context fusion, reasoning layers, and web fallback, MIKAI demonstrates how a thoughtful RAG system can transform an LLM into a domain-aware, multiturn, multilingual assistant.

While challenges remain — especially around context injection and re-ranking — the framework is robust enough to provide continuity, accuracy, and intelligent reasoning in complex domains like medicine. As MIKAI continues to evolve, it promises to become an indispensable companion for knowledge work, patient consultation, and dynamic learning.

Building MIKAI: The Journey of Developing a Doctor’s Own AI Language Model

Artificial intelligence has moved from the realm of science fiction into our daily lives, from virtual assistants on our phones to sophisticated diagnostic systems in hospitals. But the real power of AI lies not only in global corporations but also in the hands of individuals and small teams who dare to build something personal, purposeful, and transformative.

This is the story of MIKAI — short for Medical Intelligence + Kijakarn’s AI — a custom-built large language model (LLM) designed not by a tech giant, but by a practicing doctor who wanted to bring the future of medical knowledge into his own clinic.

Why Build My Own LLM?

The motivation behind MIKAI began with a simple but pressing reality: modern medicine evolves at an overwhelming pace. Every month, hundreds of new clinical studies, guidelines, and case reports are published. No single human can possibly read them all, much less apply them efficiently to patient care.

Commercial AI systems, like ChatGPT, are useful but limited:

• They lack up-to-date knowledge in rapidly advancing fields like endocrinology.

• They are black boxes with no control over how data is handled or filtered.

• They cannot be customized deeply for specific workflows in a private clinic.

As an endocrinologist, I wanted an assistant who could:

1. Continuously learn from medical corpora, guidelines, and journals.

2. Provide safe, accurate, and evidence-based answers.

3. Integrate with my practice — handling patient documentation, translation, RAG-based search, and structured data management.

4. Evolve under my guidance, not under the roadmap of a distant tech company.

That vision gave birth to MIKAI.

Early Foundations: From Off-the-Shelf to Self-Built

Like most AI builders, I didn’t start from scratch. The initial steps were exploratory: testing models like Mistral, LLaMA, Falcon, and GPT-NeoX. Each had strengths, but none were tailored for the medical domain.

The first true breakthrough came with Mistral 7B Instruct, running locally on my workstation. I used llama.cpp to deploy it without requiring cloud servers, ensuring data privacy. At this stage, MIKAI was more of a “mini research assistant” than a doctor’s aide, but the potential was clear.

To make the system practical, I introduced Retrieval-Augmented Generation (RAG):

• A document store for medical PDFs, journals, and clinical guidelines.

• A retrieval pipeline that allows MIKAI to quote and reason from real references.

• A separation of chat history vs. global medical memory, ensuring clean, contextual responses.

This architecture laid the groundwork for MIKAI as a knowledge-augmented medical assistant.

Building the AI Rig: Hardware for a Personal LLM

Running LLMs isn’t just about clever software — it’s also about serious hardware. For MIKAI, I built a custom AI rig that balances affordability with power:

Dual Xeon CPUs, 64GB RAM for multitasking.

Nvidia Tesla P40 (24GB VRAM) as the main AI accelerator.

Radeon RX 580 for display.

Ubuntu dual-boot with Hackintosh Clover for flexibility.

This setup allows me to experiment with models ranging from 7B to 24B parameters, running quantized versions (Q4/Q5) that fit within GPU memory. On the software side, I use:

CUDA 12.4 for GPU acceleration.

Dockerized services for portability.

MariaDB for structured storage of conversations, tokens, and medical notes.

The result is a doctor’s personal AI workstation — a private lab where I can test, train, and fine-tune models without depending on corporate servers.

The RAG Layer: Teaching MIKAI to Learn Continuously

One of the core challenges with LLMs is stale knowledge. A model trained in 2023 won’t automatically know the 2025 ADA Diabetes Guidelines or a paper published last week.

That’s where RAG (Retrieval-Augmented Generation) comes in. For MIKAI, I designed a two-layer memory system:

1. Session-based memory — keeps track of conversations for contextual flow.

2. Global medical memory — updated with feedback and curated sources.

Here’s how it works in practice:

• I upload a new guideline PDF (e.g., ADA 2025 Standards of Diabetes Care).

• MIKAI parses it, indexes it into the vector database.

• When I ask a clinical question, MIKAI first retrieves relevant passages before generating an answer.

This means MIKAI doesn’t just hallucinate — it answers with citations and context, much like a real medical resident preparing for rounds.

From Mini Chat to Doctor’s Assistant

MIKAI’s interface started as a basic local chat. Over time, I expanded it into a multi-functional workspace:

Mini Chat Widget: Embeddable on websites like doctornuke.com.

Patient File System: Auto-generates structured medical forms from scanned documents or speech-to-text dictations.

Multilingual Support: Translates medical guidelines into Thai while preserving technical terms.

Secure Access: Two-step authentication and Cloudflare tunneling for remote use.

These features transform MIKAI from “just a chatbot” into a practical clinic assistant that handles real workflows.

Training, Fine-Tuning, and Safety

No medical AI is useful if it’s unsafe. A careless answer can put a patient at risk. That’s why I’ve built MIKAI with multiple safety layers:

Filtering out unreliable tokens (e.g., scam coins in blockchain experiments, or low-quality sources in medical data).

Developer blacklists for AI models trained with misleading content.

Automatic detection of hallucinations by comparing generated answers to retrieved sources.

Fine-tuning via LoRA (Low-Rank Adaptation) on curated medical datasets.

For larger-scale training experiments, I’m preparing to test Magistral 24B QLoRA — a balance between accuracy and local hardware feasibility (24GB VRAM).

The goal is clear: MIKAI should never give “guesses” in medicine. It must either retrieve evidence, admit uncertainty, or point to guidelines.

The Challenges Along the Way

Building MIKAI hasn’t been easy. The journey has been full of technical hurdles:

GPU memory limits: Fitting 20–24B parameter models on a 24GB card requires careful quantization.

Prompt management: Ensuring clean separation of user queries, context, and RAG inputs to avoid “prompt leaks.”

Performance tuning: Balancing speed vs. accuracy (tokens per second vs. depth of reasoning).

UI/UX design: Creating a modern chat interface with session management and retrieval panes.

But every obstacle has also been an opportunity to refine the system.

Where MIKAI Stands Today

Today, MIKAI is no longer just an experiment — it’s a functioning assistant that helps in real-world tasks:

Answers complex medical questions with evidence from current guidelines.

Generates structured medical notes from speech or scanned files.

Runs privately on local hardware with full data control.

Supports multilingual translation for medical literature.

Embeds into websites for sharing knowledge beyond the clinic.

It’s not perfect — but it’s growing, learning, and adapting every week.

The Future of MIKAI

Where does MIKAI go next? The roadmap is ambitious:

1. Self-Learning LoRA: Allowing MIKAI to continuously fine-tune on newly retrieved data.

2. Medical QA Benchmarking: Comparing MIKAI’s answers against mainstream LLMs for accuracy.

3. Patient Integration: Building a secure, lightweight mobile app for patient-clinic communication.

4. AI Collaboration: Connecting MIKAI with other open-source AI agents (Whisper for voice, Stable Diffusion for visuals, etc.).

5. Scalable Training: Testing larger models (20–30B) with quantization strategies to push accuracy further.

Ultimately, the goal isn’t just to have “my own ChatGPT.” It’s to have a personal, evolving, trustworthy medical partner — one that grows alongside my practice and improves patient care.

Reflections: A Doctor Building AI

MIKAI is more than just an LLM project. It represents a philosophy of empowerment: that doctors, researchers, and independent builders don’t have to wait for corporations to solve their problems.

We can build our own tools.

We can take control of AI.

We can shape it for real-world needs, not generic use cases.

For me, MIKAI is not the end of a journey — it’s just the beginning. And as it grows, it reminds me daily of why I became a doctor: not only to treat patients, but also to improve the systems that support their care.

The future of medicine won’t be written only in journals or hospitals. It will also be written in the labs, clinics, and laptops of doctors and builders worldwide. And MIKAI is my contribution to that future.

seo ai

SEO and AI why I put them together?

SEO and AI why I put them together?

Search Engine Optimization (SEO) and Artificial Intelligence (AI) can be tied and syncronize to make a wonderful result.

How AI help SEO

AI can Improve outcome of SEO as follow:

1. Content Creation and Optimization

  • AI Content Writing Tools: Tools like ChatGPT, Jasper AI, or Writesonic will help us to create good content quickly and readability is okey , if properly rewrite.
  • Content Analysis: AI can use tool to analyze the content , either readability and density of keywords..
  • Topic Generation: Good AI can suggest trending topics based on search engine trend , user preference , intent and data.

2. Keyword Research

  • AI tools like SEMRush, Ahrefs, and Surfer SEO trained the AI and utilize the high-performing keywords.
  • The AI can help us to forecast the keywords ( from data) and place the suitable ones.

3. Voice Search Optimization

  • AI enables better understanding of natural language queries, a key element in voice search.
  • Optimizing content for conversational search (e.g., “Where can I find organic coffee near me?”) can be easier to made with AI tools.

4. Search Intent Analysis

  • AI algorithms can interpret user intent more effectively, categorizing searches into informational, navigational, or transactional intent, creating targeted content for better rankings.

5. Website and Technical SEO

  • Site Audits: AI-powered platforms like Screaming Frog or DeepCrawl identify issues like broken links, duplicate content, and also optimize for speed.
  • Page Speed Optimization: can suggest or implement fixes to improve Core Web Vitals (e.g., reducing page load times).
  • Schema Markup: automatically generate structured data, making it easier for search engines to understand your site.

6. Rank Tracking and Analysis

  • Monitor rankings in real time and analyze fluctuations to identify underlying causes.
  • Predictive AI can also estimate future ranking performance based on current efforts.

7. User Experience (UX) Optimization

  • Track user behavior on websites, such as bounce rates, time on page, and click patterns.
  • Improve site navigation, layout, and design to enhance the user experience.

How SEO Enhances AI

  1. Training AI Models:
    • SEO data (keywords, queries, and trends) trains AI models to improve their understanding of human search behavior.
    • This ensures AI tools generate more relevant content.
  2. Providing Structured Data:
    • SEO efforts like schema markup improve data quality, helping AI tools understand and leverage website content effectively.
  3. User Intent Alignment:
    • AI systems rely on SEO insights to stay aligned with evolving search intent and user preferences.

Applications of AI in SEO

1. AI-Powered SEO Tools

  • Content Creation & Optimization: Tools like Surfer SEO and MarketMuse analyze data and suggest content improvements.
  • Keyword Research: AI-driven platforms (e.g., RankIQ) identify untapped keyword opportunities.
  • Link Building: AI can find high-authority backlink opportunities or automate outreach processes.

2. Voice Search and Conversational AI

  • As voice search continues to grow, optimizing for conversational queries becomes critical. AI assists in crafting content that answers such queries.

3. AI-Powered Search Engines

  • Search engines like Google use AI algorithms (e.g., RankBrain, MUM) to provide more accurate results based on user intent. Understanding these algorithms can help refine SEO strategies.

4. Chatbots for Engagement

  • AI chatbots can improve user engagement on websites, indirectly benefiting SEO by reducing bounce rates and increasing time spent on-site.

Challenges in AI and SEO Co-Existence

  1. Over-Optimization Risks:
    • Relying too heavily on AI-generated content might lead to generic or overly optimized content that fails to engage users.
  2. Search Algorithm Updates:
    • AI-driven SEO strategies must adapt to frequent changes in search engine algorithms (e.g., Google’s Helpful Content Update).
  3. Data Privacy and Ethics:
    • AI tools using search data must respect user privacy, ensuring compliance with regulations like GDPR.

Future of AI and SEO Co-Existence

  1. Hyper-Personalization:
    • AI will help tailor SEO strategies to individual user preferences and search behaviors.
  2. AI-Augmented Creativity:
    • While AI handles data-driven aspects of SEO, human creativity will ensure content remains unique and engaging.
  3. Evolving Search Engines:
    • AI will continue to shape search engines (e.g., generative AI in search results), requiring SEO professionals to adapt their strategies.
doctornuke_AI

What is Agency AI?

What is Agency or Agentic AI?

Agency AI of Agentic AI refers to artificial intelligence systems that exhibit a degree of autonomy, goal-setting, and decision-making in executing tasks or achieving objectives. These systems are designed to act as “agents” that can interact with their environment, make choices, and pursue specific goals based on their programming and learned experiences.

Here’s a detailed breakdown of Agency AI and its role in the AI hierarchy:


What is Agency AI?

  1. Autonomy:
    • Agency AI operates independently within its environment.
    • It does not require constant human intervention to perform tasks.
    • Example: Autonomous drones or robots navigating complex terrains.
  2. Goal-Oriented Behavior:
    • Agency AI systems are designed to achieve specific outcomes.
    • They can prioritize tasks, adapt strategies, and refine their actions to meet objectives.
    • Example: A stock-trading AI that adjusts its trading strategy in real-time based on market trends.
  3. Perception and Action Loop:
    • These systems perceive the environment (using sensors, cameras, or other inputs), process the data, and take actions to influence the environment.
    • Example: AI-powered virtual assistants like Siri or Google Assistant that respond to user queries and execute commands.

Types of Agency AI

  1. Reactive Agents (Basic Agency):
    • Respond to stimuli in real-time without internal memory or learning capabilities.
    • Example: Pac-Man AI that reacts to ghosts and pellets in the game.
  2. Deliberative Agents (Goal-Oriented):
    • Use internal models to plan and execute actions.
    • Can assess the consequences of their actions to make decisions.
    • Example: A chess-playing AI like AlphaZero that plans moves based on the game’s state.
  3. Learning Agents:
    • Capable of improving their performance over time by learning from their experiences.
    • Combine perception, action, and adaptation for better decision-making.
    • Example: Self-driving cars that learn from millions of miles driven.
  4. Multi-Agent Systems:
    • Multiple agents interact, collaborate, or compete to achieve goals.
    • Often used in simulations, distributed AI, or swarm robotics.
    • Example: AI systems coordinating logistics in a warehouse.

Characteristics of Agency AI

  • Adaptability: Can adjust to changing environments or situations.
  • Decision-Making: Evaluates options and chooses the most suitable course of action.
  • Learning: May incorporate machine learning to refine actions based on outcomes.
  • Interaction: Communicates with humans, other agents, or systems in its environment.

Examples of Agency AI in the Real World

  1. Autonomous Vehicles:
    • Perceive the environment using sensors.
    • Make decisions about speed, direction, and obstacle avoidance.
    • Operate without direct human input.
  2. Robotic Process Automation (RPA):
    • Automates repetitive tasks in industries like finance and healthcare.
    • Acts as an “agent” performing tasks like data entry, invoice processing, or customer support.
  3. AI-Powered Chatbots:
    • Interact with users autonomously to resolve queries, book appointments, or assist in e-commerce.
  4. Smart Assistants:
    • Devices like Amazon Alexa or Google Nest that act as agents to control smart home devices and provide information.
  5. Gaming AI:
    • Characters or agents in video games that autonomously respond to player actions and dynamically adapt strategies.

Agency AI in the AI Hierarchy

Agency AI spans across all levels of the AI hierarchy (ANI, AGI, and ASI):

  1. ANI Level:
    • Basic reactive and deliberative agents operating within narrow domains.
    • Example: A delivery drone that follows a specific route.
  2. AGI Level:
    • More advanced agents capable of general-purpose tasks.
    • Example: A personal AI that understands and adapts to the full spectrum of a user’s needs.
  3. ASI Level (Theoretical):
    • Superintelligent agents with complete autonomy and the ability to set goals, solve problems, and innovate beyond human capabilities.
    • Example: A global AI system optimizing resources to prevent climate change.

Potential Concerns with Agency AI

  • Ethical Risks: Misaligned goals or unintended consequences.
  • Control Issues: Autonomous agents acting beyond intended boundaries.
  • Security Threats: Vulnerabilities to hacking or misuse.

artificial car

The hierarchy of Artificial Intelligence (AI)

The hierarchy of Artificial Intelligence (AI) is typically structured in layers or levels that reflect the scope and complexity of intelligence and its development. Here’s an overview of the hierarchy of AI:

1. Artificial Narrow Intelligence (ANI)

  • Definition: Also known as Weak AI, this is AI specialized in performing a single task or a set of related tasks.
  • Examples:
    • Voice Assistants (e.g., Siri, Alexa)
    • Recommendation systems (e.g., Netflix, Spotify)
    • Chatbots and virtual assistants
    • Image and speech recognition systems
  • Characteristics:
    • Task-specific
    • Cannot generalize beyond its programming
    • Most AI systems today fall into this category.

2. Artificial General Intelligence (AGI)

  • Definition: Also known as Strong AI, this level of AI possesses the ability to understand, learn, and perform any intellectual task that a human can do.
  • Examples:
    • Hypothetical systems (currently no real-world examples)
    • Human-like cognitive systems
  • Characteristics:
    • Can generalize knowledge across multiple domains
    • Can think, reason, and adapt like a human
    • Still under research and development.

3. Artificial Superintelligence (ASI)

  • Definition: This is the hypothetical stage where AI surpasses human intelligence in all respects, including creativity, problem-solving, and emotional intelligence.
  • Examples:
    • None (currently theoretical)
  • Characteristics:
    • Exceeds human capabilities across all domains
    • Possesses independent reasoning, decision-making, and innovation
    • Often associated with existential risks (e.g., potential misuse or loss of control).

Supporting Hierarchical Layers in AI Systems:

1. Core AI Technologies

  • Machine Learning (ML): The ability to learn from data (e.g., supervised, unsupervised, reinforcement learning).
  • Deep Learning: A subset of ML using neural networks with multiple layers to process data (e.g., image and speech processing).
  • Natural Language Processing (NLP): Understanding and generating human language (e.g., ChatGPT).

2. Data Layers

  • Data Collection: Raw data is gathered from various sources.
  • Data Preprocessing: Cleaning, organizing, and preparing data for training models.

3. Infrastructure Layers

  • Hardware: CPUs, GPUs, and specialized hardware (e.g., TPUs).
  • Frameworks: TensorFlow, PyTorch, Keras, etc.
  • Cloud Platforms: AWS, Google Cloud, Microsoft Azure, etc.

4. Application Layer

  • AI-powered solutions applied in industries like healthcare, finance, entertainment, and transportation.

Example of AI Hierarchy in Practice (Use Case: Autonomous Vehicles):

  1. ANI Level: Specific tasks like object detection, lane following, and traffic sign recognition.
  2. AGI Level (Future): A car capable of driving in any environment, adapting to unpredictable conditions like a human driver.
  3. ASI Level (Theoretical): A system that designs smarter traffic systems, optimizes global transportation, and anticipates future needs autonomously.
fake doctor

Reels and Short Content: A Challenge for AI and Information Quality in Thailand

Reels and Short Content: A Challenge for AI and Information Quality in Thailand

Over the next five years, the prevalence of short content such as reels and clips is likely to impact the quality and type of data that AI can utilize in Thailand.

Content Quality

The landscape of content creation has shifted dramatically. Previously, high-quality content was typically produced by experts deeply specialized in their fields—engineers, doctors, or professionals with formal education in communication or other disciplines. However, with the rise of social media platforms like Facebook, TikTok, and YouTube over the past decade, content creation has become accessible to anyone. This shift has led to a flood of content that often lacks depth, originality, or copyright infringement.

A concerning trend is the prevalence of individuals pretending to be professionals, offering in-depth reviews or expert opinions while copying or misrepresenting copyrighted material.

Information Shallowness

In Thailand, social media’s focus on entertainment has led to a shallow consumption of information. Content that emphasizes humor, sensationalism, or emotional appeal tends to dominate over thoughtful, educational, or in-depth discussions. This often includes:

  • Superficial Sharing: Users frequently share headlines or partial information without fully engaging with the content.
  • Misinformation: The spread of fake news, misinterpretations, or unverified information without proper references is rampant.

This shallowness diminishes critical thinking and analytical skills, particularly in areas requiring careful consideration, such as medical or life-related knowledge. Short, incomplete data often prioritizes engagement over accuracy, contributing to a decline in deep learning.

Content Copying

Copyright infringement has become a widespread issue in the transition from traditional web platforms to social media. This includes:

  • Direct Copying: Republishing articles, images, or videos without proper credit to the creators.
  • Slight Modifications: Altering text or visuals slightly while retaining the original ideas.
  • Monetized Copying: Using stolen content to generate revenue, such as reposting clips on platforms like TikTok or YouTube to maximize views or promote products.

This practice discourages original creators, reduces creativity, and leads to the repetition of low-value content. Many creators abandon originality to mimic trends, further saturating social media with repetitive and shallow material.

Platform Responsibility

Social media platforms play a significant role in shaping content trends. Algorithms often prioritize engagement metrics over quality, favoring viral or entertaining content over informative or insightful material. For example, Facebook, TikTok, and Instagram frequently promote short reels or live sales, while informative posts struggle to gain visibility.

This focus undermines creators aiming to provide high-quality, in-depth content, as they are often overshadowed by clickbait and low-effort material.

Solutions and Management Strategies

  1. For Individuals:
    • Encourage the creation of sustainable, “evergreen” content that remains relevant and valuable over time, akin to planting long-lasting trees.
    • Foster critical thinking skills among users to discern credible content from shallow or fake information.
  2. For Platforms:
    • Develop AI tools to detect and reduce redundant, copied, or low-quality content.
    • Adjust algorithms to prioritize high-quality, informative posts over shallow or purely entertaining material.
    • Implement stricter filters to prevent AI from learning and perpetuating low-quality or plagiarized content.
  3. For Society and Government:
    • Launch digital literacy programs to educate the public on distinguishing real from fake information and encourage creative content production.
    • Enforce copyright laws more rigorously to deter online infringement.

Final Thoughts

Although it is challenging to align financial incentives with high-quality content creation, small steps can make a difference. By filtering algorithms to discourage shallow content and encouraging platforms to support originality, we can foster a more informed and creative digital space in Thailand. Governments, platforms, and users all have a role to play in promoting a culture of meaningful and responsible content creation.