Avina — AI-Assisted Reflective Journaling
Avina is an AI reflective-journal that helps users process and reflect on their own thoughts through journaling and grounded, growth-oriented guidance. It pairs persistent chat sessions with retrieval from curated psychological and educational resources, so responses are rooted in well-articulated material rather than free-floating generation.
Key features
- Grounded reflective chat. A persistent chat contract per journal entry returns responses grounded in curated sources.
- Voice-to-insight pipeline. An audio path transcribes voice memos with Amazon Transcribe before analysis (currently deferred behind a text-first launch path).
- Wisdom-grounded retrieval. Curated source material is embedded and retrieved with FAISS vector search.
- Expression profiling and memory. The system tracks emotional expression over time and can remember people and topics — with the user's consent.
Backend & architecture
- Go backend API with JWT access and refresh tokens; MongoDB as the store.
- Persistent chat sessions where each message carries a per-session monotonic sequence number, so deferred workers can process only new messages from a checkpoint.
- Provider abstraction throughout: the AI, retrieval, and storage layers are environment-driven and swappable — stub implementations for tests and local runs, real implementations (LLM provider, FAISS, S3) in production. The same code runs against LocalStack locally or AWS in the cloud.
Voice-to-insight pipeline
[User voice note (.m4a)]
| S3 upload -> uploads/
[Audio convert] .m4a -> .mp4 -> converted/
|
[Submit transcribe] -> AWS Transcribe -> transcripts/ (.json)
|
[Transcript processing + RAG]
- load transcript
- embed transcript
- load FAISS index from S3
- search for relevant passages
- compose prompt context (transcript + sources)
- call the LLM
|
[Response grounded in curated insight]
Deferred, inactivity-driven processing
Heavy analysis is decoupled from the request path. A scheduled sweeper finds journaling sessions that have gone inactive, enqueues jobs on SQS, and worker Lambdas process them. The same sweep, queue, and worker pattern powers two jobs — expression scoring and memory curation — each tracked by an independent per-entry checkpoint sequence so nothing is analyzed twice.
Expression profiling
Avina maintains a per-user expression profile across emotional category keys. It is rebuilt as a projection from scored message checkpoints, so the profile reflects the latest state without replaying an entire history.
Grounded chat & consent-gated memory
- Library grounding. A dedicated Library Service owns ingestion, indexing, and retrieval behind a stable search API, serving FAISS vector indexes stored in S3 per source. Source resolution prefers a user's eligible library sources first, then a default source, then an environment fallback.
- Consent-gated memory. A separate memory layer detects people and topics from the user's own messages using rule-based signals, then gates storage behind explicit consent (pending, then approved or declined, with a cooldown before re-asking). Only approved memories are injected into chat grounding, and they are condensed per subject into a rolling summary so retrieval never has to replay every historical mention.
Design notes
- Retrieval scoping matters more than model choice: grounding responses in curated, well-articulated material is what makes reflections feel trustworthy rather than generic.
- Deterministic contracts at the boundaries — a stable chat request/response shape and provider stubs — keep the system testable without a model or network.