{"id":15442366,"url":"https://github.com/langchain-ai/streamlit-agent","last_synced_at":"2025-05-15T11:02:45.280Z","repository":{"id":176741612,"uuid":"652923728","full_name":"langchain-ai/streamlit-agent","owner":"langchain-ai","description":"Reference implementations of several LangChain agents as Streamlit apps","archived":false,"fork":false,"pushed_at":"2024-08-04T14:55:12.000Z","size":12494,"stargazers_count":1437,"open_issues_count":8,"forks_count":701,"subscribers_count":17,"default_branch":"main","last_synced_at":"2025-04-11T19:59:39.713Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/langchain-ai.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-06-13T04:15:45.000Z","updated_at":"2025-04-11T06:43:50.000Z","dependencies_parsed_at":"2024-01-16T08:56:32.546Z","dependency_job_id":"f760a254-7683-45ab-bb72-103b675a0dea","html_url":"https://github.com/langchain-ai/streamlit-agent","commit_stats":{"total_commits":63,"total_committers":8,"mean_commits":7.875,"dds":0.4285714285714286,"last_synced_commit":"634e1cecf23d7ca3a4c5e708944673e057765b2a"},"previous_names":["langchain-ai/streamlit-agent"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/langchain-ai%2Fstreamlit-agent","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/langchain-ai%2Fstreamlit-agent/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/langchain-ai%2Fstreamlit-agent/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/langchain-ai%2Fstreamlit-agent/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/langchain-ai","download_url":"https://codeload.github.com/langchain-ai/streamlit-agent/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254328385,"owners_count":22052632,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-01T19:27:02.117Z","updated_at":"2025-05-15T11:02:45.185Z","avatar_url":"https://github.com/langchain-ai.png","language":"Python","funding_links":[],"categories":["👍 Credits","Learning","A01_文本生成_文本对话","Personal Assistants \u0026 Conversational Agents","AI Agents"],"sub_categories":["Repositories","大语言对话模型及数据","Chatbots"],"readme":"# 🦜️🔗 LangChain 🤝 Streamlit agent examples\n\n[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/langchain-ai/streamlit-agent?quickstart=1)\n\nThis repository contains reference implementations of various LangChain agents as Streamlit apps including:\n\n- `basic_streaming.py`: Simple streaming app with `langchain.chat_models.ChatOpenAI` ([View the app](https://langchain-streaming-example.streamlit.app/))\n- `basic_memory.py`: Simple app using `StreamlitChatMessageHistory` for LLM conversation memory ([View the app](https://langchain-st-memory.streamlit.app/))\n- `mrkl_demo.py`: An agent that replicates the [MRKL demo](https://python.langchain.com/docs/modules/agents/how_to/mrkl) ([View the app](https://langchain-mrkl.streamlit.app))\n- `minimal_agent.py`: A minimal agent with search (requires setting `OPENAI_API_KEY` env to run)\n- `search_and_chat.py`: A search-enabled chatbot that remembers chat history ([View the app](https://langchain-chat-search.streamlit.app/))\n- `simple_feedback.py`: A chat app that allows the user to add feedback on responses using [streamlit-feedback](https://github.com/trubrics/streamlit-feedback), and link to the traces in [LangSmith](https://docs.smith.langchain.com/) ([View the app](https://langsmith-simple-feedback.streamlit.app/))\n- `chat_with_documents.py`: Chatbot capable of answering queries by referring custom documents ([View the app](https://langchain-document-chat.streamlit.app/))\n- `chat_with_sql_db.py`: Chatbot which can communicate with your database ([View the app](https://langchain-chat-sql.streamlit.app/))\n- `chat_pandas_df.py`: Chatbot to ask questions about a pandas DF (Note: uses `PythonAstREPLTool` which is vulnerable to arbitrary code execution,\n  see [langchain #7700](https://github.com/langchain-ai/langchain/issues/7700))\n\nApps feature LangChain 🤝 Streamlit integrations such as the\n[Callback integration](https://python.langchain.com/docs/modules/callbacks/integrations/streamlit) and\n[StreamlitChatMessageHistory](https://python.langchain.com/docs/integrations/memory/streamlit_chat_message_history).\n\n## More great app examples\n\nCheck out some other full examples of apps that utilize LangChain + Streamlit:\n\n- [Auto-graph](https://auto-graph.streamlit.app/) - Build knowledge graphs from user-input text ([Source code](https://github.com/langchain-ai/langchain-benchmarks/blob/main/extraction/streamlit_app.py))\n- [Web Explorer](https://web-explorer.streamlit.app/) - Retrieve and summarize insights from the web ([Source code](https://github.com/langchain-ai/web-explorer))\n- [LangChain Teacher](https://lang-teacher.streamlit.app/) - Learn LangChain from an LLM tutor ([Source code](https://github.com/langchain-ai/langchain-teacher))\n- [Text Splitter Playground](https://langchain-text-splitter.streamlit.app/) - Play with various types of text splitting for RAG ([Source code](https://github.com/langchain-ai/text-split-explorer))\n- [Tweet Generator](https://elon-twitter-clone.streamlit.app/) - Fine tune GPT-3.5 on tweets ([Source code](https://github.com/langchain-ai/twitter-finetune))\n\n## Setup\n\nThis project uses [Poetry](https://python-poetry.org/) for dependency management.\n\n```shell\n# Create Python environment\n$ poetry install\n\n# Install git pre-commit hooks\n$ poetry shell\n$ pre-commit install\n```\n\n## Running\n\n```shell\n# Run mrkl_demo.py or another app the same way\n$ streamlit run streamlit_agent/mrkl_demo.py\n```\n\n# Running with Docker\n\nThis project includes `Dockerfile` to run the app in Docker container. In order to optimise the Docker Image is optimised for size and building time with cache techniques.\n\nTo generate Image with `DOCKER_BUILDKIT`, follow below command\n\n```DOCKER_BUILDKIT=1 docker build --target=runtime . -t langchain-streamlit-agent:latest```\n\n1. Run the docker container directly\n\n``docker run -d --name langchain-streamlit-agent -p 8051:8051 langchain-streamlit-agent:latest ``\n\n2. Run the docker container using docker-compose (Recommended)\n\nEdit the Command in `docker-compose` with target streamlit app\n\n``docker-compose up``\n\n## Contributing\n\nWe plan to add more agent and chain examples over time and improve the existing ones - PRs welcome! 🚀\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flangchain-ai%2Fstreamlit-agent","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flangchain-ai%2Fstreamlit-agent","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flangchain-ai%2Fstreamlit-agent/lists"}