Zing Forum

Reading

Friendship Points API: An LLM-Powered Relationship Tracking and Intelligent Prediction System

Explore an innovative backend project combining Fastify, PostgreSQL, and large language models (LLMs), demonstrating how LLMs can be applied to relationship event tracking, intelligent assessment, and predictive analysis.

LLMFastifyTypeScriptPostgreSQLRAGvector-searchagentic-workflowsocial-graphAI-native
Published 2026-06-11 18:46Recent activity 2026-06-11 18:51Estimated read 9 min
Friendship Points API: An LLM-Powered Relationship Tracking and Intelligent Prediction System
1

Section 01

Friendship Points API: An LLM-Powered Relationship Tracking and Intelligent Prediction System (Introduction)

Friendship Points API is an innovative backend project integrating Fastify, PostgreSQL, and large language models (LLMs). Its core is to implement intelligent relationship event tracking, evaluation, and predictive analysis. The project is maintained by smartinezai, with source code hosted on GitHub (link: https://github.com/smartinezai/friendship-points-api, update time: 2026-06-11T10:46:21Z). Key features include RAG (Retrieval-Augmented Generation), vector search, and agentic workflows, representing a new paradigm for AI-native applications.

2

Section 02

Project Background and Core Innovations

Project Background

Original author/maintainer: smartinezai Source platform: GitHub Original title: friendship-points-api Original link: https://github.com/smartinezai/friendship-points-api Update time: 2026-06-11T10:46:21Z

Core Innovations

This project deeply integrates traditional relationship management with modern AI technology. Instead of treating LLMs merely as a conversational interface, it transforms them into the core driver of business logic, endowing social relationship data with intelligent understanding and predictive analysis capabilities.

3

Section 03

Technical Architecture: Fastify, PostgreSQL, and AI Integration

Backend Framework: Fastify

Fastify was chosen as the web framework for its advantages:

  • High performance close to native Node.js
  • Built-in JSON Schema validation
  • Robust plugin ecosystem
  • Excellent TypeScript support

Data Layer: PostgreSQL

PostgreSQL ensures data integrity and complex query capabilities. Its JSONB type supports flexible storage of AI outputs, making it suitable for handling structured social data (user relationships, event records, point rules).

AI Capability Integration

LLMs play multiple roles in the system:

  1. Intelligent Assessment: Analyze the semantic content of relationship events to evaluate importance, emotional tendency, and impact on relationships;
  2. Predictive Analysis: Predict relationship trends and potential risks based on historical data, and recommend maintenance timing and methods;
  3. Structured Output: Use function calls and JSON Schema to ensure AI results can be reliably parsed by programs.
4

Section 04

Advanced Features: RAG and Vector Search

RAG Architecture Application

In relationship management scenarios, RAG can achieve:

  • Historical context retrieval: Automatically associate historical records when analyzing new events to ensure coherence;
  • Knowledge base enhancement: Combine external social psychology knowledge to provide professional advice;
  • Personalized memory: Maintain exclusive relationship memories for users to improve the relevance of suggestions.

Vector Search Value

Vector search technology supports:

  • Discovery of similar relationship patterns;
  • Semantic similarity matching (e.g., finding all high-quality deep communication events);
  • Fuzzy queries and natural language retrieval.
5

Section 05

Agentic Workflows: Proactive Assistants with Autonomous Decision-Making

Agentic Workflows are an important feature of the project, upgrading the system from passive recording to a proactive assistant:

  • Automated Reminders: Independently determine when to remind users to contact friends;
  • Dynamic Rule Adjustment: Automatically adjust point weights based on relationship status;
  • Anomaly Intervention: Identify early signs of relationship deterioration and proactively suggest repair measures.

This design reflects the autonomous decision-making capability of AI systems and enhances user value.

6

Section 06

Engineering Practices: Ensuring System Reliability

The project adopts good engineering practices to ensure reliability:

  • Automated Testing: Verify the predictability of LLM outputs and the handling of edge cases;
  • CI/CD Pipeline: Support rapid iteration and stable deployment;
  • Full-Stack TypeScript Usage: Reduce runtime errors and ensure type safety.

These practices are particularly important for AI component systems to ensure stable functionality.

7

Section 07

Application Scenarios and Business Models

This architecture can support multiple application scenarios:

  1. Social CRM: Provide intelligent relationship maintenance assistants for sales/community operators to track interaction quality and remind follow-ups;
  2. Personal Relationship Management: Help users record interaction history and analyze relationship health;
  3. Team Cohesion Tool: Track collaboration relationships among team members and identify communication bottlenecks;
  4. Customer Success Platform: Used by SaaS enterprises to track customer health, predict churn risks, and proactively intervene.
8

Section 08

Conclusion and Insights into Technical Trends

Insights into Technical Trends

This project represents four key trends in AI application development:

  1. LLMs as business logic engines;
  2. Structured AI outputs (function calls, JSON Schema) becoming critical for production-grade applications;
  3. RAG + vector databases becoming standard;
  4. Rise of agentic architectures (state memory, autonomous decision-making).

Conclusion

Friendship Points API demonstrates a new paradigm for AI-native applications—redesigning product architecture around AI capabilities to build intelligent systems that truly understand user data. For developers, it provides a reference implementation for integrating Fastify, PostgreSQL, and LLMs,预示着 more AI innovations to come.