streamlit-agent  by langchain-ai

Streamlit apps showcasing LangChain agents

created 2 years ago
1,520 stars

Top 27.7% on sourcepulse

GitHubView on GitHub
Project Summary

This repository provides reference implementations of various LangChain agents integrated with Streamlit for interactive applications. It targets developers building LLM-powered applications who want to leverage Streamlit for user interfaces and LangChain for agentic capabilities, offering examples for common use cases like memory, search, and document interaction.

How It Works

The project showcases LangChain's agent and chain capabilities within Streamlit applications. It utilizes Streamlit's interactive components for user input and displays LLM responses, often incorporating LangChain's Callback integration for real-time updates and StreamlitChatMessageHistory for maintaining conversation state. Examples demonstrate specific LangChain tools and integrations, such as MRKL agents, document retrieval, and SQL database interaction.

Quick Start & Requirements

  • Install dependencies and run with Poetry:
    poetry install
    poetry shell
    streamlit run streamlit_agent/mrkl_demo.py
    
  • Requires an OpenAI API key (e.g., OPENAI_API_KEY environment variable).
  • Docker support is provided for building and running the applications.

Highlighted Details

  • Demonstrates streaming responses, conversation memory, MRKL agent replication, and search-enabled chatbots.
  • Includes examples for chatbots interacting with custom documents and SQL databases.
  • Features a chatbot for querying pandas DataFrames, noting a potential arbitrary code execution vulnerability in PythonAstREPLTool.
  • Integrates streamlit-feedback for collecting user feedback on responses and linking to LangSmith traces.

Maintenance & Community

  • Open to contributions for adding and improving agent and chain examples.
  • Links to other full examples of LangChain + Streamlit integrations are provided.

Licensing & Compatibility

  • The repository does not explicitly state a license in the provided README.

Limitations & Caveats

  • The chat_pandas_df.py example uses PythonAstREPLTool, which is noted as vulnerable to arbitrary code execution.
  • The absence of an explicit license may pose compatibility concerns for commercial or closed-source use.
Health Check
Last commit

1 year ago

Responsiveness

1 week

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

Explore Similar Projects

Feedback? Help us improve.