A Chrome extension that provides AI-powered semantic search for your browsing history using FastAPI, Qdrant vector database, and Next.js.
- Semantic Search: Search your browsing history using natural language queries
- Rich Results: View titles, URLs, snippets, code blocks, and scroll positions
- Modern UI: Clean, responsive interface built with Next.js
- Vector Database: Powered by Qdrant for fast semantic search
- Scroll Position: Remember and restore scroll positions for pages
- Python 3.8+
- Node.js 16+
- Docker (for Qdrant)
- Chrome browser
# Navigate to backend directory
cd backend
# Create virtual environment
python -m venv venv
# Activate virtual environment
# On Windows:
venv\Scripts\activate
# On macOS/Linux:
source venv/bin/activate
# Install dependencies
pip install -r requirements.txt
# Initialize database
python init_db.py
# Start Qdrant (in a separate terminal)
docker run -d -p 6333:6333 qdrant/qdrant
# Start the backend server
python -m uvicorn app.main:app --reload --host 0.0.0.0 --port 8000# Navigate to frontend directory
cd frontend
# Install dependencies
npm install
# Build the Chrome extension
npm run build:extension- Open Chrome and go to
chrome://extensions/ - Enable "Developer mode" (toggle in top right)
- Click "Load unpacked"
- Select the
frontend/outdirectory
cd backend
# Test complete flow
python test_complete_flow.py
# Test individual components
python debug_complete.py
python test_qdrant_setup.py- Open the Chrome extension popup
- Enter a search query like "React debounce"
- Verify results are displayed correctly
backtrack-extension/
βββ backend/ # FastAPI backend
β βββ app/
β β βββ api/ # API endpoints
β β βββ models.py # Database models
β β βββ database.py # Database connection
β β βββ utils/ # Utilities (Qdrant client)
β βββ test_*.py # Test scripts
β βββ requirements.txt # Python dependencies
βββ frontend/ # Next.js frontend
β βββ src/app/ # React components
β βββ public/ # Static files
β βββ package.json # Node.js dependencies
βββ README.md # This file
Generate embeddings for session data and store in PostgreSQL + Qdrant.
Request:
{
"user_id": "test_user_123",
"url": "https://example.com",
"title": "Page Title",
"text": "Page content...",
"code_blocks": ["console.log('test');"],
"timestamp": "2025-01-01T12:00:00",
"scroll_position": 0.5
}Search sessions using semantic search.
Request:
{
"user_id": "test_user_123",
"query": "React debounce",
"top_k": 5
}Response:
{
"results": [
{
"url": "https://example.com",
"title": "Page Title",
"snippet": "Page content snippet...",
"code_blocks": ["console.log('test');"],
"timestamp": "2025-01-01T12:00:00",
"scroll_position": 0.5,
"score": 0.85
}
]
}- Start Services: Ensure backend and Qdrant are running
- Load Extension: Load the Chrome extension in Chrome
- Search: Click the extension icon and enter natural language queries
- View Results: Browse through search results with rich metadata
- Open Pages: Click "Open Page" to navigate to the original page
- "React debounce"
- "useEffect optimization"
- "JavaScript performance"
- "CSS animations"
- "API authentication"
cd backend
# Start with auto-reload
python -m uvicorn app.main:app --reload --host 0.0.0.0 --port 8000cd frontend
# Start development server
npm run dev
# Build extension
npm run build:extension-
Qdrant Connection Failed
- Ensure Docker is running
- Check if port 6333 is available
- Restart Qdrant:
docker restart <container_id>
-
Backend Server Not Starting
- Check if port 8000 is available
- Verify all dependencies are installed
- Check virtual environment is activated
-
Extension Not Loading
- Verify the
outdirectory exists - Check
manifest.jsonis in theoutdirectory - Ensure all static files are built
- Verify the
-
Search Not Working
- Verify backend is running on
http://localhost:8000 - Check browser console for CORS errors
- Ensure sample data is added to the database
- Verify backend is running on
# Test backend components
cd backend
python debug_complete.py
# Test Qdrant directly
python test_qdrant_direct.py
# Test database
python test_database.py
# Test API endpoints
python test_api.pyThis project is licensed under the MIT License.
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests
- Submit a pull request
For issues and questions:
- Check the troubleshooting section
- Review the test scripts
- Open an issue on GitHub