Overview
Cursor is an AI-first code editor built as a fork of VS Code. It provides inline AI assistance, CMD+K for targeted edits, and Composer for multi-file changes. Cursor's @Docs feature allows you to add Trix platform documentation directly to your context, and it supports MCP servers for direct memory access.
Cursor excels at inline code editing, documentation-aware suggestions, and MCP server integration for direct Trix memory access. It feels natural for VS Code users.
Installation & Setup
Download Cursor from cursor.com. It's available for macOS, Windows, and Linux.
Import from VS Code
Cursor can import your VS Code extensions, settings, and keybindings automatically. On first launch, you'll be prompted to import your configuration. Cursor also supports MCP servers, allowing direct integration with Trix memory tools.
Configure AI Model
Cursor supports multiple AI models. For Trix memory integration, Claude Sonnet or GPT-4 work best:
- Open Settings (Cmd+, on Mac, Ctrl+, on Windows/Linux)
- Navigate to Cursor Settings → Models
- Select your preferred model (Claude Sonnet 4 or GPT-4o recommended)
- Add your API key if using your own
Cursor offers both free and paid plans. The free plan includes limited AI requests, while Pro plans provide unlimited access with premium models.
Adding Trix Documentation
Cursor's @Docs feature allows you to add Trix documentation to your context, making AI suggestions more accurate.
Add Official Trix Docs
- Open Cursor Settings (Cmd+, or Ctrl+,)
- Navigate to Features → Docs
- Click "Add new doc"
- Add the Trix GitHub documentation URL:
https://trixdb.com/docsYou can also add your own Trix integration documentation:
# Create a docs file in your project
touch docs/trix-integration.md
# Add your Trix setup, patterns, and conventions
# Then reference it in Cursor Settings → Features → DocsUsing @Docs in Chat
Once added, reference Trix docs in your prompts:
@Docs Create a React component that integrates Trix memory search with proper TypeScript typesCursor will use the official Trix documentation to provide accurate API references and patterns.
Core Features for Trix Development
Inline Editing (CMD+K)
CMD+K (Ctrl+K on Windows/Linux) allows you to edit code inline with AI assistance:
- Select the code you want to modify
- Press CMD+K
- Describe what you want to change
- Review and accept/reject the changes
Example: Select your memory service code and press CMD+K, then type:
Add error handling for API calls and implement retry with exponential backoffTab Completion
Cursor provides intelligent code completion as you type. Start typing and press Tab to accept suggestions:
// Start typing:
const results = await client.memories.
// Press Tab to complete:
const results = await client.memories.list({
q: searchQuery,
space_id: spaceId,
limit: 10
});Composer (Multi-File Editing)
Composer allows you to make coordinated changes across multiple files:
- Open Composer (Cmd+Shift+I or Ctrl+Shift+I)
- Describe changes affecting multiple files
- Cursor will plan and execute changes across your codebase
- Review and apply the changes
Example Composer prompt:
Add a memory-powered context system to this project:
1. Create memory service with Trix SDK
2. Add search function with metadata filters
3. Build context injection middleware for LLM calls
4. Handle error cases and empty results
5. Add TypeScript types for all memory operationsChat Interface
Use Cursor's chat interface for questions and exploration:
How do I configure Trix memory search for my use case?
@Docs What endpoints does the Trix API provide for memory management?
Show me how to integrate Trix memory with my chatbotCommon Workflows
Initial Trix Setup
- Open Composer (Cmd+Shift+I)
- Paste this prompt:
Set up Trix memory SDK in this project:
- Install @trixdb/client package
- Create a memory service with TypeScript
- Configure API key from environment
- Add store, search, and delete methods
- Export the service from index.ts- Review the planned changes
- Apply the changes
- Test the implementation
Adding Memory Features
- Open your memory service file
- Select the section you want to enhance or place cursor where you want new code
- Press CMD+K and type:
Add metadata filtering, space-based isolation, and batch memory creation to this serviceDebugging Issues
Use the chat to debug configuration issues:
@Codebase My Trix memory search is returning irrelevant results.
Here's my search configuration. What can I improve?The @Codebase reference tells Cursor to analyze your entire codebase, helping it understand context and dependencies.
Refactoring Workflow
- Select the code you want to refactor
- Press CMD+K
- Describe the refactoring:
Extract this memory retrieval logic into a reusable hookAdvanced Tips
Custom Rules
Create a .cursorrules file in your project root to teach Cursor about
your preferences:
# .cursorrules
## Trix Memory Platform Patterns
When working with Trix:
- Always use TypeScript
- Use the @trixdb/client SDK for API interactions
- Handle API errors with proper retry logic
- Use spaces for data isolation between users
- Follow async/await patterns for all API calls
## Code Style
- Use arrow functions
- Prefer const over let
- Add JSDoc comments for complex functions
- Export types separately from services
## Memory Operations
Always use proper types:
```typescript
const memory = await client.memories.create({
content: "User preference",
space_id: spaceId,
metadata: { source: "chat" }
});
```
## Search Pattern
Use this pattern for memory retrieval:
1. Build search query from user context
2. Apply metadata filters for relevance
3. Set appropriate limit and threshold
4. Inject results into LLM prompt
5. Handle empty results gracefullyLinter Integration
Cursor integrates with ESLint. Use the "Iterate on Lints" feature to auto-fix issues:
- Open the Problems panel
- Click "Iterate on Lints"
- Cursor will fix linting issues automatically
Terminal Integration
Cursor has an integrated terminal. Use it to run Trix-related commands:
npm install @trixdb/client
npm run dev
npm testBest Practices
- Use @Docs for accuracy - Reference Trix documentation for correct API usage
- Leverage @Codebase - Let Cursor analyze your full codebase for better suggestions
- Iterate with CMD+K - Make small, targeted changes instead of rewriting entire files
- Create .cursorrules - Teach Cursor your Trix patterns and preferences
- Use Composer for structure - Let Composer handle multi-file architectural changes
- Review AI suggestions - Always test and understand generated code before accepting
Cursor's suggestions are based on patterns in its training data. For Trix-specific patterns, always verify against the official Trix platform documentation at trixdb.com/docs.
Example Prompts
Setup Prompts
@Docs Set up Trix memory SDK in this project with TypeScript
Create a memory service with search and store methods
@Codebase Add Trix memory context to my existing chat handlerMemory & Search Prompts
Add metadata filtering to my Trix memory search
Implement batch memory creation for document ingestion
@Docs Configure space-based isolation for multi-tenant memoryDebugging Prompts
@Codebase Why are my Trix memory searches returning low-relevance results?
Debug this Trix API authentication error [paste error message]
@Docs How do I set up webhooks for memory change events?For more prompts, see the Prompt Library.
Useful Keyboard Shortcuts
| Action | macOS | Windows/Linux |
|---|---|---|
| Inline Edit | Cmd+K | Ctrl+K |
| Open Composer | Cmd+Shift+I | Ctrl+Shift+I |
| Open Chat | Cmd+L | Ctrl+L |
| Accept Suggestion | Tab | Tab |
| Reject Suggestion | Esc | Esc |
| Next Suggestion | Cmd+→ | Ctrl+→ |
Next Steps
- Prompt Library - Ready-to-use prompts for Cursor
- Troubleshooting - Common issues and solutions
- Cursor Documentation - Official Cursor docs