Inspiration
Software engineers working on proprietary or security-sensitive codebases face a harsh paradox: modern AI assistants promise massive productivity gains, but sending confidential source code, database credentials, and API keys to a commercial cloud service is often forbidden. And the assistants that are allowed suffer from contextual amnesia: they treat every prompt in isolation, forgetting the architectural trade-offs your team agreed on months ago, so they keep reintroducing decisions you already superseded.
We built Sovereign Engineering Copilot so a developer can get frontier-class reasoning without giving up data sovereignty, and so the assistant stops repeating architectural mistakes it already made.
What it does
- Local Privacy Sanitizer. Every prompt is scanned on the local machine before inference. API keys, database connection strings, bearer tokens, private keys, internal IPs, and emails are replaced with reversible pseudonym tokens. Zero plaintext leaves the machine.
- Temporal Architectural Memory (hero feature). A local SQLite graph stores Architectural Decision Records with validity timestamps, tags, and explicit supersession links. Retrieval ranks decisions with an exponential temporal-decay function, so current decisions outrank stale ones and superseded rules stop being injected into the prompt.
- Autonomous Self-Healing Refactor. The agent proposes a patch, runs the local test suite in an isolated subprocess, reads the failures, and repairs itself until tests pass, or rolls back cleanly when the repair budget is exhausted.
- Model Context Protocol server. Memory and privacy tools are exposed over JSON-RPC stdio, so Cursor, Claude Desktop, and other agents can use Sovereign Copilot as a local memory and privacy layer.
- Security audit and graph inspection.
sovereign auditscans a repository for leaked secrets;sovereign graphrenders active versus superseded decisions.
How we use Nebius and NVIDIA
Sanitized context is sent to the Nebius Token Factory inference API, driving nvidia/llama-3.1-nemotron-70b-instruct as the reasoning engine for architecture-aware code generation. Nebius provides the OpenAI-compatible endpoint and GPU capacity, and NVIDIA Nemotron provides frontier-class open-weights reasoning with strong instruction adherence. Because the sanitizer runs before the request, Nebius never receives a secret: developers get frontier reasoning without surrendering data sovereignty. The Tavily search API grounds refactors in current official documentation and security advisories.
How we built it
- Python 3.10 to 3.12, packaged with pyproject.toml and uv.
- OpenAI-compatible inference client targeting the Nebius Token Factory endpoint with NVIDIA Nemotron.
- SQLite temporal knowledge graph with validity intervals, supersession edges (SUPERSEDED_BY), and exponential decay ranking.
- Regex-plus-heuristic sanitization pipeline mapping secrets to reversible
[SOVEREIGN_REDACTED_*]tokens. - Clean-room Model Context Protocol stdio server.
- pytest suite plus GitHub Actions CI across three Python versions.
Challenges we ran into
- Temporal drift versus flat retrieval. Vector retrieval surfaces obsolete decisions next to current ones. We solved it with an explicit state graph and supersession relationships rather than similarity alone.
- Deterministic secret scrubbing. Catching passphrases embedded in connection URIs while never corrupting ordinary source syntax required iterative pattern work and tests.
- Cross-platform SQLite locking. Context-managed connections were needed to avoid file locks during rapid subprocess test runs on Windows.
Accomplishments we are proud of
- A verified zero-plaintext-leakage boundary: credentials never leave the local perimeter.
- Temporal memory that genuinely suppresses superseded architecture instead of merely ranking it lower.
- A clean path from sanitized local context to open NVIDIA weights on Nebius infrastructure.
What we learned
- Open-weight models such as NVIDIA Nemotron-70B, when paired with strict contextual memory and clear guardrails, follow hard architectural constraints very reliably.
- Nebius Token Factory is a drop-in, OpenAI-compatible endpoint, so integrating it took very little code.
What's next
- IDE extensions that warn inline when a change violates an active ADR.
- Air-gapped CI review bot running entirely on local memory plus sanitized inference.
- Multi-agent delegation through the MCP server surface.
Links
- Live interactive showcase: https://glatinone.github.io/sovereign-copilot/
- Source code (MIT license): https://github.com/glatinone/sovereign-copilot
- Demo video: https://youtu.be/z8i3hh4c3uk
Log in or sign up for Devpost to join the conversation.