Featured

Deploy OpenClaw in 60 seconds — 20% off logoDeploy OpenClaw in 60 seconds — 20% off

Launch OpenClaw on Hostinger in about 60 seconds and keep your agent live 24/7. Our referral link gives you 20% off, no coupon code needed.

Launch on Hostinger
Run your Hermes agent on Hostinger, fully managed logoRun your Hermes agent on Hostinger, fully managed

Launch Hermes on Hostinger in one click, fully managed, no VPS knowledge needed. Use code ZACAARON10 for 10% off.

Launch on Hostinger
Crawl and scrape any site into clean data, 10% off logoCrawl and scrape any site into clean data, 10% off

Firecrawl crawls and scrapes any site into clean markdown for your agent. Get 1,000 free credits, and new users get 10% off their first purchase.

Try Firecrawl free
6,000+ web scrapers for your AI agent, start free logo6,000+ web scrapers for your AI agent, start free

Apify gives your agent live web data: 6,000+ prebuilt scrapers and actors, MCP-ready. Sign up free with $5 in usage credits.

Try Apify free
One API to scrape, enrich, and extract the internet. logoOne API to scrape, enrich, and extract the internet.

Context.dev gives your agents a single API to scrape, enrich, and extract live web data — no proxies, no parsers, no maintenance.

Start building free
SetupClaw: done-for-you OpenClaw for founders & exec teams logoSetupClaw: done-for-you OpenClaw for founders & exec teams

White-glove OpenClaw for founders and exec teams (4–50+ employees): we install, harden, integrate your tools, and maintain it — secured from day one.

Get it set up for you
SEO data APIs for your agent, $1 free credit logoSEO data APIs for your agent, $1 free credit

DataForSEO gives your agent live access to SERP results, keyword data, backlinks, and on-page SEO data through one API. New accounts get a $1 credit, good for up to 20,000 keyword or backlink lookups.

Try DataForSEO free
Reach 48,000+ AI builders

A flat monthly placement in front of developers actively installing AI tools. No lock-in, cancel anytime.

Advertise here
legal-docs logo

legal-docs

rezanuhebring/legal-ai-project

Otheropenclawby rezanuhebring

Summary

OpenClaw plugin exposing 0 skills.

Install to Claude Code

openclaw plugin add rezanuhebring/legal-ai-project

Run in Claude Code. Add the marketplace first with /plugin marketplace add rezanuhebring/legal-ai-project if you haven't already.

README.md

Legal AI Project

An OpenClaw extension that enables AI-assisted legal document search, ingestion, and retrieval with mTLS-secured file-agent deployment and optional MinIO object storage.

Repository Layout

legal-ai-project/
├── extension/           # legal-docs OpenClaw plugin (TypeScript)
├── file-agent/          # Lightweight file-agent v1 — pre-built binaries + deploy scripts
├── file-agent-go/       # Full-featured file-agent v2 — build from source (Docker, YAML config)
├── config/
│   ├── openclaw.json.example   # Full plugin configuration template
│   ├── schema.sql              # PostgreSQL tables (documents + audit_log)
│   └── .env.example            # Environment variable reference
├── scripts/
│   ├── setup-pki.sh            # One-shot CA + client-cert generator
│   └── install-extension.sh    # Copies extension into ~/.openclaw + npm install
└── certs/                      # PKI output (gitignored — never commit *.key files)

---

Prerequisites

| Requirement | Notes | |---|---| | OpenClaw engine | Docker Compose or standalone | | Node.js ≥ 18 | For the extension | | Go 1.22+ | To rebuild file-agent-go from source (optional) | | OpenSSL | For PKI setup | | PostgreSQL | Tables in config/schema.sql | | Qdrant | Vector store — default collection legal_documents | | Apache Tika | Document text extraction | | rsync | Required by scripts/install-extension.sh |

---

Quick Start

1 Clone

git clone <your-fork-url> legal-ai-project
cd legal-ai-project

2 Generate PKI (CA + engine client certificate)

./scripts/setup-pki.sh

Outputs to certs/: ca.crt, ca.key, agent.crt, agent.key.

Copy the engine certs to your OpenClaw data directory:

mkdir -p ~/.openclaw/certs
cp certs/ca.crt certs/agent.crt certs/agent.key ~/.openclaw/certs/

3 Configure

cp config/openclaw.json.example ~/.openclaw/openclaw.json

Edit ~/.openclaw/openclaw.json — fill in real values for Qdrant, PostgreSQL, Tika, and the embedding API. Keep the fileAgent.caCert / clientCert / clientKey paths pointing to ~/.openclaw/certs/.

Apply database schema:

psql -h <host> -U openclaw_admin -d openclaw -f config/schema.sql

4 Install the extension

./scripts/install-extension.sh

Optional: --openclaw-dir /custom/path to override the default ~/.openclaw.

Restart OpenClaw:

docker compose restart openclaw-gateway   # Docker
# or: systemctl restart openclaw

---

Deploying the File Agent

The file-agent runs on each machine that holds legal documents. It exposes a TLS-authenticated HTTP API that the OpenClaw plugin calls to scan folders and fetch file content.

Option A — Pre-built binary (file-agent v1)

Simplest option; uses command-line flags.

cd file-agent

# 1. Issue a server certificate for the target host
./issue-server-cert.sh <hostname-or-IP>
#    reads CA from ../certs/  (project root)
#    writes server-<host>.crt / .key to ../certs/

# 2. Deploy the binary + certs to the remote host
./deploy-linux.sh user@<host> /opt/file-agent
#    copies binary and certs via scp, starts the agent

Windows: copy dist/file-agent-windows-amd64.exe manually and run with the appropriate flags (see output of --help).

Option B — Full-featured build (file-agent-go v2)

Supports YAML config, hot-watching folders, rate limiting, and Tika text extraction.

Build from source:

cd file-agent-go
go build -o dist/file-agent ./cmd/file-agent

Or via Docker:

docker build -t file-agent .
docker run -v /etc/file-agent:/etc/file-agent file-agent

Copy scripts/install-linux.sh to the target host and run as root — it creates a openclaw-agent system user, installs the binary to /opt/openclaw-file-agent/, and writes a default config.yaml.

> Note: The pre-built binaries in file-agent-go/dist/ were compiled from v1 source and do not include YAML-config features. Rebuild from file-agent-go/ source for full functionality.

---

Optional: MinIO Object Storage

No agent is required. Add a minio block to your openclaw.json plugin config (see config/openclaw.json.example). The plugin reads directly from the bucket using the legal_docs_list_minio + legal_docs_ingest (source: "minio") tools.

---

Extension Tool Reference

| Tool | Description | |---|---| | legal_docs_ingest | Ingest a document from file-agent or MinIO into Qdrant + Postgres | | legal_docs_search | Semantic search with classification filter | | legal_docs_get | Retrieve full document by ID | | legal_docs_audit | Query the audit log | | legal_docs_list_minio | List objects in the configured MinIO bucket |

See extension/README.md for full options and examples.

---

Security Notes

  • certs/*.key and .env are gitignored — never commit private keys.
  • All file-agent communication is mutual TLS (both sides present a certificate).
  • Classification labels (PUBLIC, INTERNAL, CONFIDENTIAL, RESTRICTED) are enforced at the database level via CHECK constraints.
  • All AI-model interactions against classified documents are recorded in audit_log.

Related plugins

Browse all →