Documentation
¶
Overview ¶
Package memhop is the public export layer of the MemHop memory engine.
The v2 implementation lives entirely under internal/ (packages internal, internal/sub, internal/sub/repo/core and internal/sub/common). This root package re-exports the public surface as type aliases plus one-line constructor wrappers, so external modules can import github.com/qyiun666/MemHop without reaching into internal packages.
Open returns a *DB whose full method set is available directly: Search, Update, Dream, the L0-L7 APIs, plus the promoted sub-layer methods Close / Checkpoint / RunDream / IsClosed / HasActiveScenes / TouchLastDreamAt / Lock / Unlock.
Index ¶
- Constants
- Variables
- type ArchiveSlot
- type Code
- type ContentType
- type CrystallizeResult
- type DB
- type Encoder
- type Error
- type GraphEdgeKind
- type HttpEncoder
- type HypergraphEdge
- type HypergraphNode
- type HypergraphSlot
- type HypergraphSource
- type L3Graph
- type L3ImportItem
- type L3ImportMode
- type L3ImportResult
- type L3NodeQuery
- type L3Subgraph
- type L4Query
- type LlmConfig
- type MemHopConfig
- type MemHopDefaults
- type PluginImport
- type PluginItem
- type PluginListQuery
- type PluginManifest
- type PluginSlot
- type PluginStatus
- type ProfileSlot
- type SceneSlot
- type SceneUsageSlot
- type SearchQuery
- type SearchResult
- type SourceKind
- type TopicSlot
- type TrajectorySlot
Constants ¶
const ( L3ImportSkip = sub.L3ImportSkip L3ImportMerge = sub.L3ImportMerge L3ImportOverwrite = sub.L3ImportOverwrite )
const ( ContentText = core.ContentText ContentImage = core.ContentImage ContentVideo = core.ContentVideo ContentDocument = core.ContentDocument ContentAudio = core.ContentAudio ContentCode = core.ContentCode ContentOther = core.ContentOther )
const ( PluginDraft = core.PluginDraft PluginActive = core.PluginActive PluginDeprecated = core.PluginDeprecated )
const ( SourcePath = core.SourcePath SourceContext = core.SourceContext SourceURL = core.SourceURL SourceManual = core.SourceManual )
const ( EdgeRelated = core.EdgeRelated EdgeCausal = core.EdgeCausal EdgePartOf = core.EdgePartOf EdgeSequence = core.EdgeSequence EdgeDependency = core.EdgeDependency EdgeCustom = core.EdgeCustom )
const ( RoleUser = core.RoleUser RoleAgent = core.RoleAgent RoleSystem = core.RoleSystem RoleDream = core.RoleDream )
ArchiveSlot message roles.
const ( ErrConfig = common.ErrConfig ErrVectorDimMismatch = common.ErrVectorDimMismatch ErrInvalidQuery = common.ErrInvalidQuery ErrNotFound = common.ErrNotFound ErrIO = common.ErrIO ErrClosed = common.ErrClosed ErrInvalidMagic = common.ErrInvalidMagic ErrCRCMismatch = common.ErrCRCMismatch ErrCorruption = common.ErrCorruption ErrSerialization = common.ErrSerialization ErrDeserialization = common.ErrDeserialization ErrEncoder = common.ErrEncoder ErrLLM = common.ErrLLM )
Variables ¶
var DefaultMemHopDefaults = sub.DefaultMemHopDefaults
DefaultMemHopDefaults is the shared default engine configuration.
Functions ¶
This section is empty.
Types ¶
type ArchiveSlot ¶
type ArchiveSlot = core.ArchiveSlot
ArchiveSlot is an L4 user/agent chat message.
type ContentType ¶
type ContentType = core.ContentType
ContentType is the type of content stored in an ArchiveSlot.
type CrystallizeResult ¶
type CrystallizeResult = sub.CrystallizeResult
CrystallizeResult reports the L5 plugins created from a trajectory.
type DB ¶
type DB = memhopinternal.DB
DB is the public database handle returned by Open / OpenWithEncoder. All methods of the internal DB are available on *DB.
func Open ¶
func Open(cfg *MemHopConfig) (*DB, error)
Open creates or opens a MemHop database using a default Ollama encoder.
func OpenWithEncoder ¶
func OpenWithEncoder(cfg *MemHopConfig, enc Encoder) (*DB, error)
OpenWithEncoder creates or opens a MemHop database with a custom encoder.
type GraphEdgeKind ¶
type GraphEdgeKind = core.GraphEdgeKind
GraphEdgeKind classifies edges within an L3 hypergraph.
type HttpEncoder ¶
type HttpEncoder = sub.HttpEncoder
HttpEncoder is the Ollama-backed Encoder implementation.
func CreateEncoder ¶
func CreateEncoder(cfg *MemHopConfig) (*HttpEncoder, error)
CreateEncoder builds the default Ollama HTTP encoder for a config.
func NewHttpEncoder ¶
NewHttpEncoder constructs an Ollama encoder from raw parameters.
type HypergraphEdge ¶
type HypergraphEdge = core.HypergraphEdge
HypergraphEdge is an edge within an L3 hypergraph.
type HypergraphNode ¶
type HypergraphNode = core.HypergraphNode
HypergraphNode is a node within an L3 hypergraph.
type HypergraphSlot ¶
type HypergraphSlot = core.HypergraphSlot
HypergraphSlot is an L3 hypergraph container slot.
type HypergraphSource ¶
type HypergraphSource = core.HypergraphSource
HypergraphSource is the origin of an L3 hypergraph.
type L3ImportItem ¶
type L3ImportItem = sub.L3ImportItem
L3ImportItem is one knowledge node to import.
type L3ImportMode ¶
type L3ImportMode = sub.L3ImportMode
L3ImportMode controls duplicate handling in ImportL3.
type L3ImportResult ¶
type L3ImportResult = sub.L3ImportResult
L3ImportResult reports the outcome of ImportL3.
type MemHopDefaults ¶
type MemHopDefaults = sub.MemHopDefaults
MemHopDefaults holds all tunable engine defaults.
type PluginImport ¶
type PluginImport = sub.PluginImport
PluginImport is the JSON description of a plugin read from an import path.
type PluginItem ¶
type PluginItem = core.PluginItem
PluginItem is one entry within a plugin manifest section.
type PluginListQuery ¶
type PluginListQuery = sub.PluginListQuery
PluginListQuery filters the L5 plugin list.
type PluginManifest ¶
type PluginManifest = core.PluginManifest
PluginManifest is the structured content of a PluginSlot.
type PluginStatus ¶
type PluginStatus = core.PluginStatus
PluginStatus is the lifecycle state of a PluginSlot.
type SceneUsageSlot ¶
type SceneUsageSlot = core.SceneUsageSlot
SceneUsageSlot is an L6 scene-level retrieval usage feedback record.
type SearchQuery ¶
type SearchQuery = sub.SearchQuery
SearchQuery is the retrieval request fed to (*DB).Search.
type SearchResult ¶
type SearchResult = sub.SearchResult
SearchResult is the retrieval response returned by (*DB).Search.
type SourceKind ¶
type SourceKind = core.SourceKind
SourceKind identifies how an L3 HypergraphSlot was created.
type TrajectorySlot ¶
type TrajectorySlot = core.TrajectorySlot
TrajectorySlot is an L7 operation trajectory event.
Directories
¶
| Path | Synopsis |
|---|---|
|
sub
Package encoder provides the embedding encoder implementation backed by the Ollama HTTP API.
|
Package encoder provides the embedding encoder implementation backed by the Ollama HTTP API. |
|
sub/common
Numeric error code system (G-01): 0=success | 1001-1999 parameter | 2001-2999 auth | 3001-3999 resource | 4001-4999 business | 5001-5999 system | 9001-9999 third-party.
|
Numeric error code system (G-01): 0=success | 1001-1999 parameter | 2001-2999 auth | 3001-3999 resource | 4001-4999 business | 5001-5999 system | 9001-9999 third-party. |
|
sub/repo
L6 scene usage feedback operations: one upserted record per scene, consumed by Dream to steer L1 importance from retrieval usage.
|
L6 scene usage feedback operations: one upserted record per scene, consumed by Dream to steer L1 importance from retrieval usage. |
|
sub/repo/core
L0-L7 data models for the MemHop memory database.
|
L0-L7 data models for the MemHop memory database. |
|
sub/repo/index
Unified retrieval index rebuild: one engine scan rebuilds sparse (depth<=2 topics only), L1Reverse and L2Meta.
|
Unified retrieval index rebuild: one engine scan rebuilds sparse (depth<=2 topics only), L1Reverse and L2Meta. |
|
test
|
|
|
testsupport
Package testsupport provides shared helpers for integration tests that run against real Ollama (encoder) and DeepSeek (LLM) services.
|
Package testsupport provides shared helpers for integration tests that run against real Ollama (encoder) and DeepSeek (LLM) services. |