Skip to content

RestApi Retriever

⚠️ DEPRECATION WARNING

This component is deprecated and will be removed in a future version of Nappai. Please migrate to the recommended alternative components.

The RestApi Retriever is a bridge that allows your automation workflows to communicate with external web services. It sends a search request to a specific API and brings back relevant documents or data that you can use in subsequent steps of your process. This component is commonly used to feed information into AI assistants or knowledge bases.

How it Works

This component operates by connecting to a REST API (a standard way for applications to exchange data over the internet). When you configure the component with the correct URL and a search query, it sends that request to the external service. The service processes the request and returns a list of documents or data.

The Retriever then organizes this data into a structured format, making it ready for you to use. You can view the results directly or pass them along to other components, such as AI models, to generate answers or perform further actions.

Inputs

Input Fields

  • URL: The web address of the external API you want to connect to. This tells the component where to send your search requests.
  • Search Query: The text or keywords you want to search for. The external API will look for information based on this input.
  • Number of Results: The maximum number of items or documents you expect the API to return. This helps control the amount of data processed.

Outputs

  • Retriever: A reusable tool object that encapsulates the connection settings. You can connect this to other components that require a retriever to fetch data from the same API.
  • Search Results: A list of structured documents retrieved from the API. Each item contains the content and metadata of the found documents, ready to be used in your workflow.

Output Data Example (JSON)

This example shows the structure of the data you will receive in the Search Results output. The exact content depends on what your API returns. json [ { “content”: “Relevant information found regarding your search query.”, “metadata”: { “source”: “external_api”, “id”: “doc_12345”, “score”: 0.95 } }, { “content”: “Additional document retrieved from the API with related data.”, “metadata”: { “source”: “external_api”, “id”: “doc_12346”, “score”: 0.82 } } ]

Connectivity

In a typical workflow, this component connects to other nodes that need external data.

  • Search Results can be connected to AI agents, RAG (Retrieval-Augmented Generation) components, or data processing nodes that need to read the retrieved documents.
  • Retriever can be connected to other retriever-based components if you need to reuse the same API connection in different parts of your workflow.

Usage Example

Imagine you are building a workflow to answer customer questions using your company’s internal help desk data.

  1. Configure the RestApi Retriever with the URL of your help desk API.
  2. Enter a search query like “How to reset password” in the Search Query field.
  3. Set the Number of Results to a reasonable value, such as 5.
  4. Connect the Search Results output to an AI component.
  5. The AI component will use the retrieved documents to generate a helpful answer for the user.

Important Notes

🔒 Use HTTPS for Sensitive Data 🔴 If you send or receive sensitive information, use an HTTPS endpoint to encrypt the traffic and protect against eavesdropping.

🔒 Authentication Not Handled 🔴 The component does not add authentication headers. Ensure your API handles authentication securely or add headers manually if needed.

⚠️ Requires a Working API Endpoint 🟡 The component retrieves data through the URL you provide. If the endpoint is unavailable or unreachable, the search will return no results or fail.

⚠️ Development‑Stage Component 🔴 Marked as in development, the component may have bugs or incomplete features. Use with caution in production environments.

⚠️ No Vector Store Output 🟡 This component does not produce a vector store; it only returns a retriever and search results. It cannot be used where a vector store is required.

📋 Default URL Points to Localhost 🟢 The default URL points to http://localhost:59958. Update it to the correct external endpoint before running your workflow.

📋 Search Query Can Be Empty 🟡 Leaving the search query empty may return no results or all documents, depending on your API. Provide a query to control the output.

💡 Set the Correct API URL 🟢 Change the default localhost URL to the actual address of your REST API. The component will not work if the URL is incorrect.

💡 Provide Specific Search Queries 🟢 Using detailed and specific queries yields more relevant results and reduces the amount of data processed by the API.

💡 Adjust Number of Results 🟢 Set the number_of_results to a reasonable value. Requesting too many results may slow the API and increase load times.

Tips and Best Practices

  • Always verify that your API URL is correct and accessible before running your workflow.
  • Use HTTPS endpoints to ensure data security during transmission.
  • Write clear and specific search queries to get the most relevant results.
  • Limit the number of results to improve performance and reduce processing time.
  • Check the API documentation to understand how to handle authentication and error responses.

Security Considerations

  • Encryption: Ensure your API endpoint uses HTTPS to protect data in transit. Avoid sending sensitive information over plain HTTP connections.
  • Authentication: This component does not manage login credentials automatically. You must ensure your external API is configured to handle authentication securely, or add necessary authentication headers manually in your API configuration.
  • Data Privacy: Be mindful of the data returned by the API. If the API returns sensitive information, ensure your downstream components handle it securely.