neuron-explorer
Steering-first neuron explorer for Qwen3.5-4B: push every MLP neuron, keep every rollout, browse the results
翻譯準備中
尚未偵測到更新。GitHub 發布版本後會顯示在這裡。
個人 GitHub 帳號下公開儲存庫的擁有者可以登入並驗證所有權,自行管理介紹,無需管理員核准。
登入並產生驗證檔案,在 30 分鐘內將其提交至此儲存庫的預設分支。其他分支或分叉儲存庫中的檔案無效。然後在下方檢查檔案,即可無需管理員核准直接管理專案。請保留檔案以維持管理權限。
如需登入,將前往登入頁面。登入後請回到此處,再次點擊所選的驗證按鈕。
在專案資料夾中執行 /nomorevibe verify,即可驗證所有權並自行管理介紹。
一分鐘完成驗證Multi-tenant RAG chatbot platform: FastAPI + LangGraph + pgvector backend, Next.js dashboard and embeddable widget
翻譯準備中
取自儲存庫 README
正在載入完整 README。 以下為已儲存的摘錄。
Train a chatbot on any website in minutes, embed it with one script tag, and
let it answer visitors with grounded, streamed replies while capturing leads.
• Backend: FastAPI · SQLAlchemy 2.0 (async) · Postgres + pgvector · LangGraph · OpenAI-compatible models
• Frontend: Next.js dashboard + embeddable widget
• Live: coming soon at https://rag.umairamir.com (API docs at /docs)
• Project docs: docs/ — architecture, API contract, decisions, roadmap (start here)
The answering path is a LangGraph state machine (backend/app/rag/graph.py):檢視完整 README ↗Train a chatbot on any website in minutes, embed it with one script tag, and let it answer visitors with grounded, streamed replies while capturing leads.
/docs)docs/ — architecture, API contract, decisions, roadmap (start here)flowchart LR
subgraph Training
A[Website URL] --> B[sitemap.xml + BFS crawl<br/>robots.txt, 5 concurrent]
B --> C[Strip nav/footer/cookie chrome<br/>heading-aware sections, FAQ pairing]
C --> D[Drop boilerplate + duplicate chunks<br/>BEFORE paying to embed]
D --> E[Batch embed<br/>text-embedding-3-small @1024d]
E --> F[(pgvector<br/>HNSW cosine index<br/>namespace = chatbot)]
end
subgraph "Answering (LangGraph)"
Q[Visitor question] --> G[recall → route → retrieve ⇄ rewrite → generate → capture_lead]
F --> G
G --> S[SSE token stream to widget]
end
The answering path is a LangGraph state machine (backend/app/rag/graph.py):
START → recall → route ─┬─ smalltalk ─────────────────────────────────┐
└─ knowledge → retrieve ─┬─ confident ────────┤
▲ ├─ weak follow-up → rewrite
└───────────────┘ (max 1 retry) │
generate → capture_lead → END
| Node | What it does | Problem it solves |
|---|---|---|
recall | Loads what we already know about the visitor (lead captured earlier) + details typed now | Bot re-asking for an email the visitor already gave |
route | Greetings/thanks skip retrieval | "hi" paying for an embedding and pulling random chunks into the prompt |
retrieve | pgvector top-40 → noise floor → hybrid rerank → dedupe → relative-score gate | Hallucination from footer/nav pollution; adjacent-topic bleed ("AI services" answered with blockchain offerings) |
rewrite | Turns a weak follow-up ("how much is it?") into a standalone query using the conversation, then retries retrieval once | Follow-ups embedded verbatim retrieve nothing, so the bot "forgets" what it just described |
generate | Streams tokens through LangGraph's stream writer → SSE | — |
capture_lead | Silently captures volunteered contact details; shows the form only on real intent, after a qualifying turn, when we still can't reach them | Form popping on the first message / asking for details just typed |
Each decision is a small node, unit-tested with fake models (tests/test_graph.py) — no API key or database needed.
Every chatbot gets a random 32-hex embed token that doubles as its knowledge
namespace. Every vector query filters by it, and every dashboard route checks
ownership (tests/integration/test_api.py::test_tenant_isolation).
backend/
app/
main.py FastAPI app, routers, lifespan
core/ settings (pydantic-settings), errors, dual CORS policy
auth/ Better-Auth-compatible auth: scrypt passwords, signed bearer sessions, Google OAuth
api/ routers: chat (SSE), chatbots, scrape (SSE), leads, analytics, users/admin
rag/ graph.py (LangGraph), retrieval.py, prompts.py, providers.py, vector_store.py
ingest/ crawler, HTML extraction/chunking, file parsing
services/ email, lead capture + forwarding (email / webhook / Google Sheet)
db/ SQLAlchemy models + async session
alembic/ migrations (idempotent initial schema — runs on the legacy DB too)
tests/ unit + graph tests; integration/ runs against real Postgres
frontend/ Next.js dashboard + widget
deploy/ nginx + VPS guide
docker compose -f docker-compose.dev.yml up -d # Postgres + pgvector on :5432
cd backend
cp .env.example .env # set OPENAI_API_KEY, AUTH_SECRET
uv sync
uv run alembic upgrade head
uv run fastapi dev app/main.py --port 4000 # http://localhost:4000/docs
cd ../frontend
cp .env.example .env.local
pnpm install && pnpm dev # http://localhost:3000
Tests:
cd backend
uv run pytest -q # unit + graph (integration auto-skips without a DB)
DATABASE_URL=postgresql://postgres:postgres@localhost:5432/ragpilot uv run pytest -q tests/integration
Any OpenAI-compatible provider works: set OPENAI_BASE_URL, OPENAI_CHAT_MODEL
and an embedding model that returns 1024 dimensions.
One VPS, Docker Compose, nginx + certbot in front. See deploy/README.md.
Ingestion and the chat graph depend on the VectorStore protocol in
backend/app/rag/vector_store.py, not on pgvector. A Qdrant/Pinecone/Weaviate
backend is one class implementing upsert, search, delete_namespace and
count, with the namespace as the tenant filter.