I'm Building an AI Project: Here Are the Libraries I'm Going to Use...
Tags: webdev, programming, tutorial, ai
Published: 2024-01-26 12:53:46

With the right libraries any developer can build powerful AI features into their applications (like a Ninja 🥷).

In this list, I've compiled 7 awesome AI libraries you can use to (relatively) easily ship features today. 

Don't forget to star these libraries to show them your support. 



![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qqoipyuoxgb83swyoo4a.gif)

{% cta https://github.com/CopilotKit/CopilotKit %} Star ⭐️ {% endcta %}

---

## 1. [CopilotPortal](https://github.com/CopilotKit/CopilotKit): Build an app-native AI chatbot


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0x1bwwzvc2mnrfrvsqn7.png)

In-app AI chatbot assistant that can 'see' your current app state and take actions in the frontend and backend. 

A set of fully customizable react components & hooks and the architecture for establishing the interaction between the LLM and your app. 

Define _useMakeCopilotReadable_, _useMakeCopilotActionable_, and _CopilotSidebarUIProvider_ to get it running. 


```tsx
import "@copilotkit/react-ui/styles.css";
import { CopilotProvider } from "@copilotkit/react-core";
import { CopilotSidebarUIProvider } from "@copilotkit/react-ui";

export default function App(): JSX.Element {
  return (
  <CopilotProvider chatApiEndpoint="/api/copilotkit/chat">
      <CopilotSidebarUIProvider>

        <YourContent />

      </CopilotSidebarUIProvider>
    </CopilotProvider>
  );
}
```


{% cta https://github.com/CopilotKit/CopilotKit %} Star CopilotPortal ⭐️ {% endcta %}

---

## 2. [RAGxplorer](https://github.com/gabrielchua/RAGxplorer) - Visualise and explore your RAG documents


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/z365bk6wa7i4md3w4b5z.png)

RAGxplorer is a Python tool for visualizing RAG (Retrieval-Augmented Generation) documents in machine learning and natural language processing. 

Interactively explore the connections and content within docs used in your RAG process. 

To set up RAGxplorer, define your RAG checkpoint path in the code and install the specified dependencies.

```tsx 
import streamlit as st
from utils.rag import build_vector_database

st.set_page_config(page_title="RAGxplorer", page_icon="🔍")
uploaded_file = st.file_uploader("Upload your PDF", type='pdf')
query = st.text_input("Enter your query")
search = st.button("Search")
top_k = st.number_input("Number of Chunks", value=5, min_value=1)
st.session_state["chroma"] = build_vector_database(uploaded_file, ...)
st.session_state['retrieved_id'] = query_chroma(...)
plot_embeddings(...)

```
{% cta https://github.com/gabrielchua/RAGxplorer %} Star RAGxplorer ⭐️ {% endcta %}

---
## 3. [Tavily GPT Researcher](https://github.com/assafelovic/gpt-researcher) - Get an LLM to Search the Web & Databases




![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4accv5t5ep1l1tkj4ze2.png)

Tavily enables you to add GPT-powered research and content generation tools to your React applications, enhancing their data processing and content creation capabilities.



```tsx 
# Create an assistant
assistant = client.beta.assistants.create(
    instructions=assistant_prompt_instruction,
    model="gpt-4-1106-preview",
    tools=[{
        "type": "function",
        "function": {
            "name": "tavily_search",
            "description": "Get information on recent events from the web.",
            "parameters": {
                "type": "object",
                "properties": {
                    "query": {"type": "string", "description": "The search query to use. For example: 'Latest news on Nvidia stock performance'"},
                },
                "required": ["query"]
            }
        }
    }]
)
```
{% cta https://github.com/assafelovic/gpt-researcher %} Star Tavily ⭐️ {% endcta %}

---


## 4. [Pezzo.ai](https://github.com/pezzolabs/pezzo) - Developer first LLMOps platform



![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nxvbgi5zkghkb0t64npw.jpeg)

Centralized platform for managing your OpenAI calls. 

Optimize your prompts & token use. Keep track of your AI use.

Free & easy to integrate. 

```tsx 
const prompt = await pezzo.getPrompt("AnalyzeSentiment");
const response = await openai.chat.completions.create(prompt);
```
{% cta https://github.com/pezzolabs/pezzo %} Star Pezzo ⭐️ {% endcta %}

---


##5. [DeepEval](https://github.com/confident-ai/deepeval) - Evaluate LLM, RAG & Fine-Tuning Performance


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dowjupr91bepvopxsudd.jpeg)

DeepEval is an open-source framework that simplifies the evaluation of LLMs by treating evaluations as unit tests. 

It provides various metrics to assess LLM outputs, and its modular design allows developers to customize their evaluation pipelines

To use it, you install the library, write test cases, and run these to evaluate your LLM's performance.

```tsx 
Pytest Integration: 

from deepeval import assert_test
from deepeval.metrics import HallucinationMetric
from deepeval.test_case import LLMTestCase

test_case = LLMTestCase(
 input="How many evaluation metrics does DeepEval offers?",
 actual_output="14+ evaluation metrics",
 context=["DeepEval offers 14+ evaluation metrics"]
)
metric = HallucinationMetric(minimum_score=0.7)

def test_hallucination():
  assert_test(test_case, [metric])
```

{% cta https://github.com/confident-ai/deepeval %} Star DeepEval ⭐️ {% endcta %}

---

## 6. [CopilotTextarea](https://github.com/RecursivelyAI/CopilotKit) - AI-powered Writing in React Apps



![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/a2ctyhzd1hytek22s500.gif)


A drop-in replacement for any react `<textarea>` with the features of Github CopilotX. 

Autocompletes, insertions, edits.

Can be fed any context in real time or by the developer ahead of time.


```ts
import { CopilotTextarea } from "@copilotkit/react-textarea";
import { CopilotProvider } from "@copilotkit/react-core";


// Provide context...
useMakeCopilotReadable(...)

// in your component...
<CopilotProvider>
    <CopilotTextarea/>
</CopilotProvider>`
```

{% cta https://github.com/RecursivelyAI/CopilotKit %} Star CopilotTextarea ⭐️ {% endcta %}

---
##7.[SwirlSearch](https://github.com/swirlai/swirl-search) - AI powered search. 



![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/b8f4hycstwmx2gev8di7.gif)

Swirl Search is an open-source platform that uses AI to search multiple data sources simultaneously and to provide drafted reports on them. 

It can search across various sources, including search engines, databases, and cloud services, and is designed to be set up easily by following the installation instructions provided in the repository. 

Swirl Search is built on the Python/Django stack, released under the Apache 2.0 license, and is available as a Docker image, making it accessible and customizable for users.


{% cta https://github.com/swirlai/swirl-search
 %} Star SwirlSearch ⭐️ {% endcta %}


---
Thanks for reading! Don't forget to bookmark the article, give your reactions, and to support and checkout the awesome libraries mentioned. 

Cheers!