61 lines
1.3 KiB
Python
61 lines
1.3 KiB
Python
|
|
"""
|
||
|
|
AP Knowledge Base - Allegro-Primus Memory System
|
||
|
|
|
||
|
|
A hierarchical memory storage system based on the memdir pattern from Claude Code.
|
||
|
|
|
||
|
|
Example usage:
|
||
|
|
from knowledge import MemoryDirectory, MemoryEntry, MemoryType
|
||
|
|
|
||
|
|
# Initialize memory directory
|
||
|
|
memdir = MemoryDirectory(Path("~/.ap/knowledge"))
|
||
|
|
|
||
|
|
# Create a memory
|
||
|
|
entry = MemoryEntry(
|
||
|
|
name="Python best practices",
|
||
|
|
description="Coding standards for Python projects",
|
||
|
|
type=MemoryType.PROCEDURE,
|
||
|
|
content="Use type hints, write docstrings...",
|
||
|
|
tags=["python", "coding"]
|
||
|
|
)
|
||
|
|
|
||
|
|
# Save it
|
||
|
|
memdir.save(entry)
|
||
|
|
|
||
|
|
# Search
|
||
|
|
results = memdir.search(MemoryQuery(text="python", limit=5))
|
||
|
|
"""
|
||
|
|
|
||
|
|
from memory_types import (
|
||
|
|
MemoryEntry,
|
||
|
|
MemoryQuery,
|
||
|
|
MemoryRelationship,
|
||
|
|
MemoryType,
|
||
|
|
MemoryScope,
|
||
|
|
RelationshipType,
|
||
|
|
MemoryIndex,
|
||
|
|
SyncConflict,
|
||
|
|
)
|
||
|
|
|
||
|
|
from memdir import MemoryDirectory
|
||
|
|
from knowledge_graph import KnowledgeGraph
|
||
|
|
from sync import FatherSync, SyncManifest
|
||
|
|
|
||
|
|
__all__ = [
|
||
|
|
# Core types
|
||
|
|
'MemoryEntry',
|
||
|
|
'MemoryQuery',
|
||
|
|
'MemoryRelationship',
|
||
|
|
'MemoryType',
|
||
|
|
'MemoryScope',
|
||
|
|
'RelationshipType',
|
||
|
|
'MemoryIndex',
|
||
|
|
'SyncConflict',
|
||
|
|
# Core classes
|
||
|
|
'MemoryDirectory',
|
||
|
|
'KnowledgeGraph',
|
||
|
|
'FatherSync',
|
||
|
|
'SyncManifest',
|
||
|
|
]
|
||
|
|
|
||
|
|
__version__ = '1.0.0'
|