97d565e3cd
* feat: add mem-search skill with progressive disclosure architecture Add comprehensive mem-search skill for accessing claude-mem's persistent cross-session memory database. Implements progressive disclosure workflow and token-efficient search patterns. Features: - 12 search operations (observations, sessions, prompts, by-type, by-concept, by-file, timelines, etc.) - Progressive disclosure principles to minimize token usage - Anti-patterns documentation to guide LLM behavior - HTTP API integration for all search functionality - Common workflows with composition examples Structure: - SKILL.md: Entry point with temporal trigger patterns - principles/: Progressive disclosure + anti-patterns - operations/: 12 search operation files 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * docs: add CHANGELOG entry for mem-search skill Document mem-search skill addition in Unreleased section with: - 100% effectiveness compliance metrics - Comparison to previous search skill implementation - Progressive disclosure architecture details - Reference to audit report documentation 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * docs: add mem-search skill audit report Add comprehensive audit report validating mem-search skill against Anthropic's official skill-creator documentation. Report includes: - Effectiveness metrics comparison (search vs mem-search) - Critical issues analysis for production readiness - Compliance validation across 6 key dimensions - Reference implementation guidance Result: mem-search achieves 100% compliance vs search's 67% 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * feat: Add comprehensive search architecture analysis document - Document current state of dual search architectures (HTTP API and MCP) - Analyze HTTP endpoints and MCP search server architectures - Identify DRY violations across search implementations - Evaluate the use of curl as the optimal approach for search - Provide architectural recommendations for immediate and long-term improvements - Outline action plan for cleanup, feature parity, DRY refactoring * refactor: Remove deprecated search skill documentation and operations * refactor: Reorganize documentation into public and context directories Changes: - Created docs/public/ for Mintlify documentation (.mdx files) - Created docs/context/ for internal planning and implementation docs - Moved all .mdx files and assets to docs/public/ - Moved all internal .md files to docs/context/ - Added CLAUDE.md to both directories explaining their purpose - Updated docs.json paths to work with new structure Benefits: - Clear separation between user-facing and internal documentation - Easier to maintain Mintlify docs in dedicated directory - Internal context files organized separately 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * Enhance session management and continuity in hooks - Updated new-hook.ts to clarify session_id threading and idempotent session creation. - Modified prompts.ts to require claudeSessionId for continuation prompts, ensuring session context is maintained. - Improved SessionStore.ts documentation on createSDKSession to emphasize idempotent behavior and session connection. - Refined SDKAgent.ts to detail continuation prompt logic and its reliance on session.claudeSessionId for unified session handling. --------- Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: Alex Newman <thedotmack@gmail.com>
176 lines
4.4 KiB
Markdown
176 lines
4.4 KiB
Markdown
# API Help
|
|
|
|
Get comprehensive API documentation for all search endpoints.
|
|
|
|
## When to Use
|
|
|
|
- User asks: "What search operations are available?"
|
|
- User asks: "How do I use the search API?"
|
|
- Need reference documentation for endpoints
|
|
- Want to see all available parameters
|
|
|
|
## Command
|
|
|
|
```bash
|
|
curl -s "http://localhost:37777/api/help"
|
|
```
|
|
|
|
## Response Structure
|
|
|
|
Returns complete API documentation:
|
|
|
|
```json
|
|
{
|
|
"version": "5.4.0",
|
|
"base_url": "http://localhost:37777/api",
|
|
"endpoints": [
|
|
{
|
|
"path": "/search/observations",
|
|
"method": "GET",
|
|
"description": "Search observations using full-text search",
|
|
"parameters": [
|
|
{
|
|
"name": "query",
|
|
"required": true,
|
|
"type": "string",
|
|
"description": "Search terms"
|
|
},
|
|
{
|
|
"name": "format",
|
|
"required": false,
|
|
"type": "string",
|
|
"default": "full",
|
|
"options": ["index", "full"],
|
|
"description": "Response format"
|
|
}
|
|
],
|
|
"example": "curl -s \"http://localhost:37777/api/search/observations?query=authentication&format=index&limit=5\""
|
|
}
|
|
]
|
|
}
|
|
```
|
|
|
|
## How to Present Results
|
|
|
|
Present as reference documentation:
|
|
|
|
```markdown
|
|
## claude-mem Search API Reference (v5.4.0)
|
|
|
|
Base URL: `http://localhost:37777/api`
|
|
|
|
### Search Operations
|
|
|
|
**1. Search Observations**
|
|
- **Endpoint:** `GET /search/observations`
|
|
- **Description:** Search observations using full-text search
|
|
- **Parameters:**
|
|
- `query` (required, string): Search terms
|
|
- `format` (optional, string): "index" or "full" (default: "full")
|
|
- `limit` (optional, number): Max results (default: 20, max: 100)
|
|
- **Example:**
|
|
```bash
|
|
curl -s "http://localhost:37777/api/search/observations?query=authentication&format=index&limit=5"
|
|
```
|
|
|
|
[... continue for all endpoints ...]
|
|
```
|
|
|
|
## Endpoint Categories
|
|
|
|
The API help response organizes endpoints by category:
|
|
|
|
1. **Full-Text Search**
|
|
- `/search/observations`
|
|
- `/search/sessions`
|
|
- `/search/prompts`
|
|
|
|
2. **Filtered Search**
|
|
- `/search/by-type`
|
|
- `/search/by-concept`
|
|
- `/search/by-file`
|
|
|
|
3. **Context Retrieval**
|
|
- `/context/recent`
|
|
- `/timeline/context`
|
|
- `/timeline/by-query`
|
|
|
|
4. **Utilities**
|
|
- `/help`
|
|
|
|
## Common Parameters
|
|
|
|
Many endpoints share these parameters:
|
|
|
|
- **format**: "index" (summary) or "full" (complete details)
|
|
- **limit**: Number of results to return
|
|
- **offset**: Number of results to skip (for pagination)
|
|
- **project**: Filter by project name
|
|
- **dateRange**: Filter by date range
|
|
- `dateRange[start]`: Start date (ISO string or epoch)
|
|
- `dateRange[end]`: End date (ISO string or epoch)
|
|
|
|
## Error Handling
|
|
|
|
**Worker not running:**
|
|
Connection refused error. Response: "The search API isn't available. Check if worker is running: `pm2 list`"
|
|
|
|
**Invalid endpoint:**
|
|
```json
|
|
{"error": "Not found"}
|
|
```
|
|
Response: "Invalid API endpoint. Use /api/help to see available endpoints."
|
|
|
|
## Tips
|
|
|
|
1. Save help response for reference during investigation
|
|
2. Use examples as starting point for your queries
|
|
3. Check required parameters before making requests
|
|
4. Refer to format options for each endpoint
|
|
5. All endpoints use GET method with query parameters
|
|
|
|
**Token Efficiency:**
|
|
- Help response: ~2,000-3,000 tokens (complete API reference)
|
|
- Use sparingly - refer to operation-specific docs instead
|
|
- Keep help response cached for repeated reference
|
|
|
|
## When to Use Help
|
|
|
|
**Use help when:**
|
|
- Starting to use the search API
|
|
- Need complete parameter reference
|
|
- Forgot which endpoints are available
|
|
- Want to see all options at once
|
|
|
|
**Don't use help when:**
|
|
- You know which operation you need (use operation-specific docs)
|
|
- Just need examples (use common-workflows.md)
|
|
- Token budget is limited (help is comprehensive)
|
|
|
|
## Alternative to Help Endpoint
|
|
|
|
Instead of calling `/api/help`, you can:
|
|
|
|
1. **Use SKILL.md** - Quick decision guide with operation links
|
|
2. **Use operation docs** - Detailed guides for specific endpoints
|
|
3. **Use common-workflows.md** - Step-by-step examples
|
|
4. **Use formatting.md** - Response presentation templates
|
|
|
|
The help endpoint is most useful when you need complete API reference in one response.
|
|
|
|
## API Versioning
|
|
|
|
The help response includes version information:
|
|
|
|
```json
|
|
{
|
|
"version": "5.4.0",
|
|
"skill_migration": true,
|
|
"deprecated": {
|
|
"mcp_tools": "Replaced by HTTP API in v5.4.0"
|
|
}
|
|
}
|
|
```
|
|
|
|
Check version to ensure compatibility with documentation.
|