cognee/cognitive_architecture/database/relationaldb/models/docs.py
Boris Arzentar 769d6b5080 feat: add create-memory and remember API endpoints
Add possibility to create a new Vector memory and store text data points using openai embeddings.
2024-02-25 23:56:50 +01:00

19 lines
821 B
Python

""" This module contains the MemoryModel class, which is a SQLAlchemy model for the memory table in the relational database. """
from datetime import datetime
from sqlalchemy import Column, String, DateTime, ForeignKey, Boolean
from sqlalchemy.orm import relationship
from ..database import Base
class DocsModel(Base):
""" Docs model"""
__tablename__ = "docs"
id = Column(String, primary_key=True)
operation_id = Column(String, ForeignKey("operations.id"), index=True)
doc_name = Column(String, nullable=True)
graph_summary = Column(Boolean, nullable=True)
memory_category = Column(String, nullable=True)
created_at = Column(DateTime, default=datetime.utcnow)
updated_at = Column(DateTime, onupdate=datetime.utcnow)
operations = relationship("Operation", back_populates="docs")