curl -X POST https://api.relace.ai/v1/repo/123e4567-e89b-12d3-a456-426614174000/retrieve \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "query": "authentication and user login functionality", "score_threshold": 0.3, "token_limit": 30000, "include_content": true }'
{ "results": [ { "filename": "src/auth.py", "content": "def authenticate_user(username, password):\n \"\"\"Authenticate user credentials against the database.\"\"\"\n user = User.query.filter_by(username=username).first()\n if user and bcrypt.check_password_hash(user.password_hash, password):\n return user\n return None", "score": 0.94 }, { "filename": "src/models/user.py", "content": "class User(db.Model):\n id = db.Column(db.Integer, primary_key=True)\n username = db.Column(db.String(80), unique=True, nullable=False)\n password_hash = db.Column(db.String(128), nullable=False)", "score": 0.87 } ] }
Two-stage codebase retrieval using semantic search
Show properties