mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-05-27 19:25:15 +02:00
feat: add memory document model and parsing functionality for markdown handling
This commit is contained in:
parent
fe07de3f9c
commit
a0ff86e0e8
5 changed files with 241 additions and 37 deletions
|
|
@ -13,6 +13,7 @@ from sqlalchemy import select
|
|||
from sqlalchemy.ext.asyncio import AsyncSession
|
||||
|
||||
from app.db import SearchSpace, User
|
||||
from app.services.memory.document import parse_memory_document, render_memory_document
|
||||
from app.services.memory.prompts import (
|
||||
TEAM_MEMORY_EXTRACT_PROMPT,
|
||||
USER_MEMORY_EXTRACT_PROMPT,
|
||||
|
|
@ -184,6 +185,8 @@ async def save_memory(
|
|||
warnings=warnings,
|
||||
)
|
||||
|
||||
next_content = render_memory_document(parse_memory_document(next_content))
|
||||
|
||||
try:
|
||||
_set_memory(target, normalized, next_content)
|
||||
session.add(target)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue