Skip to content

This repository provides tutorials and implementations for various Generative AI Agent techniques, from basic to advanced. It serves as a comprehensive guide for building intelligent, interactive AI systems.

License

Notifications You must be signed in to change notification settings

NirDiamant/GenAI_Agents

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

56 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

PRs Welcome LinkedIn Twitter Discord

🌟 Support This Project: Your sponsorship fuels innovation in GenAI agent development. Become a sponsor to help maintain and expand this valuable resource!

GenAI Agents: Comprehensive Repository for Development and Implementation πŸš€

Welcome to one of the most extensive and dynamic collections of Generative AI (GenAI) agent tutorials and implementations available today. This repository serves as a comprehensive resource for learning, building, and sharing GenAI agents, ranging from simple conversational bots to complex, multi-agent systems.

πŸ“« Stay Updated!

Don't miss out on cutting-edge developments, new tutorials, and community insights!

Subscribe to DiamantAI's top 1% AI-focused Newsletter

DiamantAI's newsletter

πŸŽ‰ Join the AgentCraft Hackathon in conjunction with LangChain!

AgentCraft Hackathon

Register Now for the AgentCraft Hackathon!

Join us to build innovative AI agents and contribute to this open source while winning prizes!

Introduction

Generative AI agents are at the forefront of artificial intelligence, revolutionizing the way we interact with and leverage AI technologies. This repository is designed to guide you through the development journey, from basic agent implementations to advanced, cutting-edge systems.

Our goal is to provide a valuable resource for everyone - from beginners taking their first steps in AI to seasoned practitioners pushing the boundaries of what's possible. By offering a range of examples from foundational to complex, we aim to facilitate learning, experimentation, and innovation in the rapidly evolving field of GenAI agents.

Furthermore, this repository serves as a platform for showcasing innovative agent creations. Whether you've developed a novel agent architecture or found an innovative application for existing techniques, we encourage you to share your work with the community.

Related Projects

πŸ“š Dive into my comprehensive guide on RAG techniques to learn about integrating external knowledge into AI systems, enhancing their capabilities with up-to-date and relevant information retrieval.

πŸ–‹οΈ Explore my Prompt Engineering Techniques guide for an extensive collection of prompting strategies, from fundamental concepts to advanced methods, improving your ability to communicate effectively with AI language models.

A Community-Driven Knowledge Hub

This repository grows stronger with your contributions! Join our vibrant Discord community β€” the central hub for shaping and advancing this project together 🀝

GenAI Agents Discord Community

Whether you're a novice eager to learn or an expert ready to share your knowledge, your insights can shape the future of GenAI agents. Join us to propose ideas, get feedback, and collaborate on innovative implementations. For contribution guidelines, please refer to our CONTRIBUTING.md file. Let's advance GenAI agent technology together!

πŸ”— For discussions on GenAI, agents, or to explore knowledge-sharing opportunities, feel free to connect on LinkedIn.

Key Features

  • πŸŽ“ Learn to build GenAI agents from beginner to advanced levels
  • 🧠 Explore a wide range of agent architectures and applications
  • πŸ“š Step-by-step tutorials and comprehensive documentation
  • πŸ› οΈ Practical, ready-to-use agent implementations
  • 🌟 Regular updates with the latest advancements in GenAI
  • 🀝 Share your own agent creations with the community

GenAI Agent Implementations

Explore our extensive list of GenAI agent implementations, ranging from simple to complex:

🌱 Beginner-Friendly Agents

  1. Simple Conversational Agent

    Overview πŸ”Ž

    A context-aware conversational AI maintains information across interactions, enabling more natural dialogues.

    Implementation πŸ› οΈ

    Integrates a language model, prompt template, and history manager to generate contextual responses and track conversation sessions.

  2. Simple Question Answering Agent

    Overview πŸ”Ž

    Answering (QA) agent using LangChain and OpenAI's language model understands user queries and provides relevant, concise answers.

    Implementation πŸ› οΈ

    Combines OpenAI's GPT model, a prompt template, and an LLMChain to process user questions and generate AI-driven responses in a streamlined manner.

  3. Simple Data Analysis Agent

    Overview πŸ”Ž

    An AI-powered data analysis agent interprets and answers questions about datasets using natural language, combining language models with data manipulation tools for intuitive data exploration.

    Implementation πŸ› οΈ

    Integrates a language model, data manipulation framework, and agent framework to process natural language queries and perform data analysis on a synthetic dataset, enabling accessible insights for non-technical users.

πŸ”§ Framework Tutorial: LangGraph

  1. Introduction to LangGraph: Building Modular AI Workflows

    Overview πŸ”Ž

    This tutorial introduces LangGraph, a powerful framework for creating modular, graph-based AI workflows. Learn how to leverage LangGraph to build more complex and flexible AI agents that can handle multi-step processes efficiently.

    Implementation πŸ› οΈ

    Step-by-step guide on using LangGraph to create a StateGraph workflow. The tutorial covers key concepts such as state management, node creation, and graph compilation. It demonstrates these principles by constructing a simple text analysis pipeline, serving as a foundation for more advanced agent architectures.

πŸ” Task-Specific Agents

  1. Customer Support Agent (LangGraph)

    Overview πŸ”Ž

    An intelligent customer support agent using LangGraph categorizes queries, analyzes sentiment, and provides appropriate responses or escalates issues, automating initial stages of customer interaction for improved efficiency and satisfaction.

    Implementation πŸ› οΈ

    Utilizes LangGraph to create a workflow combining state management, query categorization, sentiment analysis, and response generation. The system uses TypedDict for state management and implements conditional routing based on query characteristics.

  2. Essay Grading Agent (LangGraph)

    Overview πŸ”Ž

    An automated essay grading system using LangGraph and an LLM model evaluates essays based on relevance, grammar, structure, and depth of analysis, streamlining assessment processes in educational settings.

    Implementation πŸ› οΈ

    Utilizes a state graph to define the grading workflow, incorporating separate grading functions for each criterion. The system employs conditional logic to determine the flow of the grading process based on interim scores, with a final weighted average calculation.

  3. Travel Planning Agent (LangGraph)

    Overview πŸ”Ž

    A Travel Planner using LangGraph demonstrates how to build a stateful, multi-step conversational AI application that collects user input and generates personalized travel itineraries.

    Implementation πŸ› οΈ

    Utilizes StateGraph to define the application flow, incorporates custom PlannerState for process management, and employs node functions for city input, interests input, and itinerary creation. The system integrates an LLM to generate the final personalized travel itinerary.

🎨 Creative and Generative Agents

  1. GIF Animation Generator Agent (LangGraph)

    Overview πŸ”Ž

    A GIF animation generator that integrates LangGraph for workflow management, GPT-4 for text generation, and DALL-E for image creation, producing custom animations from user prompts.

    Implementation πŸ› οΈ

    Utilizes LangGraph to orchestrate a workflow that generates character descriptions, plots, and image prompts using GPT-4, creates images with DALL-E 3, and assembles them into GIFs using PIL. Employs asynchronous programming for efficient parallel processing.

  2. TTS Poem Generator Agent (LangGraph)

    Overview πŸ”Ž

    An advanced text-to-speech (TTS) agent using LangGraph and OpenAI's APIs classifies input text, processes it based on content type, and generates corresponding speech output.

    Implementation πŸ› οΈ

    Utilizes LangGraph to orchestrate a workflow that classifies input text using GPT models, applies content-specific processing, and converts the processed text to speech using OpenAI's TTS API. The system adapts its output based on the identified content type (general, poem, news, or joke).

  3. Music Compositor Agent (LangGraph)

    Overview πŸ”Ž

    An AI Music Compositor using LangGraph and OpenAI's language models generates custom musical compositions based on user input. The system processes the input through specialized components, each contributing to the final musical piece, which is then converted to a playable MIDI file.

    Implementation πŸ› οΈ

    LangGraph orchestrates a workflow that transforms user input into a musical composition, using ChatOpenAI (GPT-4) to generate melody, harmony, and rhythm, which are then style-adapted. The final AI-generated composition is converted to a MIDI file using music21 and can be played back using pygame.

πŸš€ Advanced Agent Architectures

  1. Memory-Enhanced Conversational Agent

    Overview πŸ”Ž

    A memory-enhanced conversational AI agent incorporates short-term and long-term memory systems to maintain context within conversations and across multiple sessions, improving interaction quality and personalization.

    Implementation πŸ› οΈ

    Integrates a language model with separate short-term and long-term memory stores, utilizes a prompt template incorporating both memory types, and employs a memory manager for storage and retrieval. The system includes an interaction loop that updates and utilizes memories for each response.

  2. Multi-Agent Collaboration System

    Overview πŸ”Ž

    A multi-agent collaboration system combining historical research with data analysis, leveraging large language models to simulate specialized agents working together to answer complex historical questions.

    Implementation πŸ› οΈ

    Utilizes a base Agent class to create specialized HistoryResearchAgent and DataAnalysisAgent, orchestrated by a HistoryDataCollaborationSystem. The system follows a five-step process: historical context provision, data needs identification, historical data provision, data analysis, and final synthesis.

  3. Self-Improving Agent

    Overview πŸ”Ž

    A Self-Improving Agent using LangChain engages in conversations, learns from interactions, and continuously improves its performance over time through reflection and adaptation.

    Implementation πŸ› οΈ

    Integrates a language model with chat history management, response generation, and a reflection mechanism. The system employs a learning system that incorporates insights from reflection to enhance future performance, creating a continuous improvement loop.

  4. Task-Oriented Agent

    Overview πŸ”Ž

    A language model application using LangChain that summarizes text and translates the summary to Spanish, combining custom functions, structured tools, and an agent for efficient text processing.

    Implementation πŸ› οΈ

    Utilizes custom functions for summarization and translation, wrapped as structured tools. Employs a prompt template to guide the agent, which orchestrates the use of tools. An agent executor manages the process, taking input text and producing both an English summary and its Spanish translation.

  5. Internet Search and Summarize Agent

    Overview πŸ”Ž

    An intelligent web research assistant that combines web search capabilities with AI-powered summarization, automating the process of gathering information from the internet and distilling it into concise, relevant summaries.

    Implementation πŸ› οΈ

    Integrates a web search module using DuckDuckGo's API, a result parser, and a text summarization engine leveraging OpenAI's language models. The system performs site-specific or general searches, extracts relevant content, generates concise summaries, and compiles attributed results for efficient information retrieval and synthesis.

  6. Multi agent research team - Autogen

    Overview πŸ”Ž

    This technique explores a multi-agent system for collaborative research using the AutoGen library. It employs agents to solve tasks collaboratively, focusing on efficient execution and quality assurance. The system enhances research by distributing tasks among specialized agents.

    Implementation πŸ› οΈ

    Agents are configured with specific roles using the GPT-4 model, including admin, developer, planner, executor, and quality assurance. Interaction management ensures orderly communication with defined transitions. Task execution involves collaborative planning, coding, execution, and quality checking, demonstrating a scalable framework for various domains.

    Additional Resources πŸ“š

  7. Blog Writer (Open AI Swarm)

    Overview πŸ”Ž

    A multi-agent system for collaborative blog post creation using OpenAI's Swarm package. It leverages specialized agents to perform research, planning, writing, and editing tasks efficiently.

    Implementation πŸ› οΈ

    Utilizes OpenAI's Swarm Package to manage agent interactions. Includes an admin, researcher, planner, writer, and editor, each with specific roles. The system follows a structured workflow: topic setting, outlining, research, drafting, and editing. This approach enhances content creation through task distribution, specialization, and collaborative problem-solving.

    Additional Resources πŸ“š

  8. Podcast Internet Search and Generate Agent πŸŽ™οΈ

    Overview πŸ”Ž

    A two step agent that first searches the internet for a given topic and then generates a podcast on the topic found. The search step uses a search agent and search function to find the most relevant information. The second step uses a podcast generation agent and generation function to create a podcast on the topic found.

    Implementation πŸ› οΈ

    Utilizes LangGraph to orchestrate a two-step workflow. The first step involves a search agent and function to gather information from the internet. The second step uses a podcast generation agent and function to create a podcast based on the gathered information.

🌟 Special Advanced Technique 🌟

  1. Sophisticated Controllable Agent for Complex RAG Tasks πŸ€–

    Overview πŸ”Ž

    An advanced RAG solution designed to tackle complex questions that simple semantic similarity-based retrieval cannot solve. This approach uses a sophisticated deterministic graph as the "brain" 🧠 of a highly controllable autonomous agent, capable of answering non-trivial questions from your own data.

    Implementation πŸ› οΈ

    β€’ Implement a multi-step process involving question anonymization, high-level planning, task breakdown, adaptive information retrieval and question answering, continuous re-planning, and rigorous answer verification to ensure grounded and accurate responses.

Getting Started

To begin exploring and building GenAI agents:

  1. Clone this repository:
    git clone https://github.com/NirDiamant/GenAI_Agents.git
    
  2. Navigate to the technique you're interested in:
    cd all_agents_tutorials/technique-name
    
  3. Follow the detailed implementation guide in each technique's notebook.

Contributing

We welcome contributions from the community! If you have a new technique or improvement to suggest:

  1. Fork the repository
  2. Create your feature branch: git checkout -b feature/AmazingFeature
  3. Commit your changes: git commit -m 'Add some AmazingFeature'
  4. Push to the branch: git push origin feature/AmazingFeature
  5. Open a pull request

Contributors

Contributors

License

This project is licensed under a custom non-commercial license - see the LICENSE file for details.


⭐️ If you find this repository helpful, please consider giving it a star!

Keywords: GenAI, Generative AI, Agents, NLP, AI, Machine Learning, Natural Language Processing, LLM, Conversational AI, Task-Oriented AI

About

This repository provides tutorials and implementations for various Generative AI Agent techniques, from basic to advanced. It serves as a comprehensive guide for building intelligent, interactive AI systems.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

 

Packages

No packages published