Top Tweets for #ChatOpenAI
Holy shit.
OpenAI just launched Operator and charged $200/month for it.
Someone built the exact same thing: open source, free, runs locally.
It's called browser-use.
78,000 GitHub stars.
Your AI agent can now:
- Click buttons
- Fill out forms
- Scrape any website
- Apply to jobs
- Book flights
- Manage your inbox
All in plain Python. No cloud. No subscription. Your data never leaves your machine.
3 lines of code to start:
agent = Agent(
task="Find the cheapest flight to Tokyo next week",
llm=ChatOpenAI(model="gpt-4o")
)
That's it. It runs in your browser and doe

I fired OpenAI this morning!
It wasn't because of the price.
It wasn't because of the tokens.
but, because I realised,
I didn't own my product. They did!
how?
I looked at my backend.
It was a mess of hardcoded API calls.
To test Claude 3, I had to rewrite the logic.
To run Llama locally for privacy, I had to rewrite the infrastructure.
I was trapped.
Most developers think the asset is the prompt.
They are dead wrong.
The asset is the flexibility.
I changed that.
I spent the afternoon deleting my custom wrappers.
I stopped treating models as
objects .
I replaced them with a standard interface using @langchain
Now, the specific model is just a variable.
I can now easily switch from a paid proprietary model to a free open-source model.
Run it on my own hardware in one line of code.
Here is what changed:
ChatOpenAI -> ChatAnthropic.
ChatAnthropic -> ChatHuggingFace
ChatHuggingFace used: HuggingFaceEndpoint - inference api
HuggingfacePipeline- local download
The rest of the code doesn't even blink.
This means more focus on architecting and less on rewriting
A wise one said,
If you build for provider, you are a customer.
If you build for the abstraction, you are the architect.
So which one are you building for ?

linghua jin This creates true collaboration: Researcher grounds in facts (RAG), critic ensures quality, writer synthesizes. In production, add more agents (e.g., fact-checker with web tool) or structured outputs for reliable routing.This pattern scales to complex tasks like research papers, code debugging teams, or enterprise workflows. If you want extensions (e.g., hierarchical teams, human-in-loop, or full tool integration), let me know! 🚀angGraph excels at building multi-agent systems by defining multiple specialized agents as nodes in a graph, with a supervisor/orchestrator managing the flow. This creates collaborative workflows where agents handle distinct roles (e.g., researcher, critic, writer) and pass state between them.A classic pattern is the Supervisor-Agent Team (inspired by LangChain/LangGraph docs and popular 2025 tutorials): A supervisor agent decomposes tasks, routes to worker agents (e.g., one for retrieval/RAG, one for analysis, one for synthesis), and decides when to finalize.Key Benefits for Multi-Agent in LangGraphState Sharing: All agents access/modify a shared state (e.g., messages, retrieved docs, research notes).
Hierarchical Control: Supervisor uses conditional routing to delegate and loop.
Scalability: Easy to add agents (e.g., fact-checker, tool specialist).
Persistence: Checkpointing for long-running research tasks.
Full Working Example: Multi-Agent Research Team (Agentic RAG Style)This example creates a team for complex queries:Researcher Agent: Handles retrieval (RAG tool).
Critic Agent: Grades/Reflects on quality.
Writer Agent: Generates final answer.
Supervisor Agent: Routes between them, decides when done.
Assumes LangGraph, LangChain, OpenAI, and a vector store (Chroma). Install: pip install langgraph langchain langchain-openai chromadb.pythonfrom typing import Literal, TypedDict, Annotated, List
from langgraph.graph import StateGraph, END
from langgraph.checkpoint.sqlite import SqliteSaver
from langchain_openai import ChatOpenAI
from langchain_core.messages import HumanMessage, AIMessage, BaseMessage
from langchain_core.tools import tool
from langchain_chroma import Chroma
from langchain_openai import OpenAIEmbeddings
import operator
# Setup retriever (mock docs)
embeddings = OpenAIEmbeddings()
vectorstore = Chroma(collection_name="multi_rag", embedding_function=embeddings)
vectorstore.add_texts([
"LangGraph is a framework for building stateful multi-agent systems.",
"RAG improves LLM accuracy by retrieving external knowledge.",
"Multi-agent collaboration reduces hallucinations."
])
@tool
def retrieve(query: str) -> str:
"""Retrieve relevant documents."""
docs = vectorstore.similarity_search(query, k=3)
return "\n\n".join([https://t.co/t7KewOB8on_content for doc in docs])
tools = [retrieve]
llm = ChatOpenAI(model="gpt-4o-mini", temperature=0)
llm_with_tools = llm.bind_tools(tools)
# Shared State
class AgentState(TypedDict):
messages: Annotated[List[BaseMessage], operator.add]
next: str # Who to route to next
# Worker Agents
def researcher(state: AgentState):
messages = state["messages"]
response = llm_with_tools.invoke(messages)
return {"messages": [response]}
def critic(state: AgentState):
# Simple critique: ask LLM to evaluate relevance
last_msg = state["messages"][-1].content
critique_prompt = f"Critique this research output for relevance and completeness:\n{last_msg}\nSuggest improvements if needed."
response = llm.invoke(critique_prompt)
return {"messages": [AIMessage(content=f"Critique: {response.content}")]}
def writer(state: AgentState):
messages = state["messages"]
write_prompt = f"Synthesize a clear, final answer using all prior research:\n{messages[-3:]}" # Last few exchanges
response = llm.invoke(write_prompt)
return {"messages": [response]}
# Supervisor (routes and decides end)
members = ["researcher", "critic", "writer"]
system_prompt = (
f"You are a supervisor managing a team: {', '.join(members)}. "
"Route the task to the best agent or FINISH when complete. "
"Only route to one at a time. Use FINISH when the writer has produced a final answer."
)
options = ["FINISH"] + members
def supervisor(state: AgentState):
messages = state["messages"]
supervisor_chain = llm.bind_tools([]) # No tools needed
response = supervisor_chain.invoke(
[{"role": "system", "content": system_prompt}] + messages
)
# Parse next route (in real: use structured output or tool calling)
route = response.content.lower()
next_agent = "FINISH"
for member in members:
if member in route:
next_agent = member
break
return {"next": next_agent, "messages": [response]}
# Build Graph
workflow = StateGraph(AgentState)
workflow.add_node("supervisor", supervisor)
workflow.add_node("researcher", researcher)
workflow.add_node("critic", critic)
workflow.add_node("writer", writer)
# Routing from supervisor
workflow.set_entry_point("supervisor")
for member in members:
workflow.add_edge(member, "supervisor") # Always return to supervisor
# Conditional routing
def route_next(state: AgentState):
return state["next"]
workflow.add_conditional_edges(
"supervisor",
route_next,
{"researcher": "researcher", "critic": "critic", "writer": "writer", "FINISH": END}
)
# Compile with memory
memory = SqliteSaver.from_conn_string(":memory:")
graph = workflow.compile(checkpointer=memory)
# Run example
config = {"configurable": {"thread_id": "team1"}}
inputs = {"messages": [HumanMessage(content="Explain how multi-agent systems improve RAG accuracy.")]}
for event in https://t.co/BvSETxIBW1(inputs, config):
for key, value in event.items():
if key != "__end__":
print(f"{key.upper()}: {value.get('messages', [-1]).content[:200]}...\n")
How It WorksUser query → Supervisor decides first agent (likely researcher).
Researcher retrieves docs → Returns to supervisor.
Supervisor routes to critic → Critique → Back.
Eventually routes to writer → Final answer → Supervisor sees "FINISH" → Ends.
Loop continues until supervisor chooses FINISH.
The hybrid LLM stack in the RAG pipeline is a serial killer.🚀
I paired OpenAI's embeddings model with DeepSeek-R1 for generation in the RAG pipeline.
✅Result: Improved Retrieval quality(15–30% recall boost) while cutting Generation cost by ~10x.
I wanted to build HyDE Retrieval capability in my RAG application. OpenAI is used solely for embeddings and hypothetical generation in HyDE (via ChatOpenAI for the zero-shot doc creation).
The pipeline then switches to DeepSeek-R1 (via a compatible wrapper like ChatDeepSeek or a custom integration) for the final augmentation and response generation. Generation is where you burn 95% of your API tokens, and DeepSeek LLm is almost 10 times cheaper than OpenAI per 1M token.
This leverages the strengths of both: OpenAI's superior embedding quality for retrieval (with HyDE boosting relevance on challenging queries), and DeepSeek's cost efficiency for high-volume generation.
Will be publishing a detailed technical blog after finishing the project.
PS. The image below is just a selected(cut) part of my process flow diagram, not the whole system design diagram.

📦 Import Key Packages 🎁
Import the necessary packages for seamless integration: `WardenAgentKit`, `WardenToolkit`, `ChatOpenAI`, `MemorySaver`, and `createReactAgent`. Build your AI agent foundation. 📦

使用langchin调用和deepseek原生有所区别,需要如下方式:// 初始化模型
this.model = new ChatOpenAI({
modelName: 'deepseek-ai/DeepSeek-R1',
temperature: 0.7,
maxTokens: 2000,
topP: 0.95,
frequencyPenalty: 0.3,
presencePenalty: 0.3,
openAIApiKey: process.env.OPENAI_API_KEY,
configuration: {
baseURL: process.env.OPENAI_API_BASE_URL // Changed to baseURL
}
});
This is a financial analysis tool, the user uploads a simple csv file with some performance figures and receives a full financial report, including specified competitor analysis.
ChatOpenAI | LLM
Framework | LangGraph
LLM browsing | Tavily
GUI | Streamlit
Analytics | Pandas
2/4 🧵 Here's an example of how you might integrate a new tool or service into an graph/agent:
`tools = []`
`async with LanggraphMCPClient(params) as mcp:`
` tools.extend(await mcp.get_tools())`
` graph = create_react_agent(ChatOpenAI("gpt-4"), tools=tools)`
Most Popular Users

Elon Musk 
@elonmusk
239.4M followers

Barack Obama 
@barackobama
118.5M followers

Cristiano Ronaldo 
@cristiano
114.3M followers

Donald J. Trump 
@realdonaldtrump
111.7M followers

Narendra Modi 
@narendramodi
106.9M followers

Rihanna 
@rihanna
98.6M followers

NASA 
@nasa
92M followers

Justin Bieber 
@justinbieber
91.7M followers

KATY PERRY 
@katyperry
89.9M followers

Taylor Swift 
@taylorswift13
83.9M followers

Lady Gaga 
@ladygaga
75.4M followers

Virat Kohli 
@imvkohli
73.3M followers

Kim Kardashian 
@kimkardashian
70.8M followers

YouTube 
@youtube
68.6M followers

Neymar Jr 
@neymarjr
66.3M followers

Bill Gates 
@billgates
65.1M followers

Selena Gomez 
@selenagomez
63M followers

The Ellen Show
@theellenshow
62.1M followers

CNN 
@cnn
61.6M followers

X 
@x
60.6M followers









