vibster / compliant-agent

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

compliant-agent

Overview

Regular agents will often just do stuff! Ours follows the law.

Run the demo

poetry shell && ./demo.sh

Installation & Usage

Install with poetry install

Run with poetry run python main.py

Technical details

We're modifying the Zero-shot ReACT agent with Chain-of-Thought to also check for compliance.

The old agent:

  • Observation
  • Thought
  • Action

Our agent:

  • Observation
  • Thought
  • Proposed Action
  • Compliance check
  • Action or Exit

Knowledge Base

We have a vector database for retrieving relevant regulations and case law.

Compliance Chain

Compliance chain is an agent Chain-of-Thought reasoning for determining if an action is compliant.

v0

  1. Take in the action, embed it, and then look up the most relevant case law in FAISS.
  2. Based on the case law, decide whether the action is legal or not.
  3. If it is, do the action. If it's not, flag with the relevant case law.

This agent is not conversational, it merely implements the Langchain QADocumentRetrieval pattern.

It's packaged as a tool, so that a tool-enabled conversational agent or another agent can invoke it via prompt, rather than having to modify the underlying agent orchestration.

Example Chat Agent

The Example Chat Agent is a conversational Zero-shot ReACT agent.

Future additions

[] Composability [] Read-teaming

About


Languages

Language:Python 97.5%Language:Shell 2.5%