October 27, 2025
3 min read
Cognia: Personal Memory Infrastructure
A decentralized memory layer that captures, indexes, and recalls your digital actions with complete local control and privacy.
AI MemoryVector Search

Cognia: Personal Memory Infrastructure
A decentralized memory layer that captures, indexes, and recalls your digital actions with complete local control and privacy.
Architecture
1. Browser Extension captures web content automatically
2. Each page becomes a Memory Object hashed, summarized, and vectorized using Google's text-embedding-004 model
3. Objects are stored in PostgreSQL with pgvector embeddings
4. Semantic search engine maps queries to content via cosine similarity
5. Any device or agent can request recall by wallet address
Memory Enforcement
Search System
Similarity Score Calculation
1. Cosine Similarity (Primary)
cosineSimilarity(vecA: number[], vecB: number[]): number {
let dotProduct = 0;
let normA = 0;
let normB = 0;
for (let i = 0; i < vecA.length; i++) {
dotProduct += vecA[i] * vecB[i];
normA += vecA[i] * vecA[i];
normB += vecB[i] * vecB[i];
}
return dotProduct / (Math.sqrt(normA) * Math.sqrt(normB));
}2. Domain-Aware Adjustments
3. Keyword Matching (Secondary)
// Token-based matching with word boundaries
for (const token of queryTokens) {
const tokenRegex = new RegExp(`\\b${token}\\b`, "gi");
if (tokenRegex.test(title)) keywordScore += 0.5; // Title weight
if (tokenRegex.test(summary)) keywordScore += 0.3; // Summary weight
if (tokenRegex.test(content)) keywordScore += 0.2; // Content weight
}
// Normalize by query token count
keywordScore = keywordScore / queryTokens.length;4. Final Hybrid Score
const hybridScore = semanticScore * 0.6 + keywordScore * 0.4;
const boostedScore = hybridScore * (1 + coverageRatio * 0.3);5. Topical Relations (Metadata-Based)
6. Temporal Relations (Time-Based)
What It Can Store
Requirements:
