Skip to content

Golang RAG chatbot for university admissions. Built with LangChain, pgvector, Neo4j & Gemini AI. Features semantic search, knowledge graphs, async processing & hexagonal architecture. Demonstrates high-performance AI in Go as alternative to Python RAG systems.

License

Notifications You must be signed in to change notification settings

bienwithcode/AdmissionAgent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

69 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸŽ“ AdmissionAgent

AI-Powered University Admission Assistant with RAG Technology

Helping students discover their perfect university match through intelligent conversation

License: MIT Go Version Vue Version Neo4j PostgreSQL Redis Docker

Features β€’ Quick Start β€’ Architecture β€’ Tech Stack β€’ Contributing


πŸ“– Overview

AdmissionAgent is a production-ready RAG (Retrieval-Augmented Generation) chatbot built with Golang that helps students navigate university admissions. Unlike typical Python-based RAG systems, this project demonstrates high-performance AI applications in Go, leveraging LangChain Go, pgvector, and Neo4j for intelligent document retrieval and conversational AI.


Admission Agent Interface

πŸš€ Built with Golang for Performance

While most RAG systems are built with Python, AdmissionAgent showcases Go's capabilities for AI/ML applications:

  • ⚑ High concurrency - Handle thousands of concurrent chat sessions
  • πŸ”₯ Low latency - Sub-second response times with efficient vector search
  • πŸ“¦ Single binary deployment - No dependency hell, just compile and run
  • πŸ›‘οΈ Type safety - Catch errors at compile time, not runtime
  • πŸ—οΈ Clean architecture - Hexagonal design with clear separation of concerns

Why AdmissionAgent?

  • 🎯 Personalized Recommendations - Get university suggestions tailored to your profile
  • πŸ’¬ Natural Conversations - Chat naturally about your admission concerns
  • πŸ“š Knowledge-Backed Answers - Responses grounded in real university data
  • πŸ” Smart Search - Vector-based semantic search across university documents
  • πŸš€ Real-time Processing - Instant responses with async document processing

✨ Features

Core Capabilities

  • πŸ€– AI-Powered Chat Interface - Natural language conversations with context awareness
  • πŸ“„ Document Processing - Automatic PDF parsing, chunking, and embedding
  • πŸ”Ž Semantic Search - Vector similarity search using pgvector (3072-dim embeddings)
  • πŸ‘€ User Authentication - Secure JWT-based authentication system
  • πŸ’Ύ Conversation History - Persistent chat sessions with Redis caching
  • πŸ“Š Knowledge Graph - Neo4j-powered relationship mapping between universities
  • ⚑ Async Processing - Background workers for document indexing via Redis Streams

Technical Features

  • πŸ—οΈ Hexagonal Architecture - Clean separation of concerns with ports & adapters
  • πŸ”„ RESTful API - Well-structured backend API with Gin framework
  • 🎨 Modern Frontend - Responsive Vue 3 interface with Vite
  • 🐳 Containerized - Full Docker Compose setup for easy deployment
  • πŸ“ˆ Scalable - Microservices-ready architecture with worker pools

πŸ› οΈ Tech Stack

Backend

Technology Purpose Version
Go Backend language 1.24.6
Gin HTTP web framework 1.11.0
PostgreSQL Primary database 17
pgvector Vector similarity search Latest
Redis Caching & message broker 7.0
Neo4j Graph database 5.26.0
MinIO Object storage (S3-compatible) Latest

AI & ML

Technology Purpose
LangChain Go LLM orchestration framework
Gemini AI Embedding model (gemini-embedding-001)
Vector Embeddings 3072-dimensional semantic search

Frontend

Technology Purpose Version
Vue 3 Frontend framework 3.5.24
Vite Build tool & dev server 7.2.4
Vue Router Client-side routing 4.6.4
Axios HTTP client 1.13.2

Infrastructure

  • Docker & Docker Compose - Containerization and orchestration
  • Air - Live reload for Go development
  • golang-migrate - Database migration management

πŸ—οΈ Architecture

High-Level System Design

graph TB
    subgraph "Client Layer"
        UI[Vue 3 Frontend]
    end
    
    subgraph "API Layer"
        API[Gin REST API]
        Auth[JWT Authentication]
    end
    
    subgraph "Application Layer"
        Chat[Chat Service]
        RAG[RAG Pipeline]
        Upload[Document Upload]
    end
    
    subgraph "AI Services"
        Embed[Embedding Service<br/>Gemini AI]
        LLM[LLM Service<br/>LangChain]
    end
    
    subgraph "Data Layer"
        PG[(PostgreSQL<br/>+ pgvector)]
        Redis[(Redis<br/>Cache & Queue)]
        Neo4j[(Neo4j<br/>Knowledge Graph)]
        MinIO[(MinIO<br/>Object Storage)]
    end
    
    subgraph "Background Processing"
        Worker[Document Worker]
        Indexer[Vector Indexer]
    end
    
    UI --> API
    API --> Auth
    API --> Chat
    API --> Upload
    
    Chat --> RAG
    Chat --> Redis
    
    RAG --> Embed
    RAG --> LLM
    RAG --> PG
    
    Upload --> MinIO
    MinIO --> Worker
    Worker --> Indexer
    Indexer --> Embed
    Indexer --> PG
    Indexer --> Neo4j
    
    style UI fill:#4FC08D
    style API fill:#00ADD8
    style RAG fill:#FF6B6B
    style PG fill:#336791
    style Redis fill:#DC382D
    style Neo4j fill:#008CC1
Loading

RAG Pipeline Flow

sequenceDiagram
    participant User
    participant Frontend
    participant API
    participant RAG
    participant Vector DB
    participant LLM
    
    User->>Frontend: Ask question
    Frontend->>API: POST /chat/message
    API->>RAG: Process query
    RAG->>Vector DB: Semantic search
    Vector DB-->>RAG: Relevant documents
    RAG->>LLM: Generate response with context
    LLM-->>RAG: AI-generated answer
    RAG-->>API: Response
    API-->>Frontend: JSON response
    Frontend-->>User: Display answer
Loading

Document Processing Pipeline

graph LR
    A[Upload PDF] --> B[MinIO Storage]
    B --> C[Redis Stream Event]
    C --> D[Worker Picks Up]
    D --> E[Extract Text]
    E --> F[Chunk Text]
    F --> G[Generate Embeddings]
    G --> H[Store in pgvector]
    G --> I[Build Knowledge Graph]
    I --> J[Neo4j]
    
    style A fill:#4FC08D
    style B fill:#C72E49
    style D fill:#00ADD8
    style H fill:#336791
    style J fill:#008CC1
Loading

πŸš€ Quick Start

Prerequisites

Before you begin, ensure you have the following installed:

  • Docker (v20.10+) and Docker Compose (v2.0+)
  • Git for cloning the repository
  • Gemini API Key (get it from Google AI Studio)

Installation Steps

  1. Clone the repository
git clone http://github.com/bienwithcode/AdmissionAgent.git
cd AdmissionAgent
  1. Configure environment variables
# Copy the example environment file
cp .env.example .env

# Edit .env and add your Gemini API key
# Required variables:
# - GEMINI_API_KEY=your_api_key_here
# - MINIO_ROOT_USER=minioadmin
# - MINIO_ROOT_PASSWORD=minioadmin
# - S3_BUCKET=documents
  1. Start the application
# Start all services (backend, frontend, databases, workers)
docker-compose up -d

# Check if all services are running
docker-compose ps
  1. Access the application
  1. Initialize the database
# Run database migrations
docker-compose exec backend /scripts/migrate.sh up

Verify Installation

# Check backend health
curl http://localhost:8080/health

# Check if worker is processing
docker-compose logs -f worker

First Steps

  1. Register an account at http://localhost:8081/register
  2. Login with your credentials
  3. Upload a university document (PDF format)
  4. Start chatting about university admissions!

πŸ“ Project Structure

AdmissionAgent/
β”œβ”€β”€ cmd/                    # Application entry points
β”‚   β”œβ”€β”€ api/               # REST API server
β”‚   └── worker/            # Background worker
β”œβ”€β”€ internal/              # Private application code
β”‚   β”œβ”€β”€ adapters/         # External adapters (DB, APIs)
β”‚   β”œβ”€β”€ core/             # Business logic & domain models
β”‚   β”œβ”€β”€ ports/            # Interface definitions
β”‚   └── services/         # Application services
β”œβ”€β”€ pkg/                   # Public libraries
β”œβ”€β”€ ui/                    # Vue 3 frontend
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ components/   # Vue components
β”‚   β”‚   β”œβ”€β”€ views/        # Page views
β”‚   β”‚   └── router/       # Vue Router config
β”‚   └── public/           # Static assets
β”œβ”€β”€ scripts/               # Utility scripts
β”œβ”€β”€ docker-compose.yml     # Docker orchestration
β”œβ”€β”€ .env.example          # Environment template
β”œβ”€β”€ AGENTS.md             # AI agent guidelines
└── README.md             # This file

πŸ”§ Development

Running Locally (Without Docker)

Backend:

# Install dependencies
go mod download

# Run with hot reload
air

# Or run directly
go run cmd/api/main.go

Frontend:

cd ui
npm install
npm run dev

Running Tests

# Run all tests
go test ./...

# Run with coverage
go test -cover ./...

# Run specific package tests
go test ./internal/core/...

Database Migrations

# Create a new migration
migrate create -ext sql -dir migrations -seq create_users_table

# Run migrations
docker-compose exec backend /scripts/migrate.sh up

# Rollback migrations
docker-compose exec backend /scripts/migrate.sh down 1

Code Quality

# Format code
go fmt ./...

# Run linter
golangci-lint run

# Vet code
go vet ./...

🀝 Contributing

We welcome contributions from the community! Here's how you can help:

Contribution Workflow

  1. Read the guidelines

    • Check AGENTS.md for development guidelines and best practices
  2. Fork the repository

    git clone http://github.com/YOUR_USERNAME/AdmissionAgent.git
  3. Create a feature branch

    git checkout -b feature/your-feature-name
  4. Make your changes

    • Follow the existing code style
    • Write tests for new features
    • Update documentation as needed
  5. Commit your changes

    git commit -m "feat: add amazing feature"

    Follow Conventional Commits:

    • feat: - New features
    • fix: - Bug fixes
    • docs: - Documentation changes
    • refactor: - Code refactoring
    • test: - Test additions/changes
  6. Push and create a Pull Request

    git push origin feature/your-feature-name

Development Guidelines

  • Architecture: Follow hexagonal architecture principles
  • Testing: Maintain test coverage above 70%
  • Documentation: Update documentation for new features
  • Code Style: Use gofmt and follow Go best practices
  • Commits: Write clear, descriptive commit messages

Areas for Contribution

  • πŸ› Bug Fixes - Check the Issues page
  • ✨ New Features - Propose features via GitHub Discussions
  • πŸ“š Documentation - Improve README, add tutorials, write guides
  • πŸ§ͺ Testing - Increase test coverage
  • 🎨 UI/UX - Enhance the frontend interface
  • 🌐 Internationalization - Add multi-language support

πŸ“œ License

This project is licensed under the MIT License - see the LICENSE file for details.


πŸ™ Acknowledgments

  • LangChain - For the excellent LLM orchestration framework
  • Google Gemini - For powerful embedding models
  • pgvector - For efficient vector similarity search
  • Neo4j - For graph database capabilities
  • Vue.js Team - For the amazing frontend framework

πŸ“ž Contact & Support


⭐ Star this repository if you find it helpful!

Made with ❀️ by bienwithcode

About

Golang RAG chatbot for university admissions. Built with LangChain, pgvector, Neo4j & Gemini AI. Features semantic search, knowledge graphs, async processing & hexagonal architecture. Demonstrates high-performance AI in Go as alternative to Python RAG systems.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors