Falsafa: My AI Literary Companion
Introduction
Philosophy is a necessity, just like breath to life. It gives our life meaning, sharpens our focus, and provides a moral compass for navigation. It is the foundation of our personality, the source of our resilience, and the very thing that makes us human, enabling true connection and growth. It is, quite simply, our GPS for the journey of life.
I aim to develop an AI companion capable of animating my beloved characters and poems. I envision engaging in conversations with them, posing questions, and enjoying natural, human-like interactions that make it seem as though they are physically present with me.
Falsafa means Philosopy in Urdu.
Functional Requirements
-
Uploading Content:
- Users should be able to submit their preferred literary works, such as books and poems, in text or pdf formats.
-
Building Semantic Database:
- The application needs to analyze the uploaded content to create a semantic vector database by:
- Intelligently dividing the text into sections (e.g., chapters, scenes, stanzas, dialogues).
- Generating embeddings for each section.
- Storing relevant details like the title of the work, characters, speakers, themes, and mood.
-
Integration with Retrieval-Augmented Generation (RAG):
- Establish a connection between the Language Model (LLM) and the semantic database using a RAG process.
- Upon receiving a query from the user, the system should:
- Understand the query.
- Retrieve the most pertinent semantic segments from the vector database.
- Provide the LLM with the retrieved context and user directives.
- Ensure that the generated response mirrors the personality, mood, and writing style of the referenced book, poem, or character.
-
Conversational User Interface:
- Develop an interactive user interface to facilitate multi-step dialogues.
Nonfunctional Requirements
-
Memory Persistence:
- The system is required to maintain a durable storage component that:
- Retains information regarding the user.
- Keeps records of details such as preferences and habits related to characters or dialogues.
- Facilitates the AI companion in becoming more tailored over time.
- Storage of memory data should:
- Persist between different sessions.
- Include features like version control or time sensitivity (considering recency and importance).
- The system is required to maintain a durable storage component that:
-
Scalability:
- The software should support the addition of new content like books, poems, characters, or user inputs at any given moment.
- Newly added items must:
- Be absorbed into the system seamlessly.
- Be integrated effectively.
- Be immediately accessible for retrieval through RAG and memory functions.
-
Operational Efficiency:
- Retrieval processes need to be swift to enable real-time interactions (with a preference for sub-second vector searches).
- The system should adeptly manage:
- Extensive text data (ranging from 100k to 1M tokens).
- Complex scenarios involving multiple books or characters.
-
Data Protection and Confidentiality:
- Safeguarding user information (including preferences, memories, and discussions) is paramount.
- Memory data should not cross over to unrelated personas unless explicitly permitted.
-
System Stability:
- The vector database and memory storage must remain intact through system reboots, malfunctions, or updates.
- The process of creating embeddings should yield consistent results during content reevaluation.