Skip to main content
Trisynapse Memory logo

Trisynapse Memory

Store traces. Recall meaning.

Evidence-first memory for AI agents: ingest many kinds of data, retrieve the useful parts, and answer with citations.

Tests PyPI version npm version Supported Python versions Apache 2.0 license Project status: alpha

Quickstart · Interfaces · Architecture · API · Operations · Releases


Trisynapse Memory is a local-first memory engine for assistants, agents, and applications. It preserves source evidence in an ordered Trace, builds searchable Recall views, and drills back to the evidence before returning an answer.

Use it when your application needs to remember conversations, documents, code, web pages, tables, images, or structured records—and you need to see where an answer came from.

Why Trisynapse?

Capability What it means
Source-aware Keeps pages, sections, rows, cells, files, symbols, line ranges, speakers, and timestamps.
Grounded Answers from Trace evidence and returns citations—or abstains when confidence is too low.
Inspectable Saves retrieval stages, candidates, decisions, timings, and model provenance as query runs.
Local-first Runs with local embeddings and no completion API key by default. Add a provider only when you need generation or image understanding.
One engine Python, CLI, REST, Studio, and TypeScript share the same store and namespace model.

[!IMPORTANT] Trisynapse Memory is a pre-1.0 alpha. Its core surfaces are implemented, but APIs and store schemas may still change between minor releases.

Quickstart

1. Install

macOS or Linux:

curl -LsSf https://github.com/shanmukh05/trisynapse-memory/releases/latest/download/install.sh | sh

Windows PowerShell:

irm https://github.com/shanmukh05/trisynapse-memory/releases/latest/download/install.ps1 | iex

Or install from PyPI:

pip install 'trisynapse-memory[all]'

Python 3.11 or newer is required. The first semantic search may download the default local embedding model. Re-run the installer to upgrade; uninstall with uv tool uninstall trisynapse-memory.

2. Store and recall something

trisynapse-memory init
trisynapse-memory add observation "Maya prefers three-bullet weekly updates."
trisynapse-memory query "How should I update Maya?"

No completion API key is required for this path. Without one, Trisynapse returns an extractive answer grounded in the retrieved evidence.

3. Open the interactive terminal

trisynapse-memory

Ask a question as plain text or enter / to browse commands. Suggestions narrow as you type; press Tab or Right Arrow to accept one. Useful commands include /ingest, /sources, /history, /model, /remove, and /check.

Ingest several source types together:

trisynapse-memory --project-id demo ingest \
  ./handbook.pdf ./src https://example.com/guide

trisynapse-memory --project-id demo query \
  "What does the handbook say about releases?"

Each source succeeds or fails independently. The run remains available for inspection and failed-item retries.

Choose how you use it

Surface Start here Best for
Interactive terminal trisynapse-memory Exploring memory, ingesting sources, and grounded questions
Scriptable CLI trisynapse-memory --help Automation, jobs, backups, validation, and benchmarks
Python MemoryEngine.from_env(...) In-process agents and applications
REST + Studio trisynapse-memory serve --studio A shared service and visual inspection
TypeScript npm install @trisynapse/trisynapse-memory Node.js or web backends calling the REST service

Python

from trisynapse_memory import MemoryEngine, MemoryNamespace, SourceInput

namespace = MemoryNamespace(user_id="maya", project_id="assistant")
memory = MemoryEngine.from_env(namespace=namespace)

try:
    memory.add("Maya prefers short weekly updates.", episode_id="chat:1")

    memory.ingest_many([
        SourceInput(kind="file", path="./handbook.pdf"),
        SourceInput(kind="directory", path="./src"),
        SourceInput(kind="url", url="https://example.com/guide"),
    ])

    answer = memory.query("How should I write Maya's update?")
    print(answer.answer)
    for citation in answer.citations:
        print(citation.delta_id, citation.locator)
finally:
    memory.close()

Use add() and add_batch() for text that is already normalized. Use ingest() and ingest_many() for files, directories, URLs, repositories, archives, images, and mixed batches.

REST and Memory Studio

trisynapse-memory init
trisynapse-memory serve --studio

Open http://127.0.0.1:8765/studio/. The API token is stored at ~/.trisynapse-memory/store/.api-key; keep it private.

Studio gives you five focused views:

  • Memory Viewer — inspect Trace and every Recall helper, then run live retrieval from the current item.
  • Sources — browse, preview, ingest, retry, download, and remove sources.
  • Queries — watch retrieval run step by step and reopen past workflows.
  • Configuration — choose completion, embedding, and retrieval settings.
  • Connection — select the server, token, and active namespace.

Health and OpenAPI are available at:

GET http://127.0.0.1:8765/api/v1/health
    http://127.0.0.1:8765/openapi.json

See API and interfaces for request contracts, asynchronous ingestion, SSE query runs, source previews, and graph endpoints.

JavaScript and TypeScript

The TypeScript package is a dependency-free Fetch client for the REST service.

npm install @trisynapse/trisynapse-memory
import { TrisynapseMemory } from "@trisynapse/trisynapse-memory";

const memory = new TrisynapseMemory({
  baseUrl: "http://127.0.0.1:8765",
  apiKey: process.env.TRISYNAPSE_MEMORY_API_KEY,
  namespace: { project_id: "demo", user_id: "maya" },
});

await memory.add("Maya prefers short weekly updates.");
const answer = await memory.query("How should I update Maya?");

console.log(answer.answer);
console.log(answer.citations);

The client also covers mixed ingestion, source previews, query runs, memory graphs, lifecycle operations, model selection, retrieval configuration, and connection checks.

How memory works

flowchart LR
    S["Sources"] --> F["Formation<br/>load and structure"]
    F --> T["Trace<br/>ordered evidence"]
    T --> R["Recall<br/>searchable views"]
    Q["Question"] --> P["Retrieval<br/>plan and route"]
    R --> P
    P --> G["Ground in Trace"]
    G --> A["Answer or abstain<br/>with citations"]
  1. Formation loads a source and keeps its useful structure.
  2. Trace stores the resulting evidence in order with provenance and lifecycle state.
  3. Recall builds replaceable indexes, graph connections, episode views, and compiled claims.
  4. Retrieval searches several routes, fuses candidates, and drills back to Trace.
  5. Grounding creates an answer with citations or abstains.

Trace is an application data store, not a cryptographic ledger. validate checks SQLite consistency, sequence continuity, evidence references, and retained source blobs. Recall data can be rebuilt; cited evidence always comes from Trace.

Read the architecture guide →

Sources and retrieval

Supported source types
Category Sources
Documents Text, Markdown, HTML, PDF, DOCX, and PPTX
Structured data JSON, JSONL, YAML, CSV, and XLSX
Code Files, directories, repositories, notebooks, ZIP, and TAR archives
Media PNG, JPEG, and WebP with a vision-capable completion model
Network One public web page or public HTTPS Git repository per source

Code keeps repository paths, languages, symbols, imports, line ranges, file identity, and Git provenance. Repositories honor .gitignore and .trisynapseignore. Tables keep sheets, rows, and cells; documents keep pages and sections; conversations keep speakers and timestamps.

Accepted originals are retained in content-addressed storage and included in backups. The store is permission-restricted but not encrypted at rest.

Retrieval routes and query history

Trisynapse can route a question through lexical, semantic, temporal, graph, code, table, image, document, and conversation retrieval. It fuses and reranks candidates under per-source and total context budgets before grounding.

Every query run can retain executed steps, route candidates, scores, decisions, durations, citations, retrieval configuration, prompt provenance, and provider/model provenance. It never stores API keys, authorization headers, embeddings, hidden model reasoning, or full system prompts.

Models are optional

The default setup uses local SentenceTransformers embeddings and no completion provider. Add completion when you want generated answers, richer extraction and Recall, or image understanding.

export ANTHROPIC_API_KEY="your-key"
trisynapse-memory models set completion anthropic claude-sonnet-4-5
trisynapse-memory models test --role completion

Or run the interactive terminal and enter /model to search provider catalogs and select models.

Supported providers and credential variables
Provider Completion Embedding Credential
OpenAI ✓ ✓ OPENAI_API_KEY
OpenRouter ✓ ✓ OPENROUTER_API_KEY
Gemini ✓ ✓ GEMINI_API_KEY
Anthropic ✓ — ANTHROPIC_API_KEY
DeepInfra ✓ ✓ DEEPINFRA_API_TOKEN
DeepSeek ✓ — DEEPSEEK_API_KEY
Kimi ✓ — MOONSHOT_API_KEY
OpenAI-compatible ✓ ✓ OPENAI_COMPATIBLE_API_KEY when required
SentenceTransformers — ✓ None

Qwen models appear through OpenRouter or DeepInfra when their live catalogs provide them. Model choices are stored per memory store; credentials remain environment-only.

Changing completion affects future work only. Changing embeddings on a non-empty store requires confirmation and builds a complete replacement index before switching. A failed rebuild leaves the old index active.

Provider setup and model behavior →

Memory lifecycle

Operation Meaning
correct() Add a replacement while preserving what changed.
forget() Logically retract memory while retaining authorized history.
remove() Physically redact selected memory content.
remove_source() Remove an original source and all memory derived from it.

Namespaces isolate memory by project and optionally by user, agent, and session. The same namespace rules apply to Python, CLI, REST, Studio, and TypeScript.

Documentation

Read this When you need to…
Architecture Understand Formation, Trace, Recall, retrieval, graphs, and storage
API and interfaces Use Python, REST, SSE, TypeScript, or CLI contracts
Operations Configure providers, deploy Studio, back up, restore, or troubleshoot
Release notes See what changed in each version
Contributing Set up development and submit changes
Security Understand the deployment boundary or report a vulnerability

Release notes

Published installers and packages are on GitHub Releases. Written notes for each version live in docs/releases/.

Version Notes
v0.1.3 Memory Viewer catalog, trusted Python extension packs, non-persistent search, and a starter notebook.
v0.1.2 Retrieval profiles, token-aware grounding, store validation, and the @trisynapse/trisynapse-memory npm package. Includes breaking CLI, REST, and SDK renames.
v0.1.1 Current published release. Installers pin 0.1.1; tagged releases always rebuild and publish.
v0.1.0 First public alpha of the Trace & Recall engine.

Development and benchmarks

pip install -e '.[dev,all]'
pytest -q
ruff check src tests scripts

pnpm install --frozen-lockfile
pnpm --filter @trisynapse/trisynapse-memory check
pnpm --filter @trisynapse/studio test

Benchmark adapters support LoCoMo, LongMemEval, HaluMem, and MemoryDoc. Retrieval mode measures the evidence pipeline without answer-generation calls; end-to-end mode adds provider-backed formation, answering, and judging.

trisynapse-memory bench run locomo \
  --mode retrieval --data-root data/locomo --max-questions 100

trisynapse-memory bench gate --mode retrieval --data-root data

See the benchmark operations guide before treating a result as a release gate.

License

Apache 2.0

Metadata

Release files for trisynapse-memory 0.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for trisynapse-memory 0.1.3
File Size Uploaded
trisynapse_memory-0.1.3.tar.gz 898.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for trisynapse-memory 0.1.3
File Interpreter ABI Platform
trisynapse_memory-0.1.3-py3-none-any.whl Python 3 none any Details

Total release size: 1.8 MB

Release files / trisynapse_memory-0.1.3.tar.gz

Download URL trisynapse_memory-0.1.3.tar.gz
Size 898.9 kB
Tags Source
SHA-256 checksum
How to use checksums
31486dd937a45e93c10935439f81f97dc003842a08179160d2f15edee1bbd822
BLAKE2b-256 checksum
How to use checksums
7e7c8cd3359f993af26c0000eac683d652b130eb9401a69fb7d3d7adbcf0df45
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.6 {"installer":{"name":"uv","version":"0.12.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / trisynapse_memory-0.1.3-py3-none-any.whl

Download URL trisynapse_memory-0.1.3-py3-none-any.whl
Size 886.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3dda71bca1e55eaa463216b23d5cdd8a67959272462580ee09d335c9ad37812b
BLAKE2b-256 checksum
How to use checksums
253628413ce9f73bfa0f9d887c7153c0241eeb4978ebafc682f471e3277b7534
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.6 {"installer":{"name":"uv","version":"0.12.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

0.2.0

2 release files

This release

0.1.3 This release

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page