Skip to main content
Nia Sync is a standalone CLI daemon that continuously synchronizes your local data sources with Nia, enabling AI agents to search your personal knowledge base.
Privacy First: Local folders are private to your account. They’re searched separately from public repositories and documentation.

Quick Install

curl -fsSL https://app.trynia.ai/install-sync | bash
Or install via pip:
pip install nia-sync

Getting Started

1

Login

Authenticate with your Nia account:
nia login
This opens your browser for secure OAuth authentication.
2

Add a Source

Add a local folder or database to sync:
nia add ~/Documents/notes
The CLI auto-detects known database paths (iMessage, browser history, etc.).
3

Start Syncing

Start the sync daemon:
nia start
The daemon watches for file changes and syncs incrementally.
4

Check Status

View all synced sources:
nia status

CLI Commands

CommandDescription
nia loginBrowser-based OAuth authentication
nia logoutClear stored credentials
nia statusShow all configured sources with sync status
nia startStart sync daemon (watch mode by default)
nia --pollStart daemon in polling mode (no file watching)
nia onceRun one-time sync then exit
nia add <path>Add new source for sync
nia link <ID> <path>Link cloud source to local path
nia remove <ID>Remove source from sync
nia upgradeCheck and install updates

Supported Data Sources

Nia Sync automatically extracts and indexes content from various data sources:

Chat & Messages

  • iMessage (~/Library/Messages/chat.db)
  • Telegram (JSON exports, ZIP files)

Browser History

  • Safari (~/Library/Safari/History.db)
  • Chrome / Brave / Edge
  • Firefox

Databases

  • Generic SQLite databases
  • Auto-extracts tables into searchable text

Folders

  • Regular folders with text files
  • Code, notes, documentation

Virtual File Format

Database content is extracted into virtual text files for semantic search:
SourceVirtual Path Format
iMessagemessages/{contact}/{date}_{row_id}_{direction}.txt
Safari/Chrome/Firefoxhistory/{domain}/{date}_{id}.txt
Telegramtelegram/{chat_name}/{date}_{msg_id}.txt

Web UI

You can also manage synced sources from the Nia web app:
  1. Go to app.trynia.ai
  2. Navigate to Settings → Local Sync
  3. View sync status, add/remove sources, and configure sync intervals

Sync Intervals

Configure how often sources are synced:
IntervalDescription
5mEvery 5 minutes
hourlyEvery hour
6hEvery 6 hours
dailyOnce per day

Searching Local Folders

Once synced, your local folders are searchable via MCP tools:
# Search across local folders
search(query="meeting notes from last week", local_folders=["folder-id-here"])

# Read files from a local folder
nia_read(source_type="local_folder", local_folder_id="folder-id-here", path="/notes/meeting.txt")

# Grep in local folders
nia_grep(source_type="local_folder", local_folder_id="folder-id-here", pattern="TODO")

# Explore folder structure
nia_explore(source_type="local_folder", local_folder_id="folder-id-here", action="tree")
Local folders are private and searched separately from public repositories. Use local_folders parameter in search() to include them.

Configuration

Environment Variables

VariableDefaultDescription
NIA_API_URLhttps://api.trynia.aiOverride API base URL

Config File

Credentials are stored in ~/.nia-sync/config.json with secure permissions (mode 0600).

Limits

LimitValue
Max files per folder5,000
Max total upload size100 MB per folder
Max individual file size5 MB
Max database size1 GB
Max rows per table100,000

Security

350+ exclusion patterns automatically protect sensitive files from being synced.
The following are never synced:
  • Credentials: .env, .pem, .key, SSH keys, *credentials*, *secrets*, *token*
  • Version control: .git, .svn
  • Dependencies: node_modules, venv, __pycache__
  • Build outputs: dist/, build/, .next/
API keys are stored locally with user-only read/write permissions and are never logged or transmitted in plaintext.
Need Help? Join our Discord community or reach out through app.trynia.ai for support.