
Introduction
If you’ve ever worked with AI coding assistants like Cursor, GitHub Copilot, or Claude Code, you know they can be incredibly powerful, but also inconsistent. Sometimes it nails your code style, sometimes it forgets everything you’ve established.
This is where AGENTS.md comes in. It’s an open standard for guiding AI coding agents. Think of it as a README for AI, a dedicated file that provides context, conventions, and instructions that help AI assistants work effectively on your coding projects.
In this article, I’ll show you how to use this AGENTS.md file to build Streamlit apps across all deployment targets: local development, Streamlit Community Cloud, and Streamlit in Snowflake (SiS).
What is AGENTS.md?
AGENTS.md is a simple, open format adopted by over 60,000 open-source projects, including repositories from OpenAI, Apache, and Google. It emerged from collaborative efforts across the AI software development ecosystem.
The key insight is that README.md files are for humans, while AGENTS.md is for AI agents. It contains the detailed context that AI coding assistants need: build commands, code conventions, testing patterns, and domain-specific knowledge.
Where These Patterns Come From
The Streamlit AGENTS.md isn’t theoretical. It’s built from real-world experience:
- 30 Days of AI: A 30-day learning series teaching AI app development with Streamlit and Snowflake Cortex (GitHub). Each day’s lesson contributed battle-tested patterns for chatbots, RAG systems, streaming responses, and agent orchestration.
- Experience in Streamlit Development: Patterns refined from building dozens of Streamlit applications over 2024–2025, including data dashboards, cheminformatics tools, ML apps, and enterprise applications deployed to Streamlit in Snowflake.
Every pattern in this AGENTS.md has been validated in production. The AI_COMPLETE function, the universal connection pattern, the streaming chat interface: all emerged from solving real-world problems across different deployment environments.
Why This Works
The AGENTS.md approach works because:
- Minimal friction: One file reference, a few questions, complete app
- Smart defaults: Caching, error handling, and UI components are inferred
- Environment-aware: Automatically handles SiS vs Community Cloud differences
- Complete output: Every app includes app.py, requirements.txt, README.md
- Consistent patterns: Same proven code patterns every time
Download AGENTS.md
To proceed further, download the Streamlit AGENTS.md file from this GitHub repo:
streamlit/AGENTS.md at main · dataprofessor/streamlit

Getting Started in Using Streamlit AGENTS.md
The Streamlit AGENTS.md supports two modes of operation, making it effortless to get started.
To start, download and copy the Streamlit AGENTS.md to your project.
Mode 1: Quick Start with Instructions
If you know what you want, just tell the AI:
@AGENTS.md build me a chatbot using Snowflake Cortex
Here’s how it looks like in Cursor:

In a nutshell, the AI will:
- Use your instruction as the starting point
- Infer reasonable defaults
- Ask only 1–2 clarifying questions if critical info is missing
- Build the complete app with all files
Here’s the first question and our corresponding answer:

After a few moments, the AI is getting to work:

After about a minute or so, completed app is completed and the app structure and its core features are summarized:

This is followed by instructions on how to run the app:

And it doesn’t stop there, you can ask follow-up questions to assist you in understanding the created app:

Or you can also continue to vibe code and make incremental improvements to the app.
Mode 2: Guided Sequential Questions
If you’re not sure what you need, just reference the file:
@AGENTS.md
Here’s what it looks like in Cursor:

The AI will guide you through questions one at a time:
- “What would you like to build?” → chatbot, dashboard, data tool
- “Where will it run?” → local, Community Cloud, Snowflake
- “What’s your data source?” → CSV, Snowflake, APIs
- “Which LLM?” (only if you mentioned AI) → Cortex or OpenAI
Then it builds, inferring UI components from app type and adding caching automatically.
Here’s our first question:

The second question:

The third question:

And that’s all, it’ll proceed to building the app:

Once it’s completed, we get a summary of what’s been built:

Along with instructions on deployment:

What Gets Created
When you build an app with the AGENTS.md, you get a complete, deployment-ready project:
my_app/
├── app.py # Main application
├── requirements.txt # Dependencies with versions
├── README.md # GitHub-ready documentation
└── .streamlit/
└── secrets.toml.example # Credentials template (if needed)
The README.md
Every app includes a README with:
- TLDR: One sentence describing the app
- Features: Bullet list of capabilities
- Run Locally: Step-by-step commands
- Deploy to Community Cloud: 5-step guide
- Deploy to SiS: 3-step guide
No more creating documentation manually!
Example Apps
Two complete example apps were built using the AGENTS.md guided flow. Both are available in the examples/ folder.
Example 1: Chatbot
A conversational AI chatbot powered by Snowflake Cortex.
The Q&A Flow:
Here’s the questions and answers:
- What would you like to build? Simple chatbot
- Where will it run? Community Cloud
- Which LLM? Cortex
What Got Created:
examples/chatbot_app/
├── app.py # Chat interface with streaming
├── requirements.txt # streamlit, snowflake-snowpark-python
└── README.md # Deployment instructions
Features: Chat interface, model selector (Claude/Llama/Mistral), conversation history, response caching.
A few questions. Complete app. Ready to deploy.
Example 2: Stock Dashboard
A real-time stock dashboard using the Yahoo Finance data.
The Q&A Flow:
Here’s the questions and answers:
- What would you like to build? Dashboard
- Where will it run? Snowflake
- What’s your data source? yfinance
What Got Created:
examples/stock_dashboard/
├── app.py # Dashboard with Plotly charts
├── requirements.txt # streamlit, yfinance, plotly
└── README.md # Deployment instructions
Features: Candlestick charts, volume analysis, key metrics, time period selector.
Three questions. The AI knew not to ask about LLMs (dashboards don’t need them) and automatically omitted st.set_page_config() for SiS compatibility as it is an unsupported feature on SiS.
Key Patterns that AGENTS.md Teaches AI
1. Universal Database Connection
Works across all three deployment environments:
@st.cache_resource
def get_session():
try:
from snowflake.snowpark.context import get_active_session
return get_active_session()
except:
from snowflake.snowpark import Session
return Session.builder.configs(
st.secrets["connections"]["snowflake"]
).create()
2. Snowflake Cortex LLM with AI_COMPLETE
The recommended pattern for universal compatibility:
import json
from snowflake.snowpark.functions import ai_complete
@st.cache_data(show_spinner=False)
def call_llm(prompt: str, model: str = "claude-3-5-sonnet") -> str:
df = session.range(1).select(
ai_complete(model=model, prompt=prompt).alias("response")
)
response_raw = df.collect()[0][0]
response_json = json.loads(response_raw)
if isinstance(response_json, dict) and "choices" in response_json:
return response_json["choices"][0]["messages"]
return str(response_json)
3. Chat Interface with Streaming
st.session_state.setdefault("messages", [])
for msg in st.session_state.messages:
with st.chat_message(msg["role"]):
st.markdown(msg["content"])
if prompt := st.chat_input("Your message"):
st.session_state.messages.append({"role": "user", "content": prompt})
with st.chat_message("user"):
st.markdown(prompt)
with st.chat_message("assistant"):
response = st.write_stream(stream_response(prompt))
st.session_state.messages.append({"role": "assistant", "content": response})
4. SiS-Aware Code
The AI automatically knows:
- SiS deployment → No st.set_page_config()
- Community Cloud → Include st.set_page_config()
- Both → Use the universal connection pattern
Pattern Selection Guide
Based on what you ask for, the AI selects the right patterns:
+-------------------------+---------------------------------------------+
| You Say | AI Uses |
+-------------------------+---------------------------------------------+
| chatbot, AI assistant | Chat Interface + Streaming + AI_COMPLETE |
+-------------------------+---------------------------------------------+
| dashboard, | Basic App + Plotly/Altair Charts |
| visualization | |
+-------------------------+---------------------------------------------+
| data analysis | File Upload + DataFrame Styling |
+-------------------------+---------------------------------------------+
| RAG, search documents | Chat + Cortex Search + AI_COMPLETE |
+-------------------------+---------------------------------------------+
| multipage | st.navigation + Session State |
+-------------------------+---------------------------------------------+
| Snowflake, SiS | Omit st.set_page_config + Cortex patterns |
+-------------------------+---------------------------------------------+
Caching is added automatically wherever beneficial.
Common Pitfalls Prevented
The AGENTS.md teaches the AI to avoid common mistakes:
1. Duplicate Widget Keys
# AI learns to always add unique keys
st.text_input("Name:", key="first_name")
st.text_input("Name:", key="last_name")
2. Page Config in SiS
# AI omits st.set_page_config() when targeting SiS
# (it's not supported)
3. Session State in Multipage Apps
# AI initializes in main app.py, not individual pages
st.session_state.setdefault("df", None)
pg = st.navigation(...)
pg.run()
Conclusion
Building a Streamlit app couldn’t be easier. With the AGENTS.md file, you can truly vibe code. Just describe what you want, answer a few questions, and watch your app come to life.
Instead of explaining patterns in detail, going through several rounds of promptings and hoping that AI gets it right.
Here’s what you get from using AGENTS.md:
- Two modes: Quick instructions or guided questions
- Sequential flow: One question at a time, not overwhelming
- Smart inference: UI components and caching handled automatically
- Complete projects: App, requirements, and README ready to deploy
- Environment-aware: SiS compatibility built in
Check out the examples/ folder in the repo to see the chatbot and dashboard apps created using this exact flow.
Resources
- AGENTS.md Official Website
- Streamlit Documentation
- Snowflake Cortex AI
- Streamlit in Snowflake
- Example Apps: Example apps built with AGENTS.md
<hr /><p>Vibe code Streamlit apps with AI using AGENTS.md was originally published in Streamlit on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>