piighost-chat

A demo chatbot that de-identifies messages before the LLM sees them.

What it demonstrates

piighost-chat is a demo chatbot that shows a privacy-preserving conversation end to end. User messages are de-identified before they reach the LLM, and responses are restored before they reach the user. Tools receive the real values.

The stack

  • A React frontend and a Litestar backend running a LangChain agent.
  • PIIAnonymizationMiddleware wrapping the agent: de-identify before the LLM, restore after.
  • piighost-api for detection and highlighting, with thread-scoped memory for consistent placeholders.
  • keyshield for API-key authentication.

The user flow

  1. The user types a message.
  2. The backend calls piighost-api to detect PII; the frontend highlights the entities.
  3. The user confirms, and the message goes to the agent.
  4. The middleware de-identifies it before the model sees it, and restores the reply.

Run it

git clone https://github.com/Athroniaeth/piighost-chat
cd piighost-chat
docker compose up