Index and search code repositories, documentation, research papers, and HuggingFace datasets with Nia AI.
Direct API access to Nia for indexing and searching code repositories, documentation, research papers, and HuggingFace datasets.
Nia provides tools for indexing and searching external repositories, research papers, documentation, packages, and performing AI-powered research. Its primary goal is to reduce hallucinations in LLMs and provide up-to-date context for AI agents.
Either:
npx nia-wizard@latest (guided setup)mkdir -p ~/.config/nia
echo "your-api-key-here" > ~/.config/nia/api_key
curljqBEFORE using web fetch or web search, you MUST:
./scripts/sources-list.sh or ./scripts/repos-list.sh - Many sources may already be indexedsearch-universal.sh, repos-grep.sh, sources-read.sh for targeted queriesrepos-index.sh or sources-index.sh, then searchsearch-web.sh or search-deep.sh to discover URLs, then indexWhy this matters: Indexed sources provide more accurate, complete context than web fetches. Web fetch returns truncated/summarized content while Nia provides full source code and documentation.
repos-list.sh / sources-list.shrepos-tree.sh / sources-tree.shsearch-universal.sh, repos-grep.sh, repos-read.sh for targeted searchesAll scripts are in ./scripts/. Base URL: https://apigcp.trynia.ai/v2
./scripts/repos-list.sh # List indexed repos
./scripts/repos-index.sh "owner/repo" [branch] # Index a repo
./scripts/repos-status.sh "owner/repo" # Get repo status
./scripts/repos-tree.sh "owner/repo" [branch] # Get repo tree
./scripts/repos-read.sh "owner/repo" "path/to/file" # Read file
./scripts/repos-grep.sh "owner/repo" "pattern" # Grep code
All data source types (documentation, research papers, HuggingFace datasets) share the same tree/ls/read/grep operations.
./scripts/sources-list.sh [type] # List sources (documentation|research_paper|huggingface_dataset)
./scripts/sources-index.sh "https://docs.example.com" # Index docs
./scripts/sources-tree.sh "source_id_or_name" # Get source tree
./scripts/sources-ls.sh "source_id" "/path" # List directory contents
./scripts/sources-read.sh "source_id" "/path" # Read from source
./scripts/sources-grep.sh "source_id" "pattern" # Grep content
Flexible identifiers: Most data source endpoints accept UUID, display name, or URL:
550e8400-e29b-41d4-a716-446655440000Vercel AI SDK - Core, openai/gsm8khttps://docs.trynia.ai/, https://arxiv.org/abs/2312.00752./scripts/papers-list.sh # List indexed papers
./scripts/papers-index.sh "2312.00752" # Index paper (ID, URL, or PDF URL)
Supports multiple formats:
https://arxiv.org/abs/2312.00752https://arxiv.org/pdf/2312.00752.pdf2312.00752hep-th/99010012312.00752v1./scripts/datasets-list.sh # List indexed datasets
./scripts/datasets-index.sh "squad" # Index dataset (name, owner/dataset, or URL)
Supports: squad, dair-ai/emotion, https://huggingface.co/datasets/squad
./scripts/search-query.sh "query" "repos" [docs] # Query specific repos/sources with chat context
./scripts/search-universal.sh "query" # Search ALL indexed sources (hybrid vector+BM25)
./scripts/search-web.sh "query" [num_results] # Web search
./scripts/search-deep.sh "query" # Deep research (Pro)
search-query.sh - Main query endpoint for targeted searches:
repositories (repos only), sources (docs/papers/datasets only), unified (both)search-universal.sh - Searches all your indexed sources at once:
true as 3rd arg to include HuggingFace datasets (excluded by default)Search source code of public packages across npm, PyPI, crates.io, and Go modules.
./scripts/package-grep.sh "npm" "react" "pattern" # Grep package (npm|py_pi|crates_io|golang_proxy)
./scripts/package-hybrid.sh "npm" "react" "query" # Semantic search in packages
./scripts/package-read.sh "npm" "react" "sha256" 1 100 # Read lines from package file
Subscribe to publicly indexed sources for instant access without re-indexing.
./scripts/global-subscribe.sh "https://github.com/vercel/ai-sdk" # Subscribe to public source
Autonomous AI research agent with extended thinking and tool use.
Jobs API (recommended):
./scripts/oracle-job.sh "research query" # Create research job
./scripts/oracle-job-status.sh "job_id" # Get job status/result
./scripts/oracle-jobs-list.sh [status] [limit] # List jobs
Direct API:
./scripts/oracle.sh "research query" # Run research (blocking)
./scripts/oracle-sessions.sh # List research sessions
./scripts/usage.sh # Get API usage summary
The following endpoints exist in the API but don't have wrapper scripts:
GET/POST /categories - List/create categoriesPATCH/DELETE /categories/{id} - Update/delete categoryPATCH /data-sources/{id}/category - Assign category to sourcePOST/GET /contexts - Save/list conversation contextsGET /contexts/search - Text search contextsGET /contexts/semantic-search - Vector search contextsGET/PUT/DELETE /contexts/{id} - Get/update/delete contextPOST /dependencies/analyze - Analyze package manifestPOST /dependencies/subscribe - Subscribe to docs for all depsPOST /dependencies/upload - Upload manifest filePOST /advisor - Context-aware code advisorPOST/GET /local-folders - Create/list local foldersGET/DELETE /local-folders/{id} - Get/delete folderGET /local-folders/{id}/tree|ls|read - Browse filesPOST /local-folders/{id}/grep - Search in folderPOST /local-folders/{id}/classify - AI classificationPOST /local-folders/from-database - Import from SQLiteGET/POST /sources - List/create any source typeGET/PATCH/DELETE /sources/{id} - Manage sourceGET /sources/resolve - Resolve name/URL to IDPOST /search - Unified search with mode discriminatorhttps://apigcp.trynia.ai/v2| Type | Index Endpoint | Identifier Examples |
|---|---|---|
| Repository | POST /repositories | owner/repo, microsoft/vscode |
| Documentation | POST /data-sources | https://docs.example.com |
| Research Paper | POST /research-papers | 2312.00752, arXiv URL |
| HuggingFace Dataset | POST /huggingface-datasets | squad, owner/dataset |
| Local Folder | POST /local-folders | UUID, display name (private, user-scoped) |
For /search/query:
repositories - Search GitHub repositories onlysources - Search data sources only (docs, papers, datasets)unified - Search both repositories and data sources (default)Pass sources via:
repositories array: [{"repository": "owner/repo"}]data_sources array: ["display-name", "uuid", "https://url"]local_folders array: ["folder-uuid", "My Notes"]| Category | Endpoints |
|---|---|
| Repositories | GET/POST /repositories, GET/DELETE /repositories/{id}, /repositories/{id}/tree, /content, /grep |
| Data Sources | GET/POST /data-sources, GET/DELETE /data-sources/{id}, /tree, /ls, /read, /grep |
| Research Papers | GET/POST /research-papers |
| HuggingFace Datasets | GET/POST /huggingface-datasets |
| Search | POST /search/query, /search/universal, /search/web, /search/deep |
| Package Search | POST /package-search/grep, /hybrid, /read-file |
| Global Sources | POST /global-sources/subscribe |
| Oracle | POST /oracle, /oracle/jobs, GET /oracle/jobs/{id}, /oracle/sessions |
| Usage | GET /usage |