Skip to content

jbpayton/SophiaAMS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

79 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SophiaAMS Banner

SophiaAMS

an agentic memory system based on self assembling associative semantic structures


Most AI agents forget everything between sessions. They can't set their own goals, break them down, or build on what they've already learned. SophiaAMS is an attempt to solve these problems — an autonomous agent with persistent semantic memory and self-directed goal decomposition that actually remembers, plans, and grows over time.

New Feature - Mindscape Navigator

The agent's knowledge isn't a search index — it's a navigable space. Mindscape Navigator treats the knowledge graph as a topology of concept-rooms connected by typed semantic doors, inspired by Gopher selectors and Yahoo's curated directory.

  • Rooms — Dynamically assembled clusters of semantically coherent triples, sized to a context budget. Each room gets an LLM-generated narrative summary with the raw triples available underneath.
  • Doors — Typed semantic exits (extends, contradicts, instantiates, related-to) leading to adjacent rooms. Overflow triples that don't fit the current room naturally become doors to deeper content.
  • Directory — Hierarchical knowledge taxonomy built from density-based clustering. Browse from broad categories down to specific knowledge pages.
  • Images — Ingested images are cached locally and displayed inline in rooms.
  • The Page Jump — The felt transition from browsing a taxonomy to being inside knowledge. Old-internet energy, monospace text, the browser in control.

Mindscape Navigator
Mindscape Navigator — browsing a room about Psycho with typed doors to related concepts

Key Features

  • Persistent Semantic Memory — Every conversation and document is extracted into a knowledge graph of semantic triples with vector embeddings. The agent recalls relevant knowledge automatically each turn, with source attribution (URLs, context snippets) for real citations.
  • Mindscape Navigator — Semantic knowledge browser that turns the triple store into a navigable topology of rooms and doors. Browse the agent's mind like the old internet.
  • Autonomous Goal Decomposition — The agent sets its own goals, automatically breaks broad objectives into 3-5 actionable sub-goals, and works through them depth-first. Instrumental goals persist indefinitely and spawn derived tasks over time.
  • Episodic Memory — Temporal awareness of past interactions — what happened and when.
  • Autonomous Mode — Independent research, learning, and progress reporting with a live knowledge graph panel.
  • Extensible Skills — Web search, web reading, goal management, memory queries, and sandboxed code execution — all loaded dynamically.
  • Any LLM — Works with any OpenAI-compatible API (local or cloud). Resilient client with automatic retry and backoff.
  • React Web UI — Chat, knowledge graph, Mindscape, goal management, settings, and admin panels.

Autonomous Activity
Autonomous mode — live activity feed and knowledge graph

Chat
Chat with source-attributed memory recall

Knowledge Graph
Knowledge graph visualization

See the full documentation for all screenshots, architecture details, configuration, and API reference.

Quick Start

# Python dependencies
pip install -r requirements.txt
python -m spacy download en_core_web_sm

# Web frontend
cd sophia-web/server && npm install
cd ../client && npm install

# Launch
python main.py

On first run, a setup wizard opens in your browser to configure the agent name, LLM connection, and personality. After setup, open http://localhost:3000.

Architecture

python main.py
    ├── EventBus (async priority queue)
    ├── EventProcessor (routes events → agent)
    ├── SophiaAgent (LLM + memory + skills + code runner)
    ├── Adapters
    │   ├── WebUI (HTTP/WebSocket)
    │   ├── Scheduler (cron-like jobs)
    │   ├── Goal Engine (autonomous goal pursuit)
    │   └── Telegram (optional)
    ├── FastAPI server (port 5001)
    ├── Node.js API proxy (port 3001)
    └── Vite React dev server (port 3000)

Tested With

SophiaAMS is developed and tested on a local LLM setup:

  • LLM: Qwen3.5-35B-A3B (35B total / 3B active MoE, Q4_K_M GGUF) via LM Studio
  • Embeddings: sentence-transformers/all-MiniLM-L6-v2 (local)
  • Search: SearXNG (self-hosted)
  • Vector DB: Qdrant (local, file-backed)
  • Hardware: Consumer desktop GPU, ~50 tokens/sec generation

The system is designed to work with any OpenAI-compatible API — local models via LM Studio/Ollama, or cloud providers like OpenAI, Anthropic (via proxy), etc. Timeouts and retry logic are tuned for slower local models.

Security and Safety

This system executes code autonomously. Treat it accordingly.

SophiaAMS includes an LLM-driven code execution loop — the agent can write and run Python code on its own initiative during goal pursuit. While there are some guardrails in place, they are not a substitute for proper isolation.

Built-in safeguards:

  • Workspace sandboxing — Code execution is confined to a workspace/ directory with path traversal detection
  • Execution timeouts — Configurable limits (default 180s) prevent runaway processes
  • Output truncation — stdout/stderr capped at 50KB to prevent memory exhaustion
  • Secret scrubbing — API keys and sensitive values are redacted from logs and event routing
  • Error ingestion filtering — Error messages are detected and excluded from the knowledge graph to prevent "memory poisoning"

What these safeguards do NOT cover:

  • No process-level sandboxing (no containers, no seccomp, no filesystem jailing beyond cwd)
  • No network isolation — executed code can make arbitrary network requests
  • No import restrictions — any Python package available to the interpreter can be used
  • No resource limits beyond timeout (CPU, memory, disk usage are unconstrained)
  • The path traversal check is basic string matching, not a security boundary

Recommendations for production or shared environments:

  • Run inside a Docker container with limited permissions (see Docker guide)
  • Use a dedicated, unprivileged user account
  • Restrict network access from the container if the agent doesn't need outbound connectivity
  • Monitor the workspace/ directory and execution logs
  • Do not expose the API (ports 5001/3001) to untrusted networks without authentication

License

MIT


SophiaAMS — Persistent memory for autonomous AI agents

About

Memory System for LLM Based Agents

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors