Skip to main content

An integration package connecting Nia AI and LangChain

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

langchain_nia-0.1.0.tar.gz (205.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

langchain_nia-0.1.0-py3-none-any.whl (25.6 kB view details)

Uploaded Python 3

File details

Details for the file langchain_nia-0.1.0.tar.gz.

File metadata

  • Download URL: langchain_nia-0.1.0.tar.gz
  • Upload date:
  • Size: 205.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.3

File hashes

Hashes for langchain_nia-0.1.0.tar.gz
Algorithm Hash digest
SHA256 093f407e80a6116dbc672da980d4a1ce1acfa5932b33dd4c6969e8a9020a7cb6
MD5 42a520da4727564a052a6fafa16c702f
BLAKE2b-256 0af969cc855c81af14c747940f3e7bcef116d17574b3173466338cbc5f60f284

See more details on using hashes here.

File details

Details for the file langchain_nia-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: langchain_nia-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 25.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.3

File hashes

Hashes for langchain_nia-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bc2fdf0810ccba50eca80bc94e659a23477a6e6419aba8a70169b49dac4a80cb
MD5 c0c943de4245862572d5da6849d4024d
BLAKE2b-256 fa3e82539a97ba1d0a569afbd93340460a00c549968fa928a692f044f8cc4023

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page