Cognitive Frameworks &
Dynamic RAG Architecture
A scientific whitepaper exploring how Baagupadu Technologies unifies developmental psychology, multi-agent cognitive orchestration, and vector retrieval to create an autonomous, empathetic companion that eliminates hallucinations and delivers grounded life roadmaps.
Why Dynamic RAG Wins Over Static Fine-Tuning
In consumer AI, many teams attempt to fine-tune generative models directly on counseling conversations. At Baagupadu, we deliberately rejected this paradigm for three critical architectural reasons:
- Zero Latency Data & Curriculum Ingestion:
Fine-tuned weights are static snapshots. When an Indian university alters its syllabus or an emerging tech role surges in demand, fine-tuned models require weeks of costly retraining. Dynamic RAG updates knowledge within milliseconds via pgvector ingestion.
- Elimination of Hallucinations in Life Guidance:
Career counseling cannot afford generative fabrications. By binding responses strictly to verified psychological frameworks (Open Knowledge Format in
gems/nenu_evaru/), hallucination rates drop to near zero. - Complete Student Data Privacy:
Personal student memories and reflections reside in isolated PostgreSQL user memory vaults, never baked permanently into shared neural network weights.
RRF_Score(d) = ∑ ( 1 / ( 60 + Rank_dense(d) ) ) + ( 1 / ( 60 + Rank_sparse(d) ) )
We fuse dense semantic vectors (nomic-embed-text-v1.5 768-dimensional embeddings) with sparse keyword retrieval (to_tsvector in PostgreSQL). Only the Top-4 highest-scoring memories are injected into active inference, eliminating prompt bloat and saving over 70% in token overhead.
LangGraph Cognitive Finite State Machine
Rather than relying on a single monolithic prompt, Sahayam decomposes conversational cognition across an asynchronous LangGraph multi-agent pipeline.
Guardrail Agent
Input Sanitization & Penetration ShieldRuns pre-execution adversarial testing to intercept prompt injection attempts, DAN exploits, and sanitizes Indian PII (phone, Aadhaar, PAN) via regex filters.
Planner Agent
Deterministic Strategy GenerationIngests user reflections and matches against Open Knowledge Format (OKF) psychological frameworks in gems/nenu_evaru/ to produce structured strategy plans.
Executor Agent
Empathetic & Socratic SynthesisGenerates the companion dialogue following a strict cognitive triad formula: Empathetic Validation + Psychological Insight + Open Provocative Question.
Evaluator Agent
Non-Blocking Quality ScorerExecutes async background evaluations computing ROUGE-L (factual grounding against retrieved knowledge) and Distinct-2 (lexical diversity to avoid repetitive loops).
Extractor Agent
Life-Stage Profile State TrackingContinuously extracts student markers, academic streams, emotional states, and milestones into a persistent PostgreSQL ProfileState entity.
The 5-Phase Psychological Discovery Framework
Grounding our inquiries in Bandura's Self-Efficacy Theory, Erikson's Psychosocial Stages, and Super's Life-Span Career Model.
Psychological Safety & Trust Building
Before probing deep childhood memories or career anxieties, Sahayam builds rapport through active listening and unconditional positive regard, creating an unshakeable container of trust.
Childhood (0-12) Blueprint
Explores early play preferences, natural obsessions, and family expectations to identify intrinsic motivation patterns formed prior to standardized academic conditioning.
Teenage (13-19) Identity Crossroads
Analyzes how the student navigated board exams, competitive entrance environments, and parental conflicts, extracting resilience markers and core personal values.
Adult (20-30) Ambitions & Market Reality
Maps current college experiences, self-taught skills, and pragmatic career aspirations against real-world Indian and global technology market trajectories.
Persona Synthesis & Actionable Compass
Synthesizes multi-turn dialogue patterns into a coherent personal compass, establishing clear micro-milestones to bridge the gap between where the student is and where they want to go.
Automated NLP Evaluation Benchmarks
To guarantee that responses remain both factually grounded and emotionally distinct across extended sessions, our background Evaluator Agent computes two real-time metrics per conversation turn:
ROUGE-L Knowledge Grounding
Measures longest common subsequence overlap between the companion's response and retrieved Open Knowledge Format rules to ensure guidance is anchored in vetted psychology rather than ungrounded intuition.
Distinct-2 Lexical Diversity
Calculates the ratio of unique bi-grams to total bi-grams. If Distinct-2 falls below 0.65, the system flags robotic repetition and dynamically adjusts the generation temperature.
Academic Collaboration & Whitepaper Inquiries
Universities, AI labs, and developmental psychology researchers interested in citing our Dynamic RAG findings or partnering on youth self-discovery studies can reach out directly to the research office.