What is Nia? Nia is an API layer that gives agents up-to-date, continuously monitored context across repositories, documentation, PDFs, datasets, spreadsheets, Slack, Google Drive, X/Twitter, generic connectors, and local knowledge sources. It handles indexing, search, reading, research, extraction, and handoffs so coding agents can work from real source material instead of guesswork. Use it via CLI, MCP, SDKs, agent skills, plugins, or the REST API.
Quick Install
Get an API Key
Sign up at app.trynia.ai. Free plan included.
API Base URL
https://apigcp.trynia.ai/v2Auth: Authorization: Bearer YOUR_API_KEYBrowse by Source Type
Already know your input (code, PDFs, Slack, Drive)? Start with Source Types.
Capability Map
Every Nia capability falls into one of these categories:1. Indexing & Subscriptions
Bring knowledge into Nia from any source type. One universalindex tool auto-detects what you give it.
index (universal entry point)
Auto-detects:
Typical prompts:
auto_subscribe_dependencies
Parses a manifest — package.json, requirements.txt, pyproject.toml, Cargo.toml, go.mod — then subscribes to or indexes related documentation sources automatically. Best for spinning up a project knowledge base from an existing repo.
manage_resource
Single tool for resource lifecycle:
Pre-indexed (community) sources
Skip indexing entirely by subscribing to sources others have already indexed. Browse Global Sources at app.trynia.ai. Popular examples include Chromium, React, Next.js, FastAPI, the Vercel AI SDK, and LangChain. Subscribing is instant and does not count against your indexing quota.Branch / ref selection
Repos acceptbranch, ref, tag, or commit SHA where applicable.
Global source deduplication
If someone has already indexed an upstream source, you can subscribe instantly. Setadd_as_global_source=False to keep an indexed source private.
→ Deep dive: Pre-indexed Sources
2. Search, Read & Explore
Once content is indexed, query it with semantic, lexical, or structural retrieval.search — semantic search
Hybrid (vector + BM25) semantic search across all indexed source types: repositories, docs, papers, datasets, spreadsheets, Google Drive, Slack, X, local folders, connectors, and more. Supports streaming responses, multi-source queries, and source-specific filters (repositories, data_sources, slack_workspaces, local_folders, connector_installations, e2e_session_id).
nia_grep — regex search
Regex pattern matching across repositories, documentation, packages, Google Drive sources, local folders, datasets, and Slack. Supports context lines, case sensitivity, path scoping, and result limits.
nia_read
Read files, pages, or rows from any indexed source — repositories, documentation, packages, Google Drive sources, local folders, HuggingFace datasets, Slack channels. Supports line ranges and path-based addressing.
nia_explore
Browse the structure of any indexed source: file trees, directory listings, dataset schemas, Slack channel listings.
get_github_file_tree
Inspect a public GitHub repository structure live — without indexing it first.
Universal search modes
The unified/search endpoint supports four modes via a mode discriminator:
→ Deep dive: API Guide
3. Research Agents
Autonomous agents that plan, call tools, and synthesize answers across many sources.nia_research — three modes
nia_advisor
Analyzes your code against indexed documentation to produce grounded recommendations. Pass a code snippet plus the docs you want it checked against.
Oracle Research Agent
Autonomous research assistant for deep technical investigations across codebases, documentation, and the web. Three-phase pattern (DISCOVER → INDEX → SEARCH) with progressive tool usage. Capabilities:- Web search (
nia_web_search), code search, documentation search - Doc filesystem tools:
doc_tree,doc_ls,doc_read,doc_grep - Package source code analysis (PyPI, npm, Crates.io, Go modules)
- Auto-indexes discovered sources during research
- Real-time SSE streaming with iteration events, tool events, and final report
- Job-based execution with retry and reconnection
- Chat with results via
/v2/oracle/sessions/{session_id}/chat - Session history and message retrieval
POST /v2/oracle— direct streamingPOST /v2/oracle/jobs— job-based (recommended)GET /v2/oracle/jobs/{job_id}/stream— SSEGET /v2/oracle/jobs/{job_id}— statusGET /v2/oracle/history— past sessions
Tracer (covered separately below)
Live GitHub search agent that delegates to parallel sub-agents — see section 13.4. Document Agent
Deploy an autonomous AI agent into a specific PDF or document. Unlike standard search (single-pass retrieval), Document Agent plans its strategy, calls tools (search, read sections, read pages, navigate trees), follows cross-references, and synthesizes a cited answer.Key features
Models
Endpoint
POST /v2/document/agent — query an indexed document with optional schema, thinking budget, and streaming flag.
Use cases
Legal contracts, SEC filings (10-K/10-Q), technical manuals, research papers, audit reports, compliance checklists. → Deep dive: Document Agent5. Data Extraction
Three modes for pulling structured data out of PDFs.Table extraction
Provide a JSON schema; Nia returns an array of records matching the schema. Ideal for SEC filings, invoices, product catalogs, line items.POST /v2/extract — start job
GET /v2/extract/{id} — poll status
Detect extraction
Detect and locate visual elements — tables, figures, charts, diagrams — in PDF pages. Returns bounding boxes, classifications, and confidence scores. Optional symbol-level detection and pattern filters. Can render annotated page images via/v2/extract/detect/{id}/page/{n}/image.
POST /v2/extract/detect
GET /v2/extract/detect/{id}
Engineering extraction
Purpose-built for technical documents — engineering drawings, P&IDs, schematics, datasheets, construction specs. Includesaccuracy_mode (fast or precise) and follow-up queries that reuse the already-extracted context without re-processing.
POST /v2/extract/engineering
POST /v2/extract/engineering/{id}/query — ask follow-ups
GET /v2/extract/engineering/{id}
Job lifecycle
queued → processing → completed | failed
Listing
GET /v2/extractions?type=table|detect|engineering lists all your extraction jobs.
→ Deep dive: Data Extraction
6. Vault — Agent-Maintained Personal Wiki
Vault is an agent-maintained personal wiki layered on top of your indexed Nia sources. Instead of searching raw documents every time, the agent reads sources once and compiles them into a structured, interlinked markdown wiki that gets smarter over time.Three layers
- Raw sources — your indexed Nia sources (read-only)
- The wiki — markdown pages the agent generates and owns
- The schema —
schema.mdyou and the agent co-evolve
Page structure
Each page has a Compiled Truth (above---, rewritten when evidence changes) and a Timeline (below ---, append-only evidence trail). Cross-references use [[wikilinks]] with optional typed relationships (uses, extends, works_at, contradicts, etc.).
Workflows
Layout
Web UI at app.trynia.ai/vaults
- Page tree sidebar
- Force-directed graph view (color-coded by relationship type)
- TipTap rich editor with wikilink autocomplete
Cmd+Ksearch palette with fuzzy + AI-powered Q&A- Dream/sync controls
- Settings: auto-sync, auto-dream, schema editor
Personal data sources via Local Sync
iMessage, WhatsApp, Apple Notes, Contacts, Reminders, Stickies, Screenshots, plus 47+ cloud connectors.Provenance protection
provenance.last_human_edit ensures user-edited files are never overwritten by background workflows.
→ Deep dive: Vault
7. Context Sharing
Save entire conversation histories — code snippets, plans, decisions, referenced sources, edited files — and re-open them in another agent. Plan with Cursor, continue execution in Claude Code.Unified context tool
Memory types
What gets captured when you save
Conversation history, code snippets and edited files, plans and decisions, referenced sources, every Nia search and query made.Endpoints
POST /v2/contexts (save), plus list/get/update/delete and semantic search.
→ Deep dive: Context Sharing
8. Local Sync
Standalone CLI daemon (nia) that continuously synchronizes local data sources with Nia, enabling agents to search your personal knowledge base.
Quickstart
Core CLI commands
Search from the terminal
--local-folder, --sources, --markdown/--no-markdown, --stream/--no-stream, --json, --limit.
Monitoring & debugging
Sync control
nia pause <id>, nia resume <id>, nia resync <id>, nia resync --all.
Web integration
Configuration
nia config list / get / set for settings. nia ignore add --dir|--file|--ext|--path for ignore patterns. nia watch add ~/Projects to auto-discover new folders matching unlinked sources.
Source ID shortcuts
ID prefixes (nia info a3f2) and display names (nia pause "My Notes") work everywhere.
Daemon flags
--watch/--poll, -f, --fallback <sec> (default 600), -r, --refresh <sec> (default 30).
Supported data sources
Virtual file paths
Database content extracted into virtual text files for semantic search, e.g.:Sync intervals
Configurable per source:5m, hourly, 6h, daily.
Limits
Security
350+ exclusion patterns automatically protect:.env, .pem, .key, SSH keys, *credentials*, *secrets*, *token*, .git, .svn, node_modules, venv, __pycache__, dist/, build/, .next/. Credentials stored locally with 0600 permissions.
→ Deep dive: Local Sync
9. End-to-End Encryption
Zero-knowledge sync for personal data sources. Plaintext never leaves your device — Nia stores only encrypted vectors and ciphertext.Pipeline
Supported sources
All adapters live in
sdk/typescript/src/local-first/. You can add your own.
Key concepts
- Encryption key — passphrase-derived (PBKDF2 → AES-256-GCM), stored in macOS Keychain. Never sent to server.
- Blind index key — separately derived; produces HMAC-SHA256 tokens for keywords, contact hashes, conversation hashes. Lets the server filter encrypted results without seeing plaintext.
- Embedding profile —
zembed-1-2560(2560 dims), client-side, so query and document embeddings match. - Decrypt sessions — temporary scoped sessions with TTL, max chunks, and allowed operations. Agent never holds the encryption key.
Sync modes
Endpoints
Querying encrypted data
Standard/v2/search/query endpoint with e2e_session_id parameter — desktop bridge handles decryption within session bounds.
Demo
Open-source iMessage demo:nia-imessage-app-demo.
→ Deep dive: End-to-End Encryption
10. Connectors
Generic framework for integrating external data sources with OAuth and API key authentication, scheduled syncing, and status monitoring. One API contract for every connector type.Lifecycle
Discover → Install → Configure → Index → Search
Auth methods
Endpoints
Status values
idle | processing | completed | failed
Scheduling
Standard cron expressions, e.g.:
Set
schedule: null to disable; manual sync still available.
Searching connector data
Indexed connector data appears in the unified/v2/search/query endpoint. Filter to specific installations via connector_installations.
Multi-instance support
Install the same connector type multiple times (e.g. multiple Confluence instances or Notion workspaces) — each installation is independent. → Deep dive: Connectors11. Scoped MCP Servers
Don’t want a general-purpose MCP with dozens of tools? Generate a scoped MCP server focused on one specific source — one framework, one docs site, one paper. Reduces tool clutter and context noise.How it works
- Pick any pre-indexed source from Global Sources at app.trynia.ai
- Click “Create Scoped MCP” — Nia generates a dedicated config
- Add the config to your IDE
Example config
source parameter is URL-encoded. You can run multiple scoped MCPs simultaneously, each operating in its own tool namespace.
Scoped vs full MCP
→ Deep dive: Scoped MCP Servers
12. Sandbox Search
Provisions an isolated runtime, clones a public Git repository (GitHub, GitLab, Bitbucket), and runs a read-only agent that answers your question using local files only. When the job finishes, the sandbox is destroyed.When to use it
Endpoints
Request fields
SSE event types
job | status | opencode | result | error | done
CLI
Error codes
INVALID_SANDBOX_REPOSITORY | SANDBOX_PROVISIONING_FAILED | SANDBOX_COMMAND_FAILED | SANDBOX_QUERY_JOB_NOT_FOUND
→ Deep dive: Sandbox Search
13. Tracer (GitHub Search Without Indexing)
Autonomous agent that searches code on GitHub without requiring you to index repositories first. Delegates to specialized parallel sub-agents — each handling search, reading, or analysis concurrently.Modes
Tools Tracer uses
Phases
Plan → Explore → Search & Read → Iterate → Synthesize
Endpoints
SSE events
started | tool_start | tool_complete | complete | error
Cost
15 credits per job (Free plan with credit packs); included quotas on Builder, Team, Business, Enterprise. → Deep dive: Tracer14. Package Search
Search public package source code without indexing.Tools
Supported registries
npm, py_pi, crates_io, golang_proxy, ruby_gems
CLI
Free tier
50 package searches per month on Free plan; unlimited on all paid plans. 150M+ pre-indexed documents across all registries. → Deep dive: API Guide15. Supported Source Types
Every input format Nia understands.Google Drive specifics
- Authenticates with Google OAuth (read-only Drive scopes)
- Multiple Google accounts per user / org
- Browse My Drive and shared drives
- Pick specific files or folders; folder selections recurse; shortcuts resolve to targets
- File handling: Google Docs → text; Sheets → spreadsheets; Slides/Drawings → PDFs; PDFs/CSVs/Excel → indexed directly; plain text incl. Markdown, JSON, YAML, XML, HTML, code files; binary files skipped
- Incremental sync after first full index
Slack specifics
- Two connection modes: Direct OAuth (dashboard) and BYOT (bring your own bot token via API) for enterprise multi-tenant scenarios
- Channel selection modes:
all(with optional excludes) orselected(with explicit includes) - Real-time event indexing via Slack’s Events API after initial backfill
- Required bot scopes:
channels:read,channels:history,channels:join,groups:read(optional),groups:history(optional),users:read,reactions:read - BYOT stores bot tokens encrypted at rest (Fernet AES-128-CBC), each workspace in its own vector namespace
- Live message reads via
/messagesendpoint (not from index) - Keyword grep via
/grep(BM25)
X / Twitter specifics
- Requires X API v2 bearer token from the X Developer Portal
- Configurable:
max_results(1–500),include_replies,include_retweets - Status lifecycle:
created → processing → indexed | failed - Public accounts only (X API v2 limitation)
HuggingFace dataset specifics
Binary columns (images, audio, arrays) excluded; only text-compatible columns indexed. Supports
HF_TOKEN for private datasets. Global source dedup — instant subscribe if already indexed by someone else.
PDF specifics
- Tree-guided hybrid search: documents parsed into hierarchical structures (sections, subsections, figures, tables)
- Section-level indexing with hierarchy-aware retrieval
- Hybrid signals (vector + non-vector: headers, page numbers, cross-references)
- Hierarchical traversal — agents traverse documents as trees, not flat chunks
- Sources: arXiv URLs / IDs, direct PDF URLs, direct file uploads
- LaTeX rendering for equations
- Interactive Papers Playground at app.trynia.ai/playground/papers
16. Explore & Chat
Web UI at app.trynia.ai/explore for asking questions across thousands of pre-indexed repositories, docs, and research papers — no setup required.Features
- Universal knowledge — search all pre-indexed sources at once
- Session history — auto-saved, viewable, loadable, deletable
- Cited responses — every answer includes source links
- Streaming responses — real-time
Explore vs MCP
→ Deep dive: Explore & Chat
17. agentsearch (Zero-Install Docs Filesystem)
Mounts any documentation site as a filesystem your agent can navigate withtree, grep, cat, find. No API key, no account, no install — one npx command.
One-shot mode (for agents)
Wire into any agent
Performance
- ~100ms boot when locally cached
- ~2s when site is already backend-indexed
- ~30–120s for cold index of a brand-new site
- Indexes are namespaced and shared across all users — index
docs.stripe.comonce, everyone benefits
How it works
The shell runs on the client usingjust-bash, a TypeScript bash reimplementation. Filesystem is an in-memory JS object — grep -r "webhook" . over 500 pages completes in milliseconds. Backend respects llms.txt, auto-detects OpenAPI specs (/api-spec/), and normalizes URL paths.
Telemetry opt-out
18. Installation Methods
Five ways to connect Nia to your agent.npx nia-wizard@latest
Single-command install. Creates account, generates API key, auto-detects your IDE, configures everything.
CLI
Standalone command-line tool — full Nia platform from the shell. Built for agents (JSON output, async with polling, non-interactive). See section 8 for sync commands. Additional command groups:nia auth login [--api-key …]/nia auth statusnia repos index|list|status|read|grep|treenia sources index|read|grep|treenia papers indexnia datasets indexnia local add|watchnia search query|universal|web|deep|sandboxnia oracle job|stream|statusnia tracer run|streamnia contexts save|semantic|getnia packages grep|hybridnia github tree|read|search|globnia usage
MCP Server
Standard Model Context Protocol integration. Remote server recommended (zero deps, no local process); local server option usespipx run nia-mcp-server.
Supported clients (30+): Cursor, VS Code, Claude Code, Claude Desktop, Windsurf, Cline, Continue.dev, Google Antigravity, Trae, Gemini CLI, Mistral Vibe CLI, Zed, OpenAI Codex, Roo Code, Kilo Code, JetBrains AI Assistant, Kiro, LM Studio, Visual Studio 2022, BoltAI, Qodo Gen, Qwen Coder, Perplexity Desktop, Warp, Copilot Coding Agent, Copilot CLI, Amazon Q Developer CLI, Opencode, Crush, Amp, Factory, Augment Code, Rovo Dev CLI, Smithery, Zencoder, Emdash, plus Bun/Deno/Docker/Windows configurations.
Agent Skill
Lightweight alternative to MCP — your agent reads a skill file and calls the Nia API directly. No background process.NIA_API_KEY env var or ~/.config/nia/api_key.
Plugins
Agent-native marketplace installs:
→ Deep dives: Installation overview, CLI, MCP, Skill, agentsearch, Plugins
19. SDKs and Language Bindings
Python — nia-ai-py
sdk.search (universal/query/web/deep), sdk.sources (create/list/resolve/delete), sdk.oracle (create/wait/stream/list jobs).
Each low-level API function has four variants: .sync(), .sync_detailed(), .asyncio(), .asyncio_detailed().
TypeScript — nia-ai-ts
nia-ai-ts/local-first — deriveE2EKeys, buildE2ESyncBatch, adapters (iMessageAdapter, etc.), and sdk.daemon.pushE2ESync / createE2ESession / purgeE2EData.
LangChain — langchain-nia
NiaToolkit and NiaAPIWrapper. Passes all LangChain standard tests.
Toolkit toggles:
include_search, include_sources, include_github, include_contexts, include_dependencies. Sync and async (.invoke / .ainvoke).
Configuration knobs
Auth headers accepted
→ Deep dive: SDK Quickstart, Authentication, Examples
20. Agent Onboarding (API-First)
Headless signup, login, and skill install for autonomous agents — no browser required.New users
Returning users
Resend code
Non-interactive skill install
21. Plans, Pricing & Limits
Credit packs
Credit cost per operation
API request-based pricing
For high-volume API users — contactarlan@nozomio.com for custom request-based pricing with volume discounts.
Educational / non-profit discounts
Available — contactarlan@nozomio.com.
Rate limit headers
X-RateLimit-Limit | X-RateLimit-Remaining | X-RateLimit-Reset | X-Monthly-Limit
→ Deep dive: Pricing
22. Privacy & Security
- SOC 2 compliant (Enterprise)
- Opted out of training by all AI model providers
- End-to-end encryption available for personal data sources (iMessage, WhatsApp, Apple Notes, Contacts, Reminders, Stickies, Screenshots) — plaintext never leaves your device
- 350+ exclusion patterns automatically protect credentials (
.env,.pem,.key, SSH keys, anything matching*credentials*/*secrets*/*token*), version control (.git,.svn), dependencies (node_modules,venv,__pycache__), and build outputs (dist/,build/,.next/) - Local credentials stored at
~/.nia-sync/config.jsonwith0600permissions; never logged or transmitted in plaintext - Slack BYOT bot tokens encrypted at rest with Fernet (AES-128-CBC); each workspace in its own vector namespace
- E2E encryption stack: AES-256-GCM, PBKDF2 key derivation, macOS Keychain (or platform-equivalent) key storage, HMAC-SHA256 blind index,
zembed-1-2560client-side embeddings, scoped decrypt sessions with TTL and max-chunks limits - Local hosting available for organizations needing data sovereignty
23. Key API Endpoints Reference
Auth:
Authorization: Bearer YOUR_API_KEY (or X-API-Key: YOUR_API_KEY).
→ Full reference: API Reference and API Guide.
24. Pre-Configured Agent Rules
Open-sourcenia-rules-for-agents repository provides ready-to-use rule files for popular agents:
- Claude (
.claude/agents/) - Codex (
.codex/prompts/) - Cursor (
.cursor/rules/) - Windsurf (
.windsurf/rules/) - Roo Code (
.roo/rules/) - Cline (
.clinerules) - General agents (
general-agents/)
25. Example Workflows
End-to-end patterns showing Nia in action:
→ Deep dive: Example Workflows, Custom Agents, Tips & Tricks
TL;DR for Agents
If you are an AI agent reading this, here is what you should remember:- Indexing is universal — call
indexon any GitHub URL, arXiv URL, HuggingFace dataset URL, PDF URL, spreadsheet, web URL, or local path. Nia auto-detects the type. - Always check existing sources first with
manage_resource action=listorrepos-list/sources-listbefore indexing or web-fetching. - Search modes:
search(semantic),nia_grep(regex),nia_read(file/section),nia_explore(tree). Addnia_package_search_hybridfor public package source code without indexing. - Live GitHub without indexing → use Tracer. Need a deeper read with a full clone → use Sandbox Search.
- Long PDFs → use Document Agent for cited multi-section answers and structured output, or Data Extraction for typed records.
- Multi-step research →
nia_research mode=deep|oracleor Oracle Research Agent directly. - Save state across agents →
context save/context search. Memory types:scratchpad,episodic,fact,procedural. - Personal data → use Local Sync (server-indexed) or E2E Encryption (zero-knowledge) for iMessage, WhatsApp, Notes, Contacts, Reminders, Stickies, Screenshots, browser history, and folders.
- Cloud sources → Google Drive, Slack, X, or generic Connectors (Notion, Confluence, etc.).
- Compounding knowledge → use Vault to let an agent build a self-improving wiki on top of your indexed sources.
- Headless onboarding → use Agent Onboarding endpoints (
/v2/auth/signup,/v2/auth/verify,/v2/auth/login,/v2/auth/login/verify). - Zero-account quick lookup of any docs site →
npx nia-docs <url> -c "grep -rl 'x' ."(agentsearch).
API Guide
Auth, base URL, rate limits, examples
API Reference
Full endpoint and schema reference
Source Types
Browse by what knowledge you have
SDKs
Python, TypeScript, LangChain
Get an API Key
Free plan, no credit card required

