Law Counselor avatar

Law Counselor

Pricing

from $1.00 / actor start

Go to Apify Store
Law Counselor

Law Counselor

LangGraph Plan-and-Execute AI agent for legal research using Yutori Scouts and MiniMax-M2.

Pricing

from $1.00 / actor start

Rating

0.0

(0)

Developer

Yuvraj Gupta

Yuvraj Gupta

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

6 days ago

Last modified

Share

Law Counselor is an Apify Actor that runs a LangGraph plan-and-execute agent for legal research. It plans concrete steps, calls the Yutori Scouts API as tools (list/create/get/wait/update/complete/restart/delete scouts), and uses MiniMax-M2 via the OpenAI-compatible API for planning, execution, and replanning.

Disclaimer: This Actor is not legal advice. It automates research workflows only. You are responsible for compliance with applicable laws, Yutori and MiniMax terms of use, and for verifying any legal information independently.


How it works

  1. Planner — Breaks your legalQuery into a multi-step research plan (configurable minimum length).
  2. Executor — Runs one step at a time using Yutori tools (including optional long wait/poll for scout output).
  3. Replanner — After each step, updates the remaining plan or produces a final briefing, subject to minimum executed steps and iteration limits.

Runs can be long when waiting for Yutori scouts (e.g. 20–25+ minutes per wait is possible). Apify platform usage (compute time) applies.


Prerequisites

RequirementPurpose
Yutori API accessScouting / scouts
MiniMax API keyLLM (MiniMax-M2, OpenAI-compatible endpoint)
Apify accountRunning the Actor

API keys (environment only — not in run input)

End users do not enter Yutori or MiniMax keys. The run input schema does not include those fields. Keys are read only from environment variables, configured by the Actor owner (you) in Apify or locally.

Apify Cloud

Console → your Actor → SettingsEnvironment variables:

VariableDescription
YUTORI_API_KEYYutori Scouting API key
MINIMAX_API_KEYMiniMax API key

Mark both as secret where the UI allows. Every run then only needs legalQuery and optional tuning fields.

Local development

Export before apify run:

export YUTORI_API_KEY="your-yutori-key"
export MINIMAX_API_KEY="your-minimax-key"

Or copy .env.example to .env, fill values, and load them in your shell (do not commit .env).

Use Python 3.12 locally to match the Docker image (apify/actor-python:3.12). If apify run uses Python 3.14 from Homebrew, create a 3.12 venv or use ./scripts/run-local.sh after installing dependencies.


Input

Required

FieldTypeDescription
legalQuerystringYour legal research question (jurisdiction, topic, time period). Every run can use a different query.

Yutori and MiniMax keys are not input fields; set YUTORI_API_KEY and MINIMAX_API_KEY on the Actor (see above).

Optional behavior tuning

FieldDefaultDescription
outputInterval86400Seconds between Yutori scout runs (min 1800)
maxIterations12Max plan–execute cycles (each cycle runs one plan step)
minPlanSteps6Minimum number of steps in the generated plan
minExecutedSteps5Minimum executor steps before the replanner may finish
maxToolRounds20Max tool-calling rounds per executor step (raise for long polling)
scoutPollIntervalSec20Seconds between polls when waiting for scout output
scoutMaxWaitSec1500Max seconds to wait per wait_for_scout_output call (~25 min)
testingFallbackAfterSec0Testing only: if set to a positive number of seconds, emit estimated fallback after that wait (use 0 in production)
scoutIdOptional existing Yutori scout UUID to prioritize

Full schema: .actor/input_schema.json.


Output

Results are written to the run’s default dataset. Typical record types include:

typeContents
generated_planInitial multi-step plan (steps, query)
execution_stepPer-step description, result, short step_summary
final_responseConsolidated answer; may include generated_plan and replanner_decisions

Console Output tab links to the dataset (see .actor/output_schema.json and .actor/dataset_schema.json).


Local run

cd Law-Counselor
python3.12 -m venv .venv && source .venv/bin/activate # recommended
pip install -r requirements.txt
export YUTORI_API_KEY="..." MINIMAX_API_KEY="..."
apify run --entrypoint src --purge

Or: ./scripts/run-local.sh --purge (see script for PATH/venv behavior).


Docker build

$docker build -t law-counselor:local .

Uses Dockerfile (apify/actor-python:3.12), entrypoint python -m src.


Deploy to Apify

apify login
apify push

Then set YUTORI_API_KEY and MINIMAX_API_KEY on the Actor, configure Publication / Store listing when ready, and run with legalQuery (and optional overrides).


Support & resources


License

Add your license here if you publish the repository publicly.