Law Counselor
Pricing
from $1.00 / actor start
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
Actor stats
0
Bookmarked
2
Total users
1
Monthly active users
6 days ago
Last modified
Categories
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
- Planner — Breaks your
legalQueryinto a multi-step research plan (configurable minimum length). - Executor — Runs one step at a time using Yutori tools (including optional long wait/poll for scout output).
- 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
| Requirement | Purpose |
|---|---|
| Yutori API access | Scouting / scouts |
| MiniMax API key | LLM (MiniMax-M2, OpenAI-compatible endpoint) |
| Apify account | Running 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 → Settings → Environment variables:
| Variable | Description |
|---|---|
YUTORI_API_KEY | Yutori Scouting API key |
MINIMAX_API_KEY | MiniMax 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
| Field | Type | Description |
|---|---|---|
legalQuery | string | Your 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
| Field | Default | Description |
|---|---|---|
outputInterval | 86400 | Seconds between Yutori scout runs (min 1800) |
maxIterations | 12 | Max plan–execute cycles (each cycle runs one plan step) |
minPlanSteps | 6 | Minimum number of steps in the generated plan |
minExecutedSteps | 5 | Minimum executor steps before the replanner may finish |
maxToolRounds | 20 | Max tool-calling rounds per executor step (raise for long polling) |
scoutPollIntervalSec | 20 | Seconds between polls when waiting for scout output |
scoutMaxWaitSec | 1500 | Max seconds to wait per wait_for_scout_output call (~25 min) |
testingFallbackAfterSec | 0 | Testing only: if set to a positive number of seconds, emit estimated fallback after that wait (use 0 in production) |
scoutId | — | Optional 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:
type | Contents |
|---|---|
generated_plan | Initial multi-step plan (steps, query) |
execution_step | Per-step description, result, short step_summary |
final_response | Consolidated 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-Counselorpython3.12 -m venv .venv && source .venv/bin/activate # recommendedpip install -r requirements.txtexport 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 loginapify 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
- Apify Actor docs
- Apify Python SDK
- Project agent notes:
AGENTS.md
License
Add your license here if you publish the repository publicly.