skillfed

needle-python

Needle client library for Python

needle-python v0.6.0 174.2K downloads/30d#10,287 on PyPI45
Permissive license MIT AGING released

What it is and what it does

needle-python is a client library that wraps the Needle API, a service for indexing documents and performing semantic search. It abstracts the REST API into Python objects and methods, allowing you to create collections, upload files (from URLs), wait for indexing, and retrieve semantically relevant context from your documents. The library is designed to integrate into RAG pipelines—you use it to extract relevant passages from your indexed documents, then feed those passages as context to an LLM (like OpenAI's GPT) to generate grounded answers.

The library depends only on requests for HTTP communication and supports Python 3.8 through 3.13. It reads your Needle API key from the NEEDLE_API_KEY environment variable by default, though you can pass it explicitly. The fact sheet shows the library is in Beta status, with modest but stable maintenance; it has not been updated recently but has no known vulnerabilities and a permissive MIT license.

Use it for:

  • Build a RAG system that indexes PDFs or web documents and retrieves relevant passages to answer user questions grounded in those documents.
  • Create a knowledge base where users can upload files to a collection and search across them semantically without writing custom indexing logic.
  • Prototype LLM applications that need to augment prompts with real document context, reducing hallucination by grounding answers in indexed material.
  • Integrate document search into an existing Python application without managing your own vector database or embedding infrastructure.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Python client library for the Needle API, enabling document indexing, collection management, and semantic search to power retrieval-augmented generation (RAG) pipelines.

Yes, if you need semantic search and document indexing for a RAG pipeline and prefer a managed service over self-hosted infrastructure. The library is straightforward to use, has low install friction, and carries no security vulnerabilities. However, the aging maintenance status (no updates in months) and modest adoption (45 repository stars) suggest you should verify that Needle's API remains actively supported before committing to production use. Suitable for prototyping and moderate-scale applications; evaluate alternatives if you need active development or extensive customization.

Install

needle-python on PyPI

pip

pip install needle-python

uv

uv add needle-python

poetry

poetry add needle-python

Installing needle-python

Before you install

Low install friction with a single runtime dependency (requests). Maintenance status is aging—last commit was 2025-07-27, roughly 383 days after initial release, with modest repository activity (45 stars). No recent updates suggest the library is stable but not actively developed.

License in practice

MIT license (permissive) means you can use, modify, and distribute this library with minimal restrictions, provided you retain the license notice.

Quickstart

pip install needle-python

from needle.v1 import NeedleClient
from needle.v1.models import FileToAdd

ndl = NeedleClient()
collection = ndl.collections.create(name="My Collection")
files = ndl.collections.files.add(
    collection_id=collection.id,
    files=[FileToAdd(name="doc.pdf", url="https://example.com/doc.pdf")]
)
results = ndl.collections.search(collection.id, text="query")

Requires NEEDLE_API_KEY environment variable or explicit API key parameter; Python >=3.8 required.

Verify before relying

  • Whether the library's search performance scales well with large document collections or many concurrent requests.
  • Current state of API stability and whether breaking changes are expected given the aging maintenance status.
  • Whether FileToAdd and other model types support additional parameters beyond name and url for file ingestion.

Package facts

License MIT (permissive)
Python support supports the current Python release (<4.0,>=3.8)
Install friction low — pure-Python wheel
Runtime dependencies 1 — requests
Maintenance aging — 383 days since the last release
Last repo commit
First released
Downloads 174,175/month — #10,287 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: needle_python-0.6.0-py3-none-any.whl

Keywords: needle, api, retrieval-augmented generation, rag, information-retrieval, artificial intelligence, ai

Development Status :: 4 - BetaIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Scientific/Engineering :: Artificial IntelligenceTopic :: Software Development :: Libraries :: Python Modules

Tags

needle api python clientrag retrieval augmented generationdocument indexing and searchsemantic search libraryai context retrievalinformation retrieval pythonneedle document management
ragsemantic-searchdocument-indexing

More Python Modules packages

idna

Converts domain names between Unicode and…

permissive · top 100 on PyPI

setuptools

Setuptools is a Python build backend and…

permissive · top 100 on PyPI

PyYAML

PyYAML parses and emits YAML 1.1 data format,…

permissive · top 100 on PyPI

pydantic

Pydantic validates Python data structures…

permissive · top 100 on PyPI

annotated-types

Provides reusable metadata objects for use with…

permissive · top 100 on PyPI

typing-inspection

Provides runtime tools to inspect and…

permissive · top 100 on PyPI

h2ogpte

Python client for querying and managing…

unclear · top 15,000 on PyPI

llama-index-core

LlamaIndex Core provides foundational…

permissive · top 5,000 on PyPI

langchain-graph-retriever

Retrieves documents from a graph structure…

permissive · top 15,000 on PyPI

agent-framework-azure-ai-search

Provides RAG (Retrieval Augmented Generation)…

permissive · top 15,000 on PyPI

llama-index-vector-stores-lancedb

Integrates LanceDB as a vector store backend…

permissive · top 15,000 on PyPI

lightrag-hku

LightRAG is a retrieval-augmented generation…

permissive · top 15,000 on PyPI

graph-retriever

Combines vector similarity search with graph…

permissive · top 15,000 on PyPI

llama-index-embeddings-azure-openai

Integrates Azure OpenAI's embedding models with…

permissive · top 15,000 on PyPI

ragstack-ai-knowledge-store

Stores and retrieves LangChain documents using…

unclear · top 15,000 on PyPI

pyvespa

pyvespa provides a Python API to create,…

permissive · top 5,000 on PyPI