POST /api/suggest
Generate intelligent inline suggestions based on the current context. This endpoint integrates with the user’s memory system to provide personalized, context-aware completions.Request Body
The current text context where the suggestion will be inserted. This can be selected text or the text around the cursor.
Unique identifier for the user. Used to retrieve personalized memories.
Optional instruction to guide the suggestion. For example: “complete this sentence” or “suggest next steps”.
The AI model to use for generation. Supported models include:
gpt-4o-mini(default)gpt-4oclaude-3-5-sonnet-20241022groq/llama-3.3-70b-versatilecerebras/llama-3.3-70b
Response
The endpoint returns a streaming text response with the AI-generated suggestion.The generated text suggestion, streamed token-by-token for real-time display.
Memory Integration
The suggest endpoint uses three memory tools to provide personalized suggestions:- searchMemory - Searches relevant memories based on the context
- addMemory - Stores new facts learned during the interaction
- getAllMemories - Retrieves all user memories for comprehensive context
- Searches for relevant personal preferences and past context
- Incorporates your coding style, preferences, and recent work
- Stores new insights for future suggestions
Example Request
Example Response (Streaming)
Use Cases
Code Completion
Intelligent code completions that match your style and patterns
Writing Assistance
Context-aware text completions for emails and documents
Next-Step Suggestions
Suggest logical next steps based on current context
Personalized Help
Suggestions that incorporate your preferences and history
Keyboard Shortcut
Trigger inline suggestions withCtrl+Space in the Tabby desktop app.
Source: nextjs-backend/src/app/api/suggest/route.ts
Related Endpoints
- Completion - General text transformations and completions
- Chat - Full conversational AI with memory
- Search Memory - Directly query the memory system