Quick Start Guide

⚡ New User? Start Here!

First time with TAXIA? Check out our 5-Minute Quick Start Guide for the fastest way to get started!


📋 Three Operation Modes

TAXIA supports three modes depending on your needs:

1. 🎮 Demo Mode (Fastest - No Setup)

Best for: Testing, learning, proof-of-concept

Requirements: - ✅ Python 3.9+ - ✅ API key (Anthropic or OpenAI) - ❌ No Qdrant needed - ❌ No data download needed

from taxia import TaxiaEngine

# Start immediately with sample data
engine = TaxiaEngine(demo_mode=True)
result = engine.answer("법인세율은?")

Limitations: - Sample data only (not all tax laws) - Fixed set of demo answers - Good for 80% of common queries


2. 🔧 Local Mode (API + Your Data)

Best for: Development, custom datasets, full control

Requirements: - ✅ Python 3.9+ - ✅ API key - ✅ Qdrant (vector database) - ✅ Tax law data downloaded

from taxia import TaxiaEngine

# Full power with your data
engine = TaxiaEngine()
result = engine.answer("법인세법 제27조 내용은?")

Benefits: - Complete tax law coverage (2015-2025) - Custom data support - Full control over infrastructure


3. 🚀 Production Mode (API + Qdrant + Neo4j)

Best for: Production apps, Graph-RAG, complex relationships

Requirements: - ✅ Python 3.9+ - ✅ API key - ✅ Qdrant - ✅ Neo4j (graph database) - ✅ Tax law data

from taxia import TaxiaEngine, TaxiaConfig

config = TaxiaConfig(
    enable_graph_rag=True,  # Enable graph reasoning
    neo4j_uri="bolt://localhost:7687"
)
engine = TaxiaEngine(config=config)

Benefits: - Graph-RAG capabilities - Better relationship understanding - Advanced legal reasoning


Installation

pip install taxia-core

Install from npm (JavaScript)

npm install @xaikorea0/js-client

Development Installation

git clone https://github.com/xaikorea/taxia.git
cd taxia
pip install -e ".[dev]"

Basic Usage Examples

Example 1: Demo Mode (Quickest)

from taxia import TaxiaEngine

# No setup required!
engine = TaxiaEngine(demo_mode=True)

# Ask in Korean
result = engine.answer("부가가치세율은 얼마인가요?")
print(result.answer)

# Or in English
result = engine.answer("What is the VAT rate?")
print(result.answer)

Example 2: Local Mode (Full Features)

First, set up infrastructure:

# 1. Start Qdrant
docker run -d -p 6333:6333 qdrant/qdrant

# 2. Download tax law data
taxia download --all

# 3. Index the data
taxia index ~/.taxia/data/

Example 3: JavaScript (Browser/Node)

import { TaxiaClient } from '@xaikorea0/js-client';

const client = new TaxiaClient({
    apiKey: 'YOUR_API_KEY',
    cacheEnabled: true
});

const res = await client.query('법인세율은 얼마인가요?');
console.log(res.answer);

Then query:

from taxia import TaxiaEngine

engine = TaxiaEngine()
result = engine.answer("법인세법 제9조의 내용을 알려줘")

print(f"Answer: {result.answer}")
print(f"Citations: {result.citations}")
print(f"Trace ID: {result.trace_id}")

🛠 Using CLI Tools

Check System Health

taxia health

Expected output:

✅ TAXIA v1.0.0
✅ Python 3.11.5
✅ API Key configured
✅ Qdrant running (localhost:6333)
⚠  Neo4j not configured (optional)

View Configuration

taxia config show

Download Tax Law Data

# Download all years (2015-2025)
taxia download --all

# Download specific year
taxia download --year 2025

# Download to custom location
taxia download --data-dir /custom/path

Index Data

# Index downloaded data
taxia index ~/.taxia/data/

# Index with progress bar
taxia index ~/.taxia/data/ --verbose

📊 Index Real Data (Local/Production Mode)

1. Prepare Data

Create a koreantaxlaw directory in your project root and add tax law JSON files:

project/
├── koreantaxlaw/
│   ├── 2025/
│   │   ├── income_tax_act.json
│   │   ├── corporate_tax_act.json
│   │   ├── vat_act.json
│   │   └── ...
# Run Qdrant with Docker
docker run -p 6333:6333 qdrant/qdrant

# Or install locally
pip install qdrant-client

3. Index Data

from taxia import TaxiaEngine

engine = TaxiaEngine()

# Index tax law data
engine.index_documents("./koreantaxlaw")

# Query after indexing
result = engine.answer("What is Article 9 of the Corporate Tax Act?")

4. Run REST API Server

taxia server --host 0.0.0.0 --port 8000

Then open in browser:

http://localhost:8000/docs

⚙ Configuration

Using Environment Variables

# LLM configuration (Claude recommended)
export ANTHROPIC_API_KEY="sk-ant-your-key-here"

# Or OpenAI
export OPENAI_API_KEY="sk-your-key-here"

# Qdrant configuration (for local/production mode)
export QDRANT_HOST="localhost"
export QDRANT_PORT=6333

# Neo4j configuration (for production mode with Graph-RAG)
export NEO4J_URI="bolt://localhost:7687"
export NEO4J_USER="neo4j"
export NEO4J_PASSWORD="your-password"

Using Python Configuration

from taxia import TaxiaEngine, TaxiaConfig

# Configure everything in code
config = TaxiaConfig(
    llm_provider="anthropic",  # or "openai"
    qdrant_host="localhost",
    qdrant_port=6333,
    enable_graph_rag=True,  # Enable Neo4j Graph-RAG
    top_k=5,  # Number of documents to retrieve
    max_tokens=2000,  # Max response length
)

engine = TaxiaEngine(config=config)

Configuration for Different Modes

Demo Mode Configuration

# Minimal config - no infrastructure needed
engine = TaxiaEngine(demo_mode=True)

Local Mode Configuration

# Vector search only
config = TaxiaConfig(
    enable_graph_rag=False,  # Disable Neo4j
    qdrant_host="localhost",
)
engine = TaxiaEngine(config=config)

Production Mode Configuration

# Full stack with Graph-RAG
config = TaxiaConfig(
    enable_graph_rag=True,
    qdrant_host="your-qdrant-server.com",
    neo4j_uri="bolt://your-neo4j-server.com:7687",
    neo4j_user="neo4j",
    neo4j_password="secure-password"
)
engine = TaxiaEngine(config=config)

🌐 Run REST API Server

# Start server on default port (8000)
taxia server

# Custom host and port
taxia server --host 0.0.0.0 --port 8080

# With auto-reload for development
taxia server --reload

Access the API: - Swagger UI: http://localhost:8000/docs - ReDoc: http://localhost:8000/redoc - Health Check: http://localhost:8000/health

Example API call:

curl -X POST http://localhost:8000/query \
  -H "Content-Type: application/json" \
  -d '{"question": "법인세율은?"}'

🚨 Troubleshooting Quick Tips

Issue: "Vector search not enabled"

Solutions:

# Option 1: Use demo mode
engine = TaxiaEngine(demo_mode=True)

# Option 2: Start Qdrant
docker run -d -p 6333:6333 qdrant/qdrant

Issue: "LLM API key not configured"

Solution:

# Set environment variable
export ANTHROPIC_API_KEY="sk-ant-..."
# or
export OPENAI_API_KEY="sk-..."

Issue: "Data indexing is slow"

Solutions: - Use SSD for Qdrant storage - Index in smaller batches - Increase Qdrant memory allocation

Need more help? See our Troubleshooting Guide


📚 Next Steps

Learn More

Explore Use Cases

Advanced Topics


💡 Tips for Success

  1. Start with Demo Mode - Test before committing to infrastructure
  2. Use Korean Queries - Tax laws are in Korean, queries work better in Korean
  3. Check Citations - Always verify legal citations in results
  4. Monitor Costs - LLM API calls cost money, implement caching
  5. Keep Data Updated - Download latest tax law data regularly

Happy coding! 🚀