Phidata: 8.3K Stars! Create AI Agents with Long-Term Memory Using GPT-4o

Project Overview

Phidata is an open-source framework designed to build automated assistants (intelligent agents) with memory, knowledge, and tool capabilities. This framework addresses the limitations of existing large language models (LLMs) in terms of context and their inability to perform actions by adding a database to store chat history, a vector database to store business context, and tools that allow for API calls, significantly enhancing the capabilities of intelligent assistants. Phidata supports building and deploying AI applications quickly using Streamlit, FastApi, or Django services.

Join the AI Community by Scanning the QR Code

Get More Technical Support and Communication

(Please Specify Your Profession)

Phidata: 8.3K Stars! Create AI Agents with Long-Term Memory Using GPT-4o
Phidata: 8.3K Stars! Create AI Agents with Long-Term Memory Using GPT-4o

Problems Addressed

Large language models (LLMs) have limited context and cannot perform actions.

Solution: Enhance memory, knowledge, and tools.

· Memory: Store chat history in a database to enable long-term conversations for LLMs.

· Knowledge: Store information in a vector database to provide context in business scenarios for LLMs.

· Tools: Enable LLMs to perform actions such as pulling data from APIs, sending emails, or querying databases.

How It Works

Step 1: Create an assistant.

Step 2: Add tools (functions), knowledge (vector database), and storage (database).

Step 3: Use Streamlit, FastApi, or Django to build your AI application.

Video Tutorial

Installation

Run the following code:

pip install -U phidata

Usage

1. Create a file named assistant.py.

from phi.assistant import Assistant
from phi.tools.duckduckgo import DuckDuckGo
assistant = Assistant(tools=[DuckDuckGo()], show_tool_calls=True)
assistant.print_response("Whats happening in France?", markdown=True)

2. Install the libraries, export your OPENAI_API_KEY, and run the assistant.

pip install openai duckduckgo-search
export OPENAI_API_KEY=sk-xxxx
python assistant.py

Quick Experience

This open-source project has some functional libraries; if you want a quick experience, you can clone and use it directly.

· LLM OS: Use LLM as the CPU for an emerging operating system.

https://github.com/phidatahq/phidata/tree/main/cookbook/llm_os

· Autonomous RAG: Empower LLMs with tools to search their knowledge, web, or chat history.

https://github.com/phidatahq/phidata/tree/main/cookbook/examples/auto_rag

· Local RAG: Fully local RAG equipped with Ollama and PgVector.

https://github.com/phidatahq/phidata/tree/main/cookbook/llms/ollama/rag

· Investment Researcher: Use Llama3 and Groq to generate investment reports on stocks.

https://github.com/phidatahq/phidata/tree/main/cookbook/llms/groq/investment_researcher

· News Articles: Write news articles using Llama3 and Groq.

https://github.com/phidatahq/phidata/tree/main/cookbook/llms/groq/news_articles

· Video Summaries: Summarize YouTube videos using Llama3 and Groq.

https://github.com/phidatahq/phidata/tree/main/cookbook/llms/groq/video_summary

· Research Assistant: Write research reports using Llama3 and Groq.

https://github.com/phidatahq/phidata/tree/main/cookbook/llms/groq/research

DEMO

Access the following AI applications built with phidata:

PDF AI, capable of summarizing PDF files and answering questions.

https://pdf.aidev.run/

ArXiv AI, answering questions about ArXiv papers using the ArXiv API.

https://arxiv.aidev.run/

HackerNews AI, summarizing stories, users, and sharing the latest updates on HackerNews.

https://hn.aidev.run/

Project Links

https://github.com/phidatahq/phidata

Follow the “Open Source AI Project Implementation” public account.

Get Closer to the AI Era

Leave a Comment