Skip to main content

langchain-nia

LangChain integration for Nia AI — code search, research, and knowledge management.

Installation

pip install langchain-nia

Setup

Set your Nia API key:

export NIA_API_KEY="nk_..."

Quick Start

Using individual tools

from langchain_nia import NiaSearch

tool = NiaSearch()
result = tool.invoke({"query": "how to use React hooks"})

Using the toolkit

from langchain_nia import NiaToolkit

toolkit = NiaToolkit()
tools = toolkit.get_tools()  # Returns all 20 Nia tools

You can control which tool groups are included:

toolkit = NiaToolkit(
    include_search=True,
    include_sources=True,
    include_github=True,
    include_contexts=True,
    include_dependencies=True,
)

With a LangChain agent

from langchain_nia import NiaToolkit
from langchain_openai import ChatOpenAI

llm = ChatOpenAI(model="gpt-4o")
toolkit = NiaToolkit()
tools = toolkit.get_tools()

llm_with_tools = llm.bind_tools(tools)

Available Tools

Search (5 tools)

  • NiaSearch — Semantic search across indexed repos, docs, and data sources
  • NiaWebSearch — Web search with category and date filtering
  • NiaDeepResearch — Multi-step comprehensive research
  • NiaUniversalSearch — Search all sources simultaneously
  • NiaAdvisor — Analyze code against indexed documentation

Source Management (7 tools)

  • NiaIndex — Index new sources (repos, docs, papers, datasets)
  • NiaSourceList — List indexed sources
  • NiaSourceSubscribe — Subscribe to pre-indexed public sources
  • NiaSourceSync — Re-sync indexed sources
  • NiaRead — Read files/pages from indexed sources
  • NiaGrep — Regex search within indexed sources
  • NiaExplore — Browse file tree of indexed sources

GitHub (4 tools)

  • NiaGitHubSearch — Search code in GitHub repos
  • NiaGitHubRead — Read files from GitHub repos
  • NiaGitHubGlob — Find files matching glob patterns
  • NiaGitHubTree — Browse repo file tree

Context/Memory (2 tools)

  • NiaContextSave — Save context for cross-agent sharing
  • NiaContextSearch — Semantic search over saved contexts

Dependencies (2 tools)

  • NiaDependencySubscribe — Auto-subscribe to docs for project dependencies
  • NiaDependencyAnalyze — Analyze manifests to preview indexable dependencies

Metadata

Release files for langchain-nia 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for langchain-nia 0.1.0
File Size Uploaded
langchain_nia-0.1.0.tar.gz 205.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for langchain-nia 0.1.0
File Interpreter ABI Platform
langchain_nia-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 230.8 kB

Release files / langchain_nia-0.1.0.tar.gz

Download URL langchain_nia-0.1.0.tar.gz
Size 205.2 kB
Tags Source
SHA-256 checksum
How to use checksums
093f407e80a6116dbc672da980d4a1ce1acfa5932b33dd4c6969e8a9020a7cb6
BLAKE2b-256 checksum
How to use checksums
0af969cc855c81af14c747940f3e7bcef116d17574b3173466338cbc5f60f284
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.3

Release files / langchain_nia-0.1.0-py3-none-any.whl

Download URL langchain_nia-0.1.0-py3-none-any.whl
Size 25.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bc2fdf0810ccba50eca80bc94e659a23477a6e6419aba8a70169b49dac4a80cb
BLAKE2b-256 checksum
How to use checksums
fa3e82539a97ba1d0a569afbd93340460a00c549968fa928a692f044f8cc4023
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.3

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page