LangChain-ReAct-Agent  by lhh737

AI agent for intelligent customer service and report generation

Created 4 months ago
275 stars

Top 93.9% on SourcePulse

GitHubView on GitHub
Project Summary

This project provides an intelligent customer service and report generation system built on LangChain and LangGraph, leveraging the ReAct paradigm, Retrieval-Augmented Generation (RAG), and tool invocation. It targets users needing automated reasoning and knowledge retrieval for complex tasks, offering a transparent, step-by-step visualization of the agent's decision-making process via a Streamlit interface.

How It Works

The system implements the ReAct (Reasoning + Acting) pattern, enabling the agent to autonomously reason through user requests and decide on appropriate actions. It integrates RAG using Chroma as a vector database with DashScope embeddings for knowledge retrieval from documents (txt/pdf). The agent can invoke multiple tools, such as weather queries, user data retrieval, or report generation, dynamically switching between different system prompts based on the detected task type (e.g., general Q&A vs. report generation) via a middleware component. The entire process, from thought to action and observation, is visualized in a streaming interface.

Quick Start & Requirements

  • Primary install: pip install -r requirements.txt
  • Prerequisites: Python ≥ 3.10, DashScope API Key (obtainable from 阿里云百炼).
  • Setup: Clone the repo, install dependencies, configure the DASHSCOPE_API_KEY environment variable, initialize the knowledge base (python -c "from rag.vector_store import VectorStoreService; VectorStoreService().load_document()"), and run the application (streamlit run app.py).
  • Links: 阿里云百炼控制台 for API key application.

Highlighted Details

  • ReAct Paradigm: Facilitates autonomous reasoning and tool selection through a Thought → Action → Observation loop.
  • RAG Integration: Employs Chroma for vector storage and retrieval, supporting mixed document types (txt/pdf) with MD5 deduplication.
  • Multi-Tool Capability: Supports diverse tools including weather, user data, external data retrieval, and report context filling.
  • Dynamic Prompt Switching: Adapts system prompts based on runtime context for optimized task handling.
  • Streamlit Interface: Offers a fluid, step-by-step visualization of agent reasoning and execution.
  • Modular & Configurable: Features a modular structure (Agent, RAG, Model, Tools, Middleware) and is driven by YAML configuration files.

Maintenance & Community

No specific details regarding maintainers, community channels (like Discord/Slack), or project roadmap are provided in the README.

Licensing & Compatibility

  • License: MIT License.
  • Compatibility: The MIT license is permissive, generally allowing for commercial use and integration into closed-source projects.

Limitations & Caveats

The project's example scenario focuses on a robot vacuum cleaner, suggesting the RAG knowledge base and tools may be initially tailored to this domain. It requires a DashScope API key for LLM access.

Health Check
Last Commit

2 months ago

Responsiveness

Inactive

Pull Requests (30d)
0
Issues (30d)
0
Star History
22 stars in the last 30 days

Explore Similar Projects

Feedback? Help us improve.