Skip to main content

Synaptic Core foundation and persistence layer for graph-backed memory.

Project description

synaptic-core

Graph-backed memory runtime for production AI applications.

synaptic-core provides an async memory engine with hybrid retrieval, associative activation, feedback-driven learning, and durable observability.

Why synaptic-core

  • Hybrid retrieval: combines keyword, semantic, and graph activation signals.
  • Tiered memory: supports short-term and long-term memory with automatic graduation.
  • Feedback learning: updates graph associations based on user/agent outcomes.
  • Operational visibility: includes graph health, per-session summaries, and weekly digest reporting.
  • Local-first default: ships with a SQLite backend and stable persistence semantics.

Installation

Requirements:

  • Python 3.10+

Install from source:

python -m pip install .

Optional extras:

python -m pip install ".[real_embedding]"

Axis-core plugin usage:

python -m pip install synaptic-core

synaptic-core now publishes an axis.memory entry point named synaptic that resolves to synaptic_core.axis:SynapticAxisMemory.

Quick Start

import asyncio

from synaptic_core import SynapticMemory
from synaptic_core.types import OutcomeSignalType


def embed(text: str) -> list[float]:
    normalized = text.lower().strip()
    return [
        float(len(normalized.split())),
        float(len(normalized)) / 100.0,
        float(sum(ord(ch) for ch in normalized) % 97) / 100.0,
    ]


async def main() -> None:
    memory = SynapticMemory(
        db_path="synaptic.db",
        embedding_fn=embed,
        deployment_id="prod-us-east-1",
    )

    await memory.store(
        "Customer requested monthly usage report with CSV export.",
        metadata={"tenant": "acme", "channel": "support"},
    )

    retrieval = await memory.retrieve(
        "How does Acme get their monthly usage report?",
        session_id="chat-42",
        top_k=5,
    )

    outcome = await memory.feedback(
        retrieval.query_id,
        outcome=OutcomeSignalType.EXPLICIT_POSITIVE,
        active_nodes=[node.id for node in retrieval.nodes],
        provider="assistant-api",
    )

    status = await memory.graph_status()
    session = await memory.session_summary("chat-42")
    digest = await memory.weekly_digest()

    print(retrieval.nodes[0].content if retrieval.nodes else "no matches")
    print(outcome.composite_score, status["graph_confidence"], session["query_count"], digest["summary"])


asyncio.run(main())

Core API

  • store(content, ...) -> Node
  • retrieve(query, ...) -> RetrievalResult
  • activate(node_ids, initial_energy=1.0, ...) -> RetrievalResult
  • feedback(query_id, outcome, ...) -> CompositeOutcome
  • graph_status() -> dict
  • session_summary(session_id) -> dict
  • weekly_digest(...) -> dict
  • stats() -> dict
  • delete(node_id) -> None

Production Notes

  • embedding_fn is required for store and retrieve; it may be sync or async.
  • Use stable session_id values to get accurate session analytics.
  • Use stable deployment_id values to keep telemetry attribution consistent.
  • Telemetry and background hardening paths are designed to be failure-isolated from hot request paths.
  • The default SQLite backend is appropriate for single-node/local deployments.

Extensibility

  • Backend abstraction is defined by MemoryBackend in src/synaptic_core/backends/base.py.
  • You can supply a custom backend by passing backend=... to SynapticMemory.
  • Axis-compatible provider method shapes are covered by integration tests (store, retrieve, feedback).
  • Axis-compatible key-value/session adapter is available as SynapticAxisMemory.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

synaptic_core-0.1.1.tar.gz (84.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

synaptic_core-0.1.1-py3-none-any.whl (88.1 kB view details)

Uploaded Python 3

File details

Details for the file synaptic_core-0.1.1.tar.gz.

File metadata

  • Download URL: synaptic_core-0.1.1.tar.gz
  • Upload date:
  • Size: 84.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.18

File hashes

Hashes for synaptic_core-0.1.1.tar.gz
Algorithm Hash digest
SHA256 d7e18bd1bbe94fa54f002da4c2afc052b24821a0c2edb3fb47ef048fb862a5ec
MD5 75f1c6b3fb0ec135643ff01825600051
BLAKE2b-256 6bcec6686fb36d7c37f73468b8ab79991441f33e175350eea5c8d79011109e18

See more details on using hashes here.

File details

Details for the file synaptic_core-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for synaptic_core-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 75e06ca7aed4e39f03c6ce38a810271b50c92524d2f213cea6dc6487a62862ec
MD5 a0b359ba67d509ff7d8fdb2c79972af3
BLAKE2b-256 f1ddb023d6b893d4ced2ccd2cc2e1cbdc010ec2536a6bb772aeb96c552b4dfb8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page