Zing Forum

Reading

Pharmacy Agentic AI: A Multi-Agent-Driven Digital Pharmacist System

An end-to-end AI pharmacist built with FastAPI, FAISS, and Ollama, integrating semantic search, OCR prescription recognition, and multi-agent orchestration

Agentic AI多智能体系统语义搜索OCR医疗AIFAISSOllama
Published 2026-05-02 00:45Recent activity 2026-05-02 00:56Estimated read 7 min
Pharmacy Agentic AI: A Multi-Agent-Driven Digital Pharmacist System
1

Section 01

Introduction: Pharmacy Agentic AI, a Multi-Agent-Driven Digital Pharmacist System

Pharmacy Agentic AI is an end-to-end digital pharmacist system built with FastAPI, FAISS, and Ollama. It implements functions such as semantic search, OCR prescription recognition, health consultation, and order management through multi-agent orchestration. It addresses the pain points of traditional pharmacy operations, such as heavy workload and high service pressure on pharmacists, and demonstrates the practical application value of Agentic AI in the vertical medical field.

2

Section 02

Project Background: Pain Points and Needs of Traditional Pharmacy Operations

In traditional pharmacies, pharmacists need to handle multiple high-proficiency tasks simultaneously, such as medication consultation, prescription review, drug search, and inventory management, which are labor-intensive and require high concentration. With the aging population and the increase in chronic disease patients, the service pressure on pharmacies continues to rise. This project addresses these pain points by using AI technology to build a digital pharmacist system that automatically understands queries, intelligently searches for drugs, recognizes prescriptions, and manages order processes.

3

Section 03

System Architecture and Tech Stack: End-to-End Design with Multi-Agent Collaboration

The system adopts a multi-agent architecture, where a central orchestrator coordinates professional agents such as semantic search agents, LLM assistant agents, and prescription scanning agents to collaborate. The tech stack includes mature tools like FastAPI (web framework), SQLAlchemy (ORM), FAISS (vector retrieval), Sentence Transformers (text embedding), Ollama (local LLM), EasyOCR (prescription recognition), Langfuse (observability), and Whisper (speech-to-text).

4

Section 04

Core Functions: Intelligent Semantic Search, Prescription Recognition, and Multimodal Interaction

  1. Intelligent Semantic Drug Search: Implemented with FAISS vector indexing and Sentence Transformers for semantic understanding, supporting fuzzy matching. For example, inputting "drugs for headache" returns effective drugs like ibuprofen;
  2. Prescription Image Recognition: Extracts prescription information via EasyOCR and links to drug inventory;
  3. Multi-Agent Dialogue System: The orchestrator identifies intents, routes tasks, and maintains context for multi-turn interactions;
  4. Order Management: Supports a complete process including shopping cart, order placement, and status tracking;
  5. Voice Interaction: Integrates Whisper for speech-to-text input.
5

Section 05

Workflow Example: Complete User Interaction Chain

Typical workflow: User asks for cold medicine recommendations → Orchestrator identifies search intent → Semantic search returns drugs → User asks about Tylenol's side effects → Orchestrator routes to LLM assistant → User requests to add to cart → Order module adds to cart → User uploads prescription → OCR recognition → Retrieve prescription drugs → User places order → Create order. This demonstrates the advantages of Agentic AI in active understanding and planned execution.

6

Section 06

Observability and Deployment: Local-First Approach and Future Expansion Directions

  • Observability: Integrates Langfuse to track request links, agent response times, LLM call costs, etc., facilitating debugging;
  • Local Deployment: Achieves fully offline operation via Ollama to ensure data privacy;
  • Future Expansion: Plans to add role authentication, payment gateway integration, real-time inventory updates, multi-language support, cloud deployment, and other features.
7

Section 07

Technical Value and Industry Significance: A Model for Agent Applications in Vertical Fields

The project demonstrates the trend of agent applications in vertical fields: 1. Focus on professional service capabilities for pharmacy scenarios; the "general LLM + domain agent" model is referenceable; 2. Local LLM deployment ensures privacy and reduces costs; 3. Supports text, voice, and image multimodal interactions; 4. Observability construction provides necessary conditions for production deployment.

8

Section 08

Conclusion: A Production-Ready Reference Case for Agentic AI Systems

Pharmacy Agentic AI is a highly complete open-source project. It not only implements specific functions but also demonstrates the construction method of a production-ready Agentic AI system, providing an excellent reference for the implementation of LLM technology in business scenarios. We look forward to more AI applications in vertical fields changing the way industries operate.