Commit graph

277 commits

Author SHA1 Message Date
Vorflux AI
bcf2ff87fa feat: improve graph aesthetics - subtle edges, luminous nodes, better spacing
- Edge opacity: derives 0.18, updates 0.45, extends 0.12 for gossamer web effect
- Edge colors: sky blue (#38BDF8), soft violet (#A78BFA), teal (#2DD4BF)
- Node glow: subtle radial glow behind memory dots for luminous effect
- Force layout: stronger repulsion (-2500), wider spacing (450/200), gentler centering
- Refactor simulation to use FORCE_CONFIG constants instead of hardcoded values
- Update MCP app edge colors to match
2026-03-28 07:41:03 +00:00
Vorflux AI
b43c311092 feat: rename edge types to derives/updates/extends with distinct colors
- Rename edge types: doc-memory -> derives, version -> updates, same-space -> extends
- Assign distinct colors: derives (#3B82F6 blue), updates (#8B5CF6 purple), extends (#14B8A6 teal)
- Update legend labels to show Derives, Updates, Extends
- Update theme color properties: edgeDerives, edgeUpdates, edgeExtends
- Update MCP app edge types and colors to match
- Remove redundant drawDocDocLines proximity rendering (extends edges now serve this purpose)
- Update all tests and comments for new edge type names
2026-03-28 07:20:48 +00:00
Vorflux AI
06e51f2126 fix: resolve biome CI errors (noExplicitAny + formatting)
- Replace catch(error: any) with catch(error: unknown) in mcp client
- Fix extra blank line left by refactor in renderer.ts
2026-03-28 07:01:50 +00:00
Vorflux AI
60a809d1e9 refactor: extract document icon drawing into dedicated module
- Move all 14 icon drawing functions + roundRect to document-icons.ts
- Narrow drawDocIcon parameter from GraphThemeColors to iconColor: string
- Renderer.ts reduced from 1110 to 717 lines (focused on scene orchestration)
- Add google_drive, video, mcp, word to mock data for better icon coverage
2026-03-28 06:58:19 +00:00
Vorflux AI
c6ac3e0651 feat(graph): add canvas-native document type icons for all supported types
- Add 10 new icon drawing functions: Notion, Google Docs, Slides, Cloud,
  X/Twitter, Play/Video, Image, Text/Note, and more
- Extend drawDocIcon switch to handle all 19+ document types from web app:
  word, excel, google_sheet, google_slide, powerpoint, onedrive, google_drive,
  tweet, youtube, video, image, text, note, onenote, mcp
- Update mock data with additional document types for better demo coverage
- All icons are pure canvas vector drawings (no image assets needed)
2026-03-28 06:52:31 +00:00
Vorflux AI
2a18fb4df0 fix: memoize colors object to prevent cascading re-renders when colorOverrides provided 2026-03-28 06:10:56 +00:00
Vorflux AI
429c7e97ad refactor: simplify graph API - remove backend computation, use client-side layout
- Remove x/y from GraphApiDocument (client computes via force simulation)
- Remove similarity from GraphApiEdge, add edgeType enum
- Replace viewport/bounds/stats API calls with single paginated documents endpoint
- Derive edges client-side from document structure (doc-memory, version, same-space)
- Update MCP client/server to use documents endpoint
- Update MCP UI app for new type shapes
- Update all tests for new API contract
- Progressive loading via useInfiniteQuery (100 docs/page)
2026-03-28 06:04:11 +00:00
Vorflux AI
76f5eaa446 Fix zoom display regression: split viewport change concerns
Pass popoverVisible flag from graph-canvas tick loop to the
onViewportChange callback. The handler always updates zoomDisplay
(so NavigationControls shows correct zoom %) but only increments
viewportVersion (triggering popover repositioning) when a node is
actually selected or hovered. This avoids 60fps React reconciliation
during plain panning while keeping the zoom indicator responsive.
2026-03-27 18:37:06 +00:00
Vorflux AI
52c0a615c1 Perf: gate onViewportChange behind popover-visible check
Only fire onViewportChange (which triggers React state update +
reconciliation) when a popover is actually visible (selectedNodeId
or hoveredNodeId is set). This avoids forcing 60fps React re-renders
during plain panning/zooming when no popover needs repositioning.

Also separate prevVp* tracking from the callback gate so viewport
state is always current when a node is first hovered/selected.
2026-03-27 18:34:24 +00:00
Vorflux AI
8dced3d5ed Fix slideshow interval reset on container resize
Use refs for containerSize and onSlideshowNodeChange inside the
slideshow useEffect to avoid resetting the 3.5s interval when the
container is resized. The interval now only resets when
isSlideshowActive or nodes.length changes.
2026-03-27 06:51:49 +00:00
Vorflux AI
ca2aae3fea Fix biome formatting: remove blank lines and collapse expression 2026-03-27 05:40:16 +00:00
Vorflux AI
8087d8a40d Fix popover tracking during pan/drag and remove dead code
- Use viewportVersion (not zoomDisplay) as activePopoverPosition dependency
- Fire onViewportChange based on actual viewport state diff (panX/panY/zoom)
  instead of only during animated transitions (vpMoving)
- Also fire during simulation so popover tracks settling nodes
- Remove dead lastReportedZoom variable
- Remove no-op node ID tracking effect and prevIdsRef
2026-03-27 05:37:22 +00:00
Vorflux AI
cfac6e8898 Fix CI test import, popover pan repositioning, and renderer improvements
- Change bun:test import to vitest for CI compatibility
- Add viewportVersion counter for popover recalculation during pan
- Add hex color guard in lightenColor for non-6-digit formats
- Optimize version edge filtering with batch property
- Simplify stroke style conditions in drawDocumentNode
2026-03-27 05:32:36 +00:00
Vorflux AI
c81c05c14f Add visual enhancements: drop shadows, gradient fills, hover glow, forgotten X icon, version edge glow
- Drop shadows on selected/hovered nodes (document + memory) for depth
- Subtle gradient fill on document nodes
- Improved dimming contrast for superseded memories (0.3 alpha + strikethrough)
- Hover glow ring with dashed outline for interactivity feedback
- X icon overlay on forgotten memory nodes (size > 14px)
- Glow pass behind version edges for visual emphasis
- lightenColor utility with cache + guard for non-6-digit hex
- Use memData.isForgotten instead of fragile color comparison
- Optimize version edge batch: skip filter, use first.isVersion flag
- Add 10 unit tests for lightenColor (hex parsing, clamping, cache, edge cases)
2026-03-27 05:16:48 +00:00
Vorflux AI
13eb5e9cb0 Fix simulation prop not triggering re-render + add edge case tests
- Use useState for simulation so GraphCanvas receives it after creation
  (ref mutation alone didn't trigger re-render, causing frozen graph)
- Keep simulationRef for imperative access (reheat/coolDown in callbacks)
- Add edge case tests: orphaned non-root memory, cross-document chains,
  circular references with membership assertion, cold-cache middle node
2026-03-27 02:27:21 +00:00
Vorflux AI
5a4d610ed9 Address review: improve comments, naming, add edge case tests
- Rename tip -> cursor for consistency with backward walk
- Fix misleading test descriptions to reflect bidirectional behavior
- Add test for circular parent references (cycle protection)
- Add test for branching children (first-child-wins behavior)
- Document linear chain assumption in forward walk comment
2026-03-27 02:21:03 +00:00
Vorflux AI
47398cabc1 Fix version chain: bidirectional traversal so any node shows full chain
- Added childrenMap for forward traversal from parent to children
- getChain now walks backward to root AND forward to latest descendant
- Clicking v1 root node now shows the complete version chain UI
- Standalone v1 nodes (no children) still return null (no chain to show)
- Updated tests to reflect bidirectional behavior + added v1 root test
2026-03-27 02:18:17 +00:00
Vorflux AI
190cf727f4 Dim superseded (non-latest) memory nodes in graph
Memory nodes with isLatest=false are now visually dimmed:
- Full-size nodes: 35% opacity with dashed border stroke
- Zoomed-out dots: 35% opacity with thinner stroke
- Selected/hovered superseded nodes render at full opacity
  so users can still inspect them
2026-03-27 02:12:12 +00:00
Vorflux AI
4750842b00 Use prepack/postpack instead of prepublishOnly/postpublish for export swap
prepack/postpack fire for both 'pack' and 'publish', and postpack
always runs after packing regardless of publish success, preventing
the working tree from being left in dist-exports state on failure.
2026-03-27 00:33:54 +00:00
Vorflux AI
96b7f16175 Fix Cloudflare Workers build: use source exports for workspace, dist for npm publish
- Package exports now point to source files (./src/index.tsx) for workspace
  consumers, allowing Next.js/Turbopack to resolve without pre-building
- Added publishConfig swap script that switches exports to dist/ during
  npm publish (prepublishOnly) and back to source after (postpublish)
- Added @supermemory/memory-graph to transpilePackages in web app next.config.ts
  so Next.js transpiles the source files correctly
2026-03-27 00:30:47 +00:00
Vorflux AI
3eab287959 Fix biome lint/format errors: aria-hidden on SVGs, Infinity -> Number.POSITIVE_INFINITY, line length formatting 2026-03-27 00:12:50 +00:00
Vorflux AI
e7676763a9 Add comprehensive unit tests for memory-graph package
79 tests across 6 test files covering:
- SpatialIndex: grid rebuild, queryPoint hit-testing, boundary cells, hash detection
- ViewportState: worldToScreen/screenToWorld roundtrip, pan, zoomImmediate,
  zoomTo animation, fitToNodes, centerOn, inertia decay
- ForceSimulation: init/destroy lifecycle, update hot-swap, reheat/coolDown
- VersionChainIndex: chain building via parentMemoryId, caching, rebuild
- Graph data utils: normalizeDocCoordinates, getMemoryBorderColor,
  getEdgeVisualProps, screenToBackendCoords, calculateBackendViewport
- Mock data: deterministic seeded output, correct counts, valid edge references

Also exports pure utility functions from use-graph-data.ts for testability.
2026-03-27 00:06:21 +00:00
Vorflux AI
4dcf3b2a62 Fix review bugs: slideshow re-mount, edges cascade, stale popover, maxNodes
- Fix slideshow useEffect: use nodesRef instead of nodes in deps to prevent
  interval teardown/recreation on every render
- Fix edges useMemo: compute allNodeIds from normalizedDocs directly instead
  of depending on nodes (which changes identity every render)
- Fix popover position: add zoomDisplay to deps so position updates on pan/zoom
- Implement maxNodes prop: limit documents before passing to useGraphData
- Fix SpatialIndex hash: include node IDs and use 10x position granularity
  to prevent false cache hits during physics simulation
2026-03-26 18:04:25 +00:00
Vorflux AI
1c5ef7e5ed Rewrite @supermemory/memory-graph with perf optimizations and consolidate consumers
Package changes (packages/memory-graph):
- Spatial grid nearest-neighbor: O(n^2) -> O(n*k) for doc-doc edge rendering
- Zoom-based edge culling: skip low-similarity edges at low zoom levels
- Modular canvas engine from mono repo (renderer, simulation, viewport, hit-test)
- Remove vanilla-extract CSS, use inline styles only
- Add motion/react for slide-in animations
- Export mock data generator for stress testing
- Add performance and integration tests (15/15 pass)

Web app changes (apps/web):
- Remove local graph implementation (~4400 lines deleted)
- Add thin wrapper (memory-graph-wrapper.tsx) using useGraphApi hook
- Keep app-specific graph-card.tsx and use-graph-api.ts

Playground changes (apps/memory-graph-playground):
- Add stress test buttons (50/100/200/500 docs)
- Add mock data generation via package
- Convert DocumentWithMemories to GraphApiDocument format
- Show FPS counter during stress tests

All TypeScript compiles clean. Performance tests: 15/15 pass.
2026-03-26 17:58:28 +00:00
Prasanna721
694ad8123a fix: remove useQuery wrapper around synchronous billing checks (#805)
#### fix: billing subscription status race condition

 - **Bug fix**: Replaced `fetchSubscriptionStatus` (useQuery wrapper) with `getSubscriptionStatus` (pure function) — fixes intermittent "Upgrade to Pro"
  failures caused by stale cached billing state
  - **Anti-pattern**: Removed `fetchConnectionsFeature` useQuery wrapper, replaced with direct `autumn.customer?.features?.connections` read
  - **Dead code**: Removed unused `useMemoriesUsage` hook and `fetchMemoriesFeature`
2026-03-26 05:29:53 +00:00
MaheshtheDev
fe5d16509a feat: ensure workspace created on nova new account (#798)
Added workspace management to the onboarding flow with automatic organization creation and workspace validation throughout the app.

### What changed?

- Wrapped the app layout with an `EnsureWorkspace` component that redirects users without organizations to onboarding
- Enhanced the welcome page to automatically create an organization with a generated slug when users complete their name input
- Expanded the auth context to track organizations list, restoration state, and provide organization refetching capabilities
- Added utility functions for generating unique organization slugs and usernames from display names
- Implemented proper organization restoration logic that handles saved preferences and multiple organization scenarios
2026-03-24 18:17:21 +00:00
Prasanna721
55ef8ab899 fix: billing gate broke for scale/enterprise and downgraded users (#794)
The subscription check on plugins, connections, and usage pages was hardcoded to only look at `api_pro`. Users on scale or enterprise plans saw "Upgrade to Pro" and couldn't create plugin keys or manage connections.

Also, the check only looked at product `status` but not the `allowed` flag from autumn — so users who downgraded but were still in their billing period got locked out early.
2026-03-22 16:05:08 +00:00
Ishaan Gupta
239fc123b9
feat: Use LRUCache instead of Map in MemoryCache (#774) 2026-03-20 10:37:39 -07:00
MaheshtheDev
a00a751e10 pkg(tools): Expose raw search results in MemoryPromptData for prompt templates (#787)
Expose raw search results in `MemoryPromptData` so prompt templates can traverse, filter, and selectively include results based on metadata (e.g. score, source).

##### Usage example

```typescript
const promptTemplate = (data: MemoryPromptData) => {
  const relevant = data.searchResults.filter(
    (r) => (r.metadata?.score as number) > 0.7
  )
  return `${data.userMemories}\n${relevant.map(r => r.memory).join('\n')}`
}
```
2026-03-19 00:38:53 +00:00
MaheshtheDev
c534008001 feat: delete connection without removing the documents (#778)
- Deleting Connection without removing documents
- Updating the Docs with new param
2026-03-17 23:21:36 +00:00
Mahesh Sanikommu
962fb85cd3
feat: empty state action for new spaces (#780)
Co-authored-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-15 11:02:14 -07:00
MaheshtheDev
84d0fb802a feat: bulk delete documents in nova app (#777)
![image.png](https://app.graphite.com/user-attachments/assets/aacbb007-cb5e-400c-a21e-f08a54320154.png)
2026-03-10 15:29:25 +00:00
Dhravya
984297b62d
Add Supermemory integration for Microsoft Agent Framework (#775)
## Summary

This PR introduces comprehensive Supermemory integration for the Microsoft Agent Framework, providing three complementary approaches to add persistent memory capabilities to agents: middleware for automatic memory injection, context providers for session-based memory management, and tools for explicit memory operations.

## Key Changes

- **SupermemoryChatMiddleware**: Automatic memory injection middleware that fetches relevant memories from Supermemory before LLM calls and optionally saves conversations. Supports three modes:
  - `"profile"`: Injects all static and dynamic profile memories
  - `"query"`: Searches for memories relevant to the current user message
  - `"full"`: Combines both profile and query modes

- **SupermemoryContextProvider**: Idiomatic context provider following the Agent Framework pattern (similar to built-in Mem0 integration). Integrates with the session pipeline via `before_run()` and `after_run()` hooks for automatic memory retrieval and storage.

- **SupermemoryTools**: FunctionTool-compatible tools that agents can use for explicit memory operations:
  - `search_memories()`: Search for specific memories
  - `add_memory()`: Add new memories
  - `get_profile()`: Retrieve user profile

- **Utility Functions**: Helper functions for:
  - Memory deduplication across static, dynamic, and search result sources
  - Profile-to-markdown conversion for LLM consumption
  - Message extraction and conversation formatting
  - Logging with configurable verbosity

- **Exception Hierarchy**: Custom exceptions for better error handling:
  - `SupermemoryConfigurationError`: Missing/invalid configuration
  - `SupermemoryAPIError`: API request failures
  - `SupermemoryNetworkError`: Network connectivity issues
  - `SupermemoryMemoryOperationError`: Memory operation failures

- **Comprehensive Documentation**: README with quick start examples, configuration options, and API reference for all three integration approaches.

- **Test Suite**: Unit tests covering middleware, context provider, tools, and utility functions with proper mocking and error scenarios.

## Implementation Details

- Supports both async (aiohttp) and sync (requests) HTTP clients with automatic fallback
- Handles multiple message formats (dict, objects with attributes, content arrays)
- Configurable memory storage with optional conversation grouping via `conversation_id`
- Environment variable fallback for API key configuration (`SUPERMEMORY_API_KEY`)
- Background task management for non-blocking memory operations in middleware
- Proper async/sync compatibility for the Supermemory SDK

https://claude.ai/code/session_012idB5y6UGK3zmeFULgTc4z
2026-03-10 01:49:45 +00:00
Vedant Mahajan
9f7f415dd5
perf: Optimize array traversal for empty memory-graph documents (#770) 2026-03-07 19:34:25 -08:00
MaheshtheDev
3d916d038f chore: chrome extension url fixes (#759) 2026-03-07 04:59:37 +00:00
sreedharsreeram
6d93cd083d OpenAI SDK Backfill (#771) 2026-03-06 23:57:10 +00:00
Dhravya Shah
1afb90145d
😭 fixing builds (#767) 2026-03-05 19:26:05 -08:00
Dhravya Shah
fca026d07a trying something else 2026-03-05 14:49:48 -08:00
Dhravya Shah
bdd1f36f1d one more try 2026-03-05 14:30:57 -08:00
Dhravya Shah
b1d545c4ba fix: 2026-03-05 14:24:50 -08:00
Dhravya Shah
abe52f25f1 fix 2026-03-05 14:01:46 -08:00
Dhravya Shah
55ccc8b154 Merge branch 'main' of https://github.com/supermemoryai/supermemory 2026-03-05 08:29:53 -08:00
Dhravya Shah
4250562824 Merge branch 'main' of https://github.com/supermemoryai/supermemory 2026-03-05 08:29:43 -08:00
Dhravya Shah
bf92ad93a7 proper tracking 2026-03-05 08:29:26 -08:00
Prasanna721
2bbc7fc7a5 feat(mcp): add interactive memory graph MCP App visualization (#763)
### feat(mcp): add memory graph visualization MCP App

#### Summary
  - Add interactive force-directed graph visualization as an MCP App using `force-graph` + `d3-force-3d`
  - Register `memory-graph` and `fetch-graph-data` tools with MCP Apps SDK UI resources
  - Add graph API client methods (`getGraphBounds`, `getGraphViewport`) to `SupermemoryClient`
  - Set up Vite + `vite-plugin-singlefile` build pipeline to produce a self-contained HTML bundle
  - Support light/dark theme, zoom controls, node popups, and legend

  #### Files changed
  - `apps/mcp/src/server.ts` — register app tools + HTML resource
  - `apps/mcp/src/client.ts` — add graph API types and methods
  - `apps/mcp/src/ui/mcp-app.ts` — force-graph visualization app
  - `apps/mcp/src/ui/global.css`, `mcp-app.css` — styling
  - `apps/mcp/mcp-app.html` — entry HTML for Vite
  - `apps/mcp/vite.config.ts` — Vite single-file build config
  - `apps/mcp/package.json` — add UI deps and build scripts
  - `apps/mcp/wrangler.jsonc` — add HTML text import rule
2026-03-05 16:28:34 +00:00
SyedaAnshrahGillani
5d9e142596
refactor: optimize polling and improve optimistic update stability (#753)
Co-authored-by: Syeda Anshrah Gillani <Gillani@cloudment.io>
2026-03-03 19:01:25 -08:00
Dhravya Shah
3a36a673bf fix: posthog 2026-02-26 11:12:38 -08:00
Dhravya Shah
0c46362505 fix: properly attribute revenue with posthog 2026-02-25 18:28:13 -08:00
Prasanna721
15613c2421 feat: change "All Spaces" to "Nova Spaces" with multi-select support (#731)
### Implemented nova spaces multi-select

  ##### Summary
  - Renamed "All Spaces" to "Nova Spaces" - now filters to only nova content (sm_project_*)
  - Added multi-select spaces support via "Select Spaces" modal
  - Projects API now returns `{ nova, developer }` instead of `{ projects }`

  ##### Changes
  - `selectedProject` → `selectedProjects[]` (array-based selection)
  - New `SelectSpacesModal` component for picking multiple spaces
  - Selected spaces appear at top in modal
  - Search works by containerTag
  - Graphs filter by selected spaces
2026-02-13 21:34:58 +00:00
Dhravya Shah
405bff4d9f merge 2026-02-12 16:20:03 -08:00