Semantic Kernel (Microsoft) integration
Astrocyte as a kernel plugin for Microsoft Semantic Kernel.
Module: astrocyte.integrations.semantic_kernel
Pattern: Plugin with kernel functions — retain, recall, reflect, forget methods
Framework dependency: semantic-kernel (optional)
Install
Section titled “Install”pip install astrocyte semantic-kernelfrom astrocyte import Astrocytefrom astrocyte.integrations.semantic_kernel import AstrocytePlugin
brain = Astrocyte.from_config("astrocyte.yaml")plugin = AstrocytePlugin(brain, bank_id="user-123")
# Register with Semantic Kernelfrom semantic_kernel import Kernelkernel = Kernel()kernel.add_plugin(plugin, plugin_name="memory")
# Call functions directlyresult = await plugin.retain("Calvin prefers dark mode", tags="preference,ui")result = await plugin.recall("UI preferences")answer = await plugin.reflect("What are Calvin's preferences?")Integration pattern
Section titled “Integration pattern”Each method follows the Semantic Kernel @kernel_function convention: named method with docstring, type-annotated parameters, returns string.
| Plugin method | Astrocyte call | Returns |
|---|---|---|
retain(content, tags?) | brain.retain() | "Stored memory (id: ...)" |
recall(query, max_results?) | brain.recall() | Formatted list of scored hits |
reflect(query) | brain.reflect() | Synthesized answer |
forget(memory_ids) | brain.forget() | "Deleted N memories." |
API reference
Section titled “API reference”AstrocytePlugin(brain, bank_id, *, include_reflect=True, include_forget=False)
Section titled “AstrocytePlugin(brain, bank_id, *, include_reflect=True, include_forget=False)”Methods: retain(), recall(), reflect(), forget(), get_functions().
get_functions() returns a list of {"name", "description", "function"} dicts for programmatic registration.