Skip to content

JayeshWani7/Digital-Memory

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

7 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Digital Memory

A production-grade backend system that ingests data from Slack and GitHub, extracts structured knowledge using LLMs, stores embeddings in a vector database, and enables semantic querying.

๐ŸŽฏ What This Does

  • Ingest: Captures messages and events from Slack & GitHub
  • Process: Uses OpenAI LLM to extract summaries, decisions, and entities
  • Store: Saves embeddings in PostgreSQL (with PgVector extension)
  • Query: Provides semantic search via natural language

๐Ÿ“ Project Structure

digital-memory/
โ”œโ”€โ”€ SYSTEM_DESIGN.md           # Complete architecture & design
โ”œโ”€โ”€ .env.example               # Environment configuration template
โ”œโ”€โ”€ docker-compose.yml         # Local development environment
โ”‚
โ”œโ”€โ”€ backend/
โ”‚   โ”œโ”€โ”€ ingestion-service/     # Go service for data ingestion
โ”‚   โ”œโ”€โ”€ api-service/           # Go service for querying
โ”‚   โ””โ”€โ”€ ai-service/            # Python service for LLM processing
โ”‚
โ”œโ”€โ”€ database/
โ”‚   โ””โ”€โ”€ migrations/            # PostgreSQL migration scripts
โ”‚
โ”œโ”€โ”€ docs/
โ”‚   โ”œโ”€โ”€ SETUP.md              # Step-by-step setup guide
โ”‚   โ”œโ”€โ”€ API.md                # API documentation
โ”‚   โ””โ”€โ”€ EXAMPLES.md           # Example usage & queries
โ”‚
โ””โ”€โ”€ test_data/
    โ”œโ”€โ”€ sample_slack_messages.json
    โ”œโ”€โ”€ sample_github_events.json
    โ””โ”€โ”€ load_test_data.py

๐Ÿš€ Quick Start

Prerequisites

  • Docker & Docker Compose
  • Go 1.21+
  • Python 3.10+
  • PostgreSQL CLI (psql)
  • OpenAI API key

1. Clone & Setup

cd "Digital Memory"
cp .env.example .env
# Edit .env with your API keys and configuration

2. Start Infrastructure

docker-compose up -d

3. Run Database Migrations

# See docs/SETUP.md for detailed migration steps

4. Start Services

# Terminal 1: Ingestion Service
cd backend/ingestion-service
go run cmd/main.go

# Terminal 2: AI Service
cd backend/ai-service
python -m app.main

# Terminal 3: API Service
cd backend/api-service
go run cmd/main.go

5. Send Test Data

python test_data/load_test_data.py

6. Query

curl -X POST http://localhost:8000/api/v1/query \
  -H "Content-Type: application/json" \
  -d '{"query": "What database decisions were made?", "top_k": 5}'

๐Ÿ“š Documentation

๐Ÿ—๏ธ Architecture Overview

Three Microservices

  1. Go Ingestion Service (Port 8001)

    • Accepts Slack webhooks and GitHub events
    • Validates and stores raw data
    • Publishes to message queue
  2. Python AI Service (Port 8002)

    • Consumes events from queue
    • Calls OpenAI API for processing
    • Generates embeddings
    • Stores results in PostgreSQL + PgVector
  3. Go API Service (Port 8000)

    • Provides /query endpoint for semantic search
    • Converts queries to embeddings
    • Returns relevant results with metadata

Data Flow

Slack/GitHub Events
  โ†“
[Ingestion Service] โ†’ PostgreSQL + Redis Queue
  โ†“
[AI Service] โ†’ OpenAI API + Embedding Generation
  โ†“
PostgreSQL + PgVector
  โ†“
[API Service] โ† /query endpoint
  โ†“
Client Response

๐Ÿ”ง Tech Stack

Component Technology Why
Ingestion Go Fast, concurrent, minimal overhead
Queue Redis Streams Lightweight, MVP-friendly
Processing Python + FastAPI Rich LLM ecosystem
LLM OpenAI Reliable, high quality
Vector DB PostgreSQL + PgVector Simplified deployment, single DB
API Go High performance
Metadata DB PostgreSQL Proven, scalable

๐Ÿ“Š Data Models

Events Table

Raw incoming data from sources

Knowledge Table

Processed knowledge with:

  • Summary
  • Entities (services, people, APIs)
  • Decisions
  • Tags
  • Embeddings

๐Ÿ” Security

  • Webhook signature validation (Slack/GitHub)
  • JWT authentication for API
  • Rate limiting
  • Environment-based secrets
  • HTTPS ready

๐Ÿงช Testing

# Run all tests
./scripts/test.sh

# Test ingestion service
cd backend/ingestion-service && go test ./...

# Test API service
cd backend/api-service && go test ./...

# Test AI service
cd backend/ai-service && pytest tests/

๐Ÿ“ˆ Monitoring & Logging

All services include:

  • Structured logging (JSON format)
  • Health check endpoints
  • Metrics endpoints
  • Error tracking

๐Ÿš— Roadmap

Phase 1 (Current) โœ…

  • Slack & GitHub ingestion
  • LLM-based knowledge extraction
  • Vector embeddings + semantic search

Phase 2 ๐Ÿ”ฎ

  • Knowledge graph construction
  • Temporal reasoning
  • Entity relationship discovery
  • Causal analysis

Phase 3 ๐ŸŽฏ

  • Reasoning engine (LangChain agents)
  • Question-answering over knowledge
  • Integration recommendations

๐Ÿค Contributing

This is a production-ready system template. Feel free to:

  • Extend with new data sources
  • Add more processing services
  • Customize LLM prompts
  • Deploy to production infrastructure

๐Ÿ“ License

MIT

๐Ÿ“ž Support

For issues or questions about the implementation, refer to:

  1. SYSTEM_DESIGN.md for architecture questions
  2. docs/SETUP.md for setup issues
  3. docs/API.md for API questions
  4. Service logs for runtime issues

Status: Phase 1 Implementation in Progress

Last Updated: March 2026

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors