Skip to content

Package the engine as graphsight-memory, with a Memory API - #22

Merged
Kcodess2807 merged 2 commits into
mainfrom
memory-package
Nov 19, 2026
Merged

Kcodess2807 merged 2 commits into
mainfrom
memory-package

Conversation

@Kcodess2807

Copy link
Copy Markdown
Owner

Milestone 1: graph memory becomes a package you can pip install, with no torch and no API keys.

from graphsight_memory import Memory

mem = Memory("team.lbug")
mem.sync_github("org/repo")
mem.remember("src/checkout.py", "OWNED_BY", "payments team", source="standup")
print(mem.recall("who wrote the last change to the file payments owns?"))

What changed

  • The engine moves from backend/tracerag to graphsight-memory/graphsight_memory. The backend, scripts, eval and tests import it from there, so there's no second copy.
  • Memory covers sync_github, load (a saved snapshot), remember, retract, forget, learn and recall. recall returns typed Facts with their sources, and str(recall) is ready to put in a prompt.
  • ONNX embedder (fastembed):
    • Vectors match sentence-transformers to five decimals (cosine 1.00000 on six test texts), so existing .lbug graphs keep working with no re-embedding.
    • The install is 187 MB, against 1.6 GB with torch. sentence-transformers is used as a fallback if it's installed.
  • No key needed. With no API key set, the router uses fixed intent weights instead of calling the model and failing on every question.
  • Fixed relation vocabulary. remember refuses an unknown relation unless the store is opened with relations=None, and learn gives the extractor the list.
  • GitHub fetching moves into the package, and ingest_github.py uses it.
  • Docker, CI and release:
    • Compose builds from the repo root, and the image moves to Python 3.12, which LadybugDB's vector index needs.
    • CI installs and tests the package.
    • The release workflow builds it, and skips a package whose version didn't change.

Verified

  • 14 package tests run offline with a stub embedder. They pass from the source tree and from a fresh install of the built wheel in an empty venv.
  • The backend's 86 engine tests pass. That's 92 before, with 6 GitHub-fetch tests moved into the package.
  • End to end with the real embedder and no keys:
    • The pydantic snapshot loaded 267 nodes in 22 s, including the model load.
    • Recall took 0.2 s.
    • Update, retract and the relation check all behaved correctly.
  • The backend still imports (api, mcp_server and the scripts). twine check passes.

Not done here

  • Docker wasn't built locally.
  • The first PyPI release needs a pending trusted publisher for graphsight-memory (owner Kcodess2807, repo graphsight, workflow release.yml, environment pypi).

🤖 Generated with Claude Code

The engine moves from backend/tracerag to its own package, and the backend,
scripts, eval and tests import it from there.

- Memory: sync_github, load, remember, retract, forget, learn and recall,
  over one local file. recall returns typed facts with their sources.
- Embeds with MiniLM on ONNX (fastembed): the same vectors as
  sentence-transformers to five decimals, so existing graphs keep working,
  in a 187 MB install against 1.6 GB with torch.
- No API key needed: with none set, the router skips the intent model
  instead of calling it and failing on every question.
- A fixed relation vocabulary. remember refuses unknown relations unless the
  store is opened with relations=None, and learn tells the extractor the list.
- GitHub fetching moves into the package, and the ingest script uses it.

14 package tests run offline with a stub embedder, and pass from a fresh
install of the built wheel. The backend's 86 engine tests pass unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
trace-rag Ready Ready Preview Nov 19, 2026 8:35am UTC

It passed locally only because .env held a key, so the patched intent model was
reached. In CI there is none, and the no-key path answered first. The test now
sets its key, and a new test covers the no-key path.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Kcodess2807
Kcodess2807 merged commit 18a2a96 into main Nov 19, 2026
8 checks passed

This branch was successfully deployed

1 active deployment
Preview — a3031151 Deployed Nov 19, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant