Adds vector-based semantic search across all chat sessions using Qdrant.
When a ChatTurn finishes, its content is chunked, embedded, and upserted
to a Qdrant collection. A search API and UI components enable searching
at user, project, and session scope.
Phase 1 — Configuration & Dependencies
- Add port/apiKey to GadgetCodeConfig.qdrant type
- Uncomment and update qdrant section in YAML config example
- Add qdrant config passthrough in env.ts
- Add @qdrant/js-client-rest dependency
Phase 2 — AI Embedding API (@gadget/ai)
- Add IAiEmbeddingResponse interface and abstract embeddings() to AiApi
- Implement embeddings() in OllamaAiApi (client.embeddings)
- Implement embeddings() in OpenAiApi (client.embeddings.create)
- Export IAiEmbeddingResponse from package index
Phase 3 — Backend Vector Store Service
- Create VectorStoreService (ingestTurn, search, removeTurnPoints)
- Hook fire-and-forget ingest after turn.save() in drone-session
- Register VectorStoreService in service startup/shutdown
Phase 4 — Backend Search API
- Create POST /api/v1/search controller with userId enforcement
- Batch-hydrate results from MongoDB (user, project, session, turn)
- Register search route in v1 API router
Phase 5 — Frontend Search Components
- SearchInput: debounced input with lucide-react icons
- ChatSearchResults: modal with score badges, metadata, loading states
- DroneSelectionModal: drone picker for sessions without a drone
- Add searchApi and ISearchResult to API client
- Add search to Home (global), ProjectManager (project), ChatSessionView (session)
- Add id=turn-{turnId} to ChatTurn for scroll targeting
- Scroll-to-turn from search result selection and router state
- Show DroneSelectionModal when no drone available
- Add Select Drone button in ChatSessionView sidebar
|
||
|---|---|---|
| .. | ||
| config-examples | ||
| systemd | ||
| README.md | ||
Gadget Code — Installation & Setup
Gadget Code is a self-hosted Agentic Engineering Platform (AEP) — an IDE that drives autonomous AI agents to perform software engineering work on your behalf, running entirely in your own environment.
Architecture
┌──────────────────────────────────────────────────────────────────┐
│ Gadget Code Deployment │
├──────────────────────────────────────────────────────────────────┤
│ │
│ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ │
│ │ Browser IDE │─────▶│ gadget-code │─────▶│ gadget-drone │ │
│ │ (React 19) │◀─────│ (Express 5) │◀─────│ (Worker) │ │
│ └──────────────┘ └──────────────┘ └──────────────┘ │
│ │ │ │ │
│ ├ Socket.IO ├ MongoDB ├ Files │
│ └ JWT Auth ├ Redis Sessions └ Git │
│ ├ HTTPS/SSL │
│ ├ Qdrant (semantic search) │
│ └ │
│ Infrastructure: │
│ - Node.js 22+ │
│ - pnpm 10+ │
│ - MongoDB │
│ - Redis │
│ - SSL Certificates │
│ - AI Inference (Ollama / OpenAI / Gab AI / etc.) │
└──────────────────────────────────────────────────────────────────┘
Components
| Component | Role | Runs On |
|---|---|---|
| Browser IDE | React 19 web application — project management, chat sessions, file editing, drone monitoring | User's browser |
| gadget-code:web | Express 5 API server — REST API, Socket.IO hub, session management, AI provider routing | Server (or localhost) |
| gadget-drone | Worker process — runs the Agentic Workflow Loop (AWL), executes tool calls, manages workspaces | Developer workstation (or server) |
| MongoDB | Primary database — users, projects, chat sessions, AI providers, drone registrations | Server (or localhost) |
| Redis | Session store — Express session persistence, caching | Server (or localhost) |
| Qdrant | Vector database — semantic search over chat history and project knowledge (arriving soon) | Server (or localhost) |
Which Guide Is For You?
| I am... | I need to... | Guide |
|---|---|---|
| An IT administrator | Deploy and manage the Gadget Code platform for my organization | IT Admin Guide |
| A developer / engineer / manager | Run gadget-drone on my workstation to connect to an existing platform |
Drone Operator Guide |
| A solo developer / solopreneur | Run everything on my own machine — platform + drone + database | Solo Developer Guide |
Common Prerequisites
All guides require these tools installed on the host:
- Node.js 22+ — nodejs.org
- pnpm 10+ — pnpm.io
Verify your installation:
node --version # v22.x.x or later
pnpm --version # 10.x.x or later
Configuration Reference
All guides share the same YAML configuration system. See the full reference:
- Configuration Guide — complete YAML schema, environment variable substitution, file locations
- Example configs — drop-in templates for
gadget-code.yamlandgadget-drone.yaml
Support
- Documentation — architecture, protocols, workspace management
- Financial Support & Hosting — managed hosting, consulting, donations