Template: Legal Assistant
Overview
Section titled “Overview”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.
Quick Start
Section titled “Quick Start”npx create-schift my-legal-bot --template legal-assistantcd my-legal-botnpx schift auth login # browser opens, one clicknpm startLegal Assistant ready. Type your question (Ctrl+C to exit).
You: 근로기준법에서 출산휴가 기간이 어떻게 되나요?
Agent: 근로기준법 제74조에 따르면, 사용자는 임신 중의 여성에게 출산 전과 출산 후를 통하여 90일의 출산전후휴가를 주어야 합니다... [출처: 근로기준법 제74조 제1항]What’s Included
Section titled “What’s Included”my-legal-bot/ src/agent.ts # Agent + RAG configuration schift.config.json # Model, bucket, instructions .env.local.example # API key guide package.json tsconfig.jsonConfiguration
Section titled “Configuration”schift.config.json
Section titled “schift.config.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" }}LLM Options
Section titled “LLM Options”The template defaults to OpenRouter’s free tier (no API key needed for the LLM). You can switch to any provider:
| Provider | Config |
|---|---|
| OpenRouter (free, default) | No changes needed |
| OpenRouter (paid) | Set LLM_API_KEY in .env.local |
| Schift Cloud | Remove llm section from config |
| Ollama (local) | Set baseUrl to http://localhost:11434/v1 |
Changing the Model
Section titled “Changing the Model”Edit agent.model in schift.config.json:
"model": "gpt-4o-mini"Any OpenAI-compatible model ID works.
How It Works
Section titled “How It Works”- User asks a question
- Agent calls
rag_searchtool (auto-registered from the public bucket) - Schift searches
public--korean-lawfor relevant statutes - Agent generates an answer citing specific articles
The public bucket handles all law data. See Public Buckets for details on lazy indexing and caching.
Customization Ideas
Section titled “Customization Ideas”- 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
Requirements
Section titled “Requirements”- Node.js 18+
- Schift API key (
npx schift auth login)