Getting Started
Needle provides retrieval-augmented generation (RAG) tools that you can use in your AI projects.
Although in the web UI, you can connect and use numerous other tools in Needle, this documentation is focused on the Needle RAG SDKs.
The easiest way to enable semantic search across your data is to use Needle. We implement and maintain fully-managed state-of-the-art RAG pipelines, so you can focus on shipping AI agents and applications fast.
We strive for a minimalistic user experience. You only need to 1. upload files and 2. perform semantic search. See below how.
from needle.v1 import NeedleClient
from needle.v1.models import FileToAdd
needle = NeedleClient()
collection = needle.collections.create(name="AI Platforms")
# 1. upload files
needle.collections.files.add(
collection_id=collection_id,
files=[
FileToAdd(
name="Needle Website",
url="https://needle-ai.com",
)
],
)
# 2. perform semantic search
prompt = "What is the main product of Needle?"
results = needle.collections.search(collection_id, text=prompt)
Furthermore, Needle comes with batteries included; you can use it out of the box with
- your favourite programming language, Python, Typescript, etc.
- best AI frameworks, MCP, Vercel AI SDK, etc.
- via our drop-in widget to enable RAG chatbots on your website
You can find more details on these later in the documentation.
Example Use Cases
Here are some examples of what you can do with Needle:
- Prompt your technical documentation and get instant answers.
- Find answers to customers' requests instantly from your help/FAQ page.
- Search your company's internal documents (Legal, HR, Financial Reports, Designs, etc.) in seconds.
- Talk to all research papers in your area.
- Build chatbot assistants specialized in one topic.
Good thing about using Needle is that you get back answers from AI always with references without any hallucination, so that you can trust the results.
Core concepts
As mentioned, the most common actions you need to take are 1. upload data and 2. perform search. See the information below for the terminology and concepts you need to know.
Collections
A collection is a group of files that you put together and can perform a search on. Collections are central to many actions in Needle. They also act as access control points. You can share your collections with your team members so they can extend and explore further.
Files
A file is, as expected, a unit of data in Needle.
We support a wide range of file formats, for the up-to-date list check needle-ai.com.
Indexing
When a file is added to a collection, it automatically goes through the indexing process. Once the indexing is done, the file is ready to be searched. This may take several minutes depending on the size of the file. You can see and track the status of the files in the collection, either in the web UI or by querying from our APIs.
Chunks
A chunk is a part of the file. When a file is indexed, it is split into chunks. When you perform a search, Needle finds relevant chunks for your prompt and returns them as search results.
Connectors
We know how painful it is to upload files manually and keep them up-to-date if your data is changing. Because of this, Needle provides built-in connectors to automate this process.
Connectors read and synchronize data from the source to Needle on a regular basis. You can create connectors in the web UI - and in most cases, you will need to configure a connector only once.
We support a wide range of connectors, for the up-to-date list check needle-ai.com.
Usage Limits
In order to ensure fair usage of our services, we implemented some limits. All functionality is rate limited to prevent abuse. Furthermore, we have limits that apply to the free tier of Needle. You can find the details in the pricing page.
Next Steps
Now that we have covered the core concepts, you are ready to start using Needle. In the next section, we will guide you through how to enhance SQL documentation using Needle, so that you, as a data analyst, can find answers to your SQL questions instantly.