StackPilot is a full-stack AI developer workspace that lets developers interact with GitHub repositories, technical documentation, PDFs, Markdown files, and codebases using natural language.
It combines Retrieval-Augmented Generation (RAG), vector embeddings, semantic search, repository indexing, and LLM-powered reasoning to provide context-aware, grounded, and source-cited answers.
💡 Live Demo: https://stack-pilot-jet.vercel.app
Understanding an unfamiliar codebase often means jumping between source files, documentation, GitHub issues, and search engines.
StackPilot brings these resources into one AI-powered workspace.
You can ask questions such as:
- 🧠 "Explain this project."
- 🔍 "Where is authentication implemented?"
- 📁 "Explain the folder structure."
- ⚙️ "How does this function work?"
- 📚 "Summarize this documentation."
- 🚀 "Generate an onboarding guide for this repository."
- 🛠️ "Suggest improvements to this implementation."
Responses are grounded in retrieved project context and can include source citations for verification.
Ask natural-language questions about your imported repositories, documentation, and uploaded knowledge sources.
Import public GitHub repositories and analyze:
- Repository metadata
- README files
- Folder structures
- Source files
- Documentation
- Code context
Import technical documentation and convert it into a searchable knowledge base.
Supports documentation for technologies such as:
- React
- Next.js
- Node.js
- Express
- Firebase
- Tailwind CSS
- FastAPI
- LangChain
- Python
- And other developer documentation
Upload technical resources including:
- Research papers
- API documentation
- Technical books
- Manuals
- Notes
- Markdown files
Content is processed, embedded, and made available for semantic retrieval.
Instead of relying only on keyword matching, StackPilot retrieves context based on the semantic meaning of a user's query.
Retrieved context is passed to the LLM so that responses remain grounded in the indexed knowledge base and can reference relevant sources.
Save and manage reusable developer prompts.
- Create prompts
- Edit prompts
- Delete prompts
- Reuse prompts across conversations
Persist:
- Conversations
- AI responses
- Repository-specific chats
- Retrieved sources
- Message history
View:
- Imported repositories
- Indexed documentation
- Uploaded files
- Recent conversations
- Prompt library
- Storage information
- AI usage analytics
StackPilot uses a Retrieval-Augmented Generation pipeline to provide context-aware responses.
User Query
│
▼
Query Processing
│
▼
Semantic Retrieval
│
▼
ChromaDB Search
│
▼
Relevant Context
│
▼
Prompt Construction
│
▼
Gemini / OpenRouter
│
▼
Grounded AI Response
│
▼
Source Citations
GitHub Repository
Documentation
PDF / Markdown
│
▼
Content Extraction
│
▼
Text Chunking
│
▼
Embedding Generation
│
▼
ChromaDB
│
▼
Semantic Retrieval
│
▼
LLM Context Injection
┌──────────────────────────────┐
│ React + Vite │
│ Tailwind CSS │
└──────────────┬───────────────┘
│
▼
┌──────────────────────────────┐
│ Firebase Authentication │
└──────────────┬───────────────┘
│
▼
┌──────────────────────────────┐
│ Node.js + Express │
└──────────────┬───────────────┘
│
┌───────┼────────┬────────────┐
▼ ▼ ▼ ▼
GitHub Jina AI LangChain AI Services
API Reader .js Gemini/OpenRouter
│ │ │ │
└────────┴─────────┴────────────┘
│
▼
ChromaDB
│
▼
Firestore
StackPilot also includes a causal-inference demonstration designed to estimate whether AI assistance affects developer task completion time.
⚠️ Demo Experiment: This experiment uses a reproducible synthetic dataset and does not use real StackPilot user telemetry.
Does AI assistance reduce developer task completion time?
| Variable | Role |
|---|---|
| AI Assistance | Treatment (T = 1) |
| No AI Assistance | Control (T = 0) |
| Task Completion Time | Outcome (Y) |
| Task Difficulty | Confounder |
| Developer Experience | Confounder |
| Programming Language | Confounder |
| Task Type | Confounder |
A logistic regression model estimates:
P(T = 1 | Confounders)
The model uses:
- Standardised continuous features
- L2 regularisation
- Batch gradient descent
- 1,500 training epochs
- Learning rate =
0.2
Treated and control observations are matched using:
- 1:1 nearest-neighbour matching
- Without replacement
- 0.05 propensity-score caliper
Observations without a sufficiently close control match are excluded to improve covariate balance.
The experiment estimates the:
ATT = Mean(Y_treated − Y_matched_control)
The estimate represents the average difference in task completion time between AI-assisted developers and comparable matched developers in the synthetic experiment.
StackPilot uses Firebase Authentication and protected Express API routes.
User Login
│
▼
Firebase Authentication
│
▼
Authentication Token
│
▼
Express Middleware
│
▼
Token Verification
│
▼
Protected API Routes
Security measures include:
- Firebase Authentication
- Protected API routes
- Token verification
- Input validation
- Rate limiting
- CORS protection
- Environment-based secrets
- React.js
- Vite
- Tailwind CSS
- Framer Motion
- React Router
- Axios
- Firebase Authentication
- Node.js
- Express.js
- LangChain.js
- Retrieval-Augmented Generation (RAG)
- Gemini API
- OpenRouter
- Vector Embeddings
- Semantic Search
- Propensity Score Matching
- Logistic Regression
- Causal Inference
- Firebase Firestore
- ChromaDB
- GitHub REST API
- Jina AI Reader API
- Vercel — Frontend
- Render — Backend
- Firebase — Authentication & Firestore
- ChromaDB — Vector Storage
StackPilot/
│
├── backend/
│ ├── controllers/
│ ├── routes/
│ ├── middleware/
│ ├── services/
│ │ ├── githubService.js
│ │ ├── ragService.js
│ │ ├── jinaService.js
│ │ ├── embeddingService.js
│ │ └── aiService.js
│ ├── firebase/
│ ├── utils/
│ ├── config/
│ ├── server.js
│ └── package.json
│
├── frontend/
│ ├── src/
│ │ ├── components/
│ │ ├── pages/
│ │ ├── hooks/
│ │ ├── context/
│ │ ├── services/
│ │ └── utils/
│ └── package.json
│
└── README.md
POST /api/v1/auth/sync
GET /api/v1/auth/profilePOST /api/v1/repositories/import
GET /api/v1/repositories
DELETE /api/v1/repositories/:idPOST /api/v1/docs/import
GET /api/v1/docs
DELETE /api/v1/docs/:idPOST /api/v1/uploadPOST /api/v1/chatGET /api/v1/dashboard
GET /api/v1/analyticsgit clone https://github.com/<your-username>/StackPilot.git
cd StackPilotcd backend
npm install
npm run devOpen another terminal:
cd frontend
npm install
npm run devCreate:
backend/.env
PORT=
GEMINI_API_KEY=
OPENROUTER_API_KEY=
GITHUB_TOKEN=
FIREBASE_PROJECT_ID=
FIREBASE_CLIENT_EMAIL=
FIREBASE_PRIVATE_KEY=Create:
frontend/.env
VITE_FIREBASE_API_KEY=
VITE_FIREBASE_AUTH_DOMAIN=
VITE_FIREBASE_PROJECT_ID=
VITE_FIREBASE_STORAGE_BUCKET=
VITE_FIREBASE_APP_ID=
VITE_BACKEND_URL=Never commit API keys, Firebase credentials, private keys, or other secrets to GitHub.
| Component | Platform |
|---|---|
| Frontend | Vercel |
| Backend | Render |
| Authentication | Firebase Authentication |
| Application Database | Firestore |
| Vector Database | ChromaDB |
| LLM | Gemini / OpenRouter |
Planned improvements include:
- 🔒 Private GitHub repository support
- 🔑 GitHub OAuth
- 🧩 VS Code extension
- 🔗 Multi-repository conversations
- 🕸️ Repository dependency graphs
- 🧪 Secure code execution sandbox
- 👥 Team workspaces
- 📈 Model benchmarking
- 🔍 AI-powered code review
- 🔀 Pull request summarization
- 🧠 More advanced causal experiments
StackPilot combines several areas of modern software engineering and AI:
- Full-stack application development
- REST API design
- RAG architecture
- Vector databases
- Semantic search
- LLM integration
- AI-powered developer tooling
- GitHub API integration
- Documentation ingestion
- Firebase authentication
- Cloud deployment
- Causal inference
- Propensity score matching
- Production-oriented backend architecture
This project is licensed under the MIT License.
StackPilot is an AI-assisted developer productivity tool.
AI-generated responses may contain errors and should be reviewed and verified before being used in production systems.
StackPilot aims to evolve into an AI-native developer workspace where engineers can understand, search, and interact with entire software projects through natural language.
Instead of switching between repositories, documentation, PDFs, and search engines, developers can bring their technical context into one intelligent workspace.
StackPilot includes a fully working, domain-adapted fine-tuning pipeline for developer assistance. You can train a small language model locally to specialise in code explanation, debugging, and programming concepts — and serve it directly from the Node.js backend via a Python subprocess.
🖥️ This feature runs entirely on your local machine — no GPU or cloud compute required. Model weights are not stored in this repository (they are gitignored). You must run fine-tuning once to generate them.
User Question
│
▼
Node.js Backend (Express)
│ spawns subprocess
▼
ml/infer.py (Python)
│ loads model from ml/models/merged/
▼
Qwen2.5-0.5B Fine-Tuned Model
│ generates answer
▼
JSON response → Node.js → Frontend
The backend spawns ml/infer.py as a child process for each inference request. The Python script loads the merged fine-tuned model from disk, generates a response, and returns clean JSON ({"answer": "..."}).
In production (Render/Vercel): The Qwen model selector returns an informative message explaining that this feature requires a local setup. All other models (Gemini etc.) continue to work normally in production.
| Step | Detail |
|---|---|
| Base model | Qwen/Qwen2.5-0.5B-Instruct — Apache 2.0, 494M parameters, optimised for CPU |
| Fine-tuning method | LoRA/PEFT — targets q_proj and v_proj attention modules (r=8, alpha=16) |
| Training data | 60-example curated developer Q&A dataset (Node.js, Python, Java, REST, Git, SQL, Docker, algorithms) |
| Merge | LoRA adapter merged with base weights into ml/models/merged/ |
| Inference | Local Python subprocess spawned by Node.js — no GPU, no cloud API needed |
Prerequisites: Python 3.10+, pip
Step 1 — Install Python dependencies:
cd ml
pip install -r requirements.txtStep 2 — Run fine-tuning (trains locally and saves to ml/models/):
python finetune.pyThis takes ~10–30 minutes on CPU. The merged model is saved to
ml/models/merged/. Optionally push to Hugging Face Hub:python finetune.py --hf-repo YOUR_USERNAME/stackpilot-dev-assistant
Step 3 — Evaluate the model:
python evaluate_finetuned.pyStep 4 — Test inference directly:
python infer.py --question "What is a closure in JavaScript?"Step 5 — Run the full stack:
# Terminal 1
cd backend && npm run dev
# Terminal 2
cd frontend && npm run devOpen http://localhost:5173, select Qwen2.5 0.5B (Fine-tuned) in the model dropdown, and ask a developer question.
⏱️ First request takes ~30–60 seconds (model loading from disk). Subsequent requests are faster.
No extra variables are needed for local inference. The backend automatically uses the local subprocess when NODE_ENV=development.
# Optional: set this if you host the inference server externally
HF_SPACE_URL=