百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
C

chat-twitter

> 编程语言
开源

与算法聊天 就开源的 Twitter 算法提出问题。该应用程序在此公开托管: https://chat-twitter.verce…

391 stars0 点赞2 次浏览
访问官网GitHub

工具介绍

与算法聊天 就开源的 Twitter 算法提出问题。该应用程序在此公开托管: https://chat-twitter.verce…

Chat With the Algorithm

Ask questions about the open-sourced Twitter algorithm.

The app is publicly hosted here: https://chat-twitter.vercel.app/. Instructions for hosting it yourself are below.

Basic architecture

The app is a NextJS/Tailwind CSS frontend with a FastAPI backend. The frontend is hosted on Vercel and the backend is hosted on a small node on fly.io. The backend uses a Pinecone vector DB on the free tier. There is a Dockerfile provided.

Right now, I'm footing the OpenAI bill on the public instance. But I may require users to bring their own key in the future.

Running locally

  1. Set up environment variables
OPENAI_API_KEY=...
OPENAI_ORG_ID=... # organization id, found in Manage account > settings
PINECONE_API_KEY=...
  1. Clone the repo
bash
git clone https://github.com/mtenenholtz/chat-twitter.git
cd chat-twitter
  1. Install Node dependencies
bash
npm i
  1. Run the Node server
bash
npm run dev
  1. In another terminal, install the Python dependencies
bash
# in the backend/ directory
pip install -r requirements.txt
  1. Embed the Twitter codebase
bash
# in the backend/ directory
python create_vector_db.py
  1. Set up a Pinecone index. Give it a vector dimension of 1536 and name it pinecone-index. You can change this in backend/main.py if you want.

  2. Run the backend server

uvicorn main:app --reload
  1. The URL for the backend is currently hard coded to the live server URL. You will have to change this to localhost or your other server name.

Potential improvements

I will continue development on this project as demand exists. But, if I abandon it, here are some ideas:

  • The dependency on Pinecone could be removed and replaced with a simple NumPy array. I just wanted to try Pinecone.
  • Replace the chat_stream endpoint with a websocket implementation.
  • Ask the model not to generatively reference its sources. Instead, simply copy the code snippet directly.
  • The splitter could be improved. Right now, it's a character splitter that favors newlines, but OpenAI has implemented a similar one that splits on tokens instead.
  • The embeddings and retrieval mechanisms could account for the hierarchy of the Algorithm's code structure, like Replit's Ghostwriter does.
  • The UI could be improved a lot. I suck at JS.

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

JavaScript

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言