Skip to main content

Module http

Module http 

Source
Expand description

HTTP/SSE server for rust-memex

Provides HTTP endpoints for agents that can’t hold LanceDB lock directly. All database access goes through the single server instance.

Uses RAGPipeline (same as MCPServer) for consistency and full feature support:

  • Multi-namespace (each agent can have own namespace)
  • Onion slices (expand/drill-down in SSE)
  • Full indexing pipeline with dedup

Endpoints:

  • GET / - HTML Dashboard (browse memories visually)
  • GET /api/discovery - Endpoint discovery: status, db info, namespaces (canonical)
  • GET /api/namespaces - List all namespaces with counts
  • GET /api/overview - Database overview/stats
  • GET /api/browse/:ns - Browse documents in namespace
  • GET /health - Health check
  • POST /search - Search documents
  • GET /sse/search - SSE streaming search
  • GET /sse/namespaces - SSE streaming namespace listing with summaries
  • POST /sse/compact - SSE streaming database compaction
  • POST /sse/cleanup - SSE streaming version cleanup (>7 days)
  • POST /sse/gc - SSE streaming orphan garbage collection
  • POST /sse/optimize - SSE streaming database optimize (compact + prune)
  • POST /sse/reprocess - SSE streaming namespace rebuild from JSONL
  • POST /sse/reindex - SSE streaming namespace rebuild from namespace source
  • POST /upsert - Upsert document (memory_upsert)
  • POST /index - Index text with full pipeline
  • POST /api/merge - Merge multiple LanceDB stores into one target
  • POST /api/repair-writes - Inspect or repair cross-store recovery ledgers
  • POST /api/export - Stream a namespace as JSONL
  • POST /api/import - Import JSONL into a namespace
  • POST /api/migrate-namespace - Atomically rename a namespace
  • GET /expand/:ns/:id - Expand onion slice (get children)
  • GET /parent/:ns/:id - Get parent slice (drill up)
  • DELETE /ns/:namespace - Purge namespace

MCP-over-SSE endpoints (for Claude Code compatibility):

  • GET /mcp/ - SSE stream for MCP messages (sends endpoint event)
  • POST /mcp/messages/ - JSON-RPC POST endpoint with session_id

Vibecrafted with AI Agents by Loctree (c)2026 Loctree

Structs§

AuditParams
AuditProgress
AuditResult
BackfillHashesParams
BackfillHashesRequest
BackfillHashesResponse
BrowseParams
Browse query params
BrowseResponse
Browse response
ChunkQuality
CompactProgress
CrossSearchParams
Cross-search query params for GET endpoint
CrossSearchRequest
Cross-search request - search across all namespaces
CrossSearchResponse
Cross-search response
DashboardOidcConfig
DatabaseStats
DedupParams
DedupRequest
DedupResponse
DiscoveryNamespaceInfo
Canonical discovery namespace entry.
DiscoveryResponse
Canonical discovery response for dashboards and HTTP clients.
HealthNamespaceStatus
HealthResponse
Health check response
HttpServerConfig
HTTP server configuration passed to create_router and start_server
HttpState
Shared state for HTTP handlers - reuses the same MCP core and storage runtime as stdio/SSE.
IndexRequest
Index text request (full pipeline)
McpMessagesParams
Query params for MCP messages endpoint
McpSession
MCP session for SSE connections
McpSessionManager
MCP session manager
MergeProgress
NamespaceInfo
Namespace info for API
NamespaceStats
NamespacesResponse
Namespaces list response
OverviewResponse
Overview response
PurgeQualityRequest
ReindexProgress
RepairResult
ReprocessProgress
SearchRequest
Search request body
SearchResponse
Search response
SearchResultJson
Search result for JSON response
SseEvent
SseSearchParams
SSE search query params
StorageMetrics
TimeRange
TimelineEntry
TimelineFilter
TimelineParams
UpsertRequest
Upsert request body (memory_upsert)

Enums§

AuditRecommendation
AuthMode
Auth enforcement mode for HTTP endpoints.
QualityTier

Functions§

create_router
Create the HTTP router
start_server
Start the HTTP server with shared MCP core.