Skip to content

Template: Legal Assistant

The Legal Assistant template creates a Korean legal Q&A agent that searches statutes, precedents, and administrative rules via Schift’s public bucket.

No document upload needed. No law data to manage. Just deploy and ask.

Terminal window
npx create-schift my-legal-bot --template legal-assistant
cd my-legal-bot
npx schift auth login # browser opens, one click
npm start
Legal Assistant ready. Type your question (Ctrl+C to exit).
You: 근로기준법에서 출산휴가 기간이 어떻게 되나요?
Agent: 근로기준법 제74조에 따르면, 사용자는 임신 중의 여성에게
출산 전과 출산 후를 통하여 90일의 출산전후휴가를 주어야 합니다...
[출처: 근로기준법 제74조 제1항]
my-legal-bot/
src/agent.ts # Agent + RAG configuration
schift.config.json # Model, bucket, instructions
.env.local.example # API key guide
package.json
tsconfig.json
{
"name": "my-legal-bot",
"template": "legal-assistant",
"agent": {
"name": "my-legal-bot",
"model": "qwen/qwen3.6-plus-preview:free",
"instructions": "You are a Korean legal assistant..."
},
"rag": {
"bucket": "public--korean-law",
"topK": 5
},
"llm": {
"provider": "openrouter",
"baseUrl": "https://openrouter.ai/api/v1"
}
}

The template defaults to OpenRouter’s free tier (no API key needed for the LLM). You can switch to any provider:

ProviderConfig
OpenRouter (free, default)No changes needed
OpenRouter (paid)Set LLM_API_KEY in .env.local
Schift CloudRemove llm section from config
Ollama (local)Set baseUrl to http://localhost:11434/v1

Edit agent.model in schift.config.json:

"model": "gpt-4o-mini"

Any OpenAI-compatible model ID works.

  1. User asks a question
  2. Agent calls rag_search tool (auto-registered from the public bucket)
  3. Schift searches public--korean-law for relevant statutes
  4. Agent generates an answer citing specific articles

The public bucket handles all law data. See Public Buckets for details on lazy indexing and caching.

  • Add company documents: Upload internal policies to a private bucket, combine with public law data
  • Change instructions: Specialize for employment law, tax law, real estate law, etc.
  • Add web search: Enable web search for recent legal news
  • Build a web UI: Replace the CLI chat loop with a web interface
  • Node.js 18+
  • Schift API key (npx schift auth login)