mirror of
https://github.com/vxcontrol/pentagi.git
synced 2026-07-20 12:37:04 -04:00
[PR #250] [CLOSED] feat: integrate SAGE persistent memory for cross-session knowledge #271
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/vxcontrol/pentagi/pull/250
Author: @l33tdawg
Created: 4/10/2026
Status: ❌ Closed
Base:
main← Head:main📝 Commits (2)
a31ce95feat: integrate SAGE persistent memory system1ec2e84test: add comprehensive SAGE integration tests📊 Changes
29 files changed (+2042 additions, -1 deletions)
View changed files
📝
.env.example(+10 -0)📝
backend/cmd/ftester/mocks/tools.go(+33 -0)📝
backend/cmd/ftester/worker/args.go(+2 -0)📝
backend/cmd/ftester/worker/executor.go(+12 -0)📝
backend/cmd/ftester/worker/tester.go(+2 -0)📝
backend/pkg/config/config.go(+8 -0)📝
backend/pkg/config/config_test.go(+53 -0)📝
backend/pkg/controller/assistant.go(+1 -0)📝
backend/pkg/controller/flow.go(+2 -0)📝
backend/pkg/providers/handlers.go(+10 -0)📝
backend/pkg/providers/provider.go(+2 -0)📝
backend/pkg/providers/providers.go(+25 -0)➕
backend/pkg/sage/client.go(+399 -0)➕
backend/pkg/sage/client_test.go(+552 -0)📝
backend/pkg/templates/prompts/coder.tmpl(+19 -0)📝
backend/pkg/templates/prompts/enricher.tmpl(+17 -0)📝
backend/pkg/templates/prompts/memorist.tmpl(+22 -0)📝
backend/pkg/templates/prompts/pentester.tmpl(+20 -0)➕
backend/pkg/templates/sage_test.go(+153 -0)📝
backend/pkg/templates/templates.go(+10 -0)...and 9 more files
📄 Description
Summary
Adds SAGE (Sovereign Agent Governed Experience) as an optional persistent memory layer for cross-session knowledge retention. SAGE memories go through BFT consensus, have confidence scores, and decay over time — giving PentAGI agents institutional knowledge that survives between engagements.
pkg/sage/client.go) — Ed25519-authenticated HTTP client with persistent keypair identitysage_recall,sage_remember) — registered in pentester, coder, memorist, and enricher executorsdocker-compose-sage.yml) — SAGE node + Ollama for semantic embeddingsSAGE_ENABLED,SAGE_URL,SAGE_KEY_PATH,SAGE_BOT_NAME,SAGE_TIMEOUTHow it works
When enabled, agents:
Test results
Tested against OWASP Juice Shop. SAGE-enhanced run completed 8/8 subtasks covering 7 vulnerability classes (recon, SQLi, XSS search, XSS reviews, JWT manipulation, IDOR, path traversal). Agents actively recalled from SAGE before testing and stored findings back — 44 SAGE-related messages observed during the run.
Key behavioral improvements with SAGE enabled:
Unit tests: 32/32 passing across client, tools, templates, and config packages.
Usage
Files changed
30 files, +2042 lines. Zero changes to core orchestration — SAGE is fully optional and follows the existing Graphiti integration pattern.
Test plan
go build ./...— cleango vet ./...— cleandocker compose -f docker-compose.yml -f docker-compose-sage.yml up -dand verifies SAGE tools appear in agent tool list🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.