Skip to content

MartinCastroAlvarez/langchain-virtual-assistant

Repository files navigation

LangChain Virtual Assistant

LangChain Virtual Assistant using LangChain and JupyterNotebook.

wallpaper.jpg

Overview

graph.png

Paper

Read LangChain.pdf

Setup

  1. Clone the repository:
git clone https://github.com/MartinCastroAlvarez/langchain-virtual-assistant.git
cd langchain-virtual-assistant
  1. Install dependencies using Poetry:
poetry install
  1. Set the OpenAI API Key.
export OPENAI_API_KEY="lorem-ipsum"

Usage

  1. Place your PDF files in the ./pdfs directory. Alternatively, you can generate test PDFs using the following command:
poetry run python3 generator.py --number 10
  1. You can then generate a vector store in vectorstore.json . using the following command:
poetry run python3 indexer.py
  1. Finally, run the smart agent and start asking questions:
poetry run python3 agent.py
¡Bienvenido! Soy su asistente médico virtual. ¿En qué puedo ayudarle hoy?
Type one of adiós, bye, chau, exit, goodbye, quit, salir to end.
>>> tengo dolor de cabeza
: Agent: Catalina Ríos fue la paciente con la queja de dolor de cabeza. Esta información se encuentra en el Informe de Consulta Médica de Catalina Ríos, con fecha 02/05/2024.
>>> tengo dolor de hombro
Agent: El paciente con dolor de hombro tiene un diagnóstico de Síndrome del intestino irritable (SII) y se le recomienda programar una ecografía para descartar complicaciones. Este diagnóstico y recomendación se encuentran en el informe de consulta médica de Daniel Ortega en el archivo 'Daniel_Ortega_07-06-2024.pdf'.
>>> tengo ansiedad y depresión
Agent: El paciente con ansiedad y depresión puede encontrar información relevante en los archivos 'Sophia_Ortega_18-03-2025.pdf', 'Valentina_Ríos_14-09-2024.pdf', 'William_Ríos_20-01-2025.pdf', entre otros.
  1. You can also run the Jupyter Notebook, but you will need to create an .env with an OPENAI_API_KEY.
poetry run jupyter notebook ./asistente_medico.ipynb 

jupyter.png

About

Virtual assistant using LangChain

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published