Skip to content

ravendb/samples-hr

Repository files navigation

Human Resources Assistant

Build

Overview

A sample application providing a human resources assistant chatbot. It leverages RavenDB database and RavenDB AI.

Live Demo

A live hosted version of this application can be found here:

https://hr.samples.ravendb.net

Please bear in mind, this application, for sake of simplicity of the deployment, is deployed in XYZ region. This can impact the latency you perceive. (remove if not applicable).

We do clean the environment from time to time.

Features used

The following RavenDB features are used to build the application:

  1. AI Agents - RavenDB's built-in AI agent framework powers the HR chatbot with tool calling and conversation management
  2. Time Series - tracking API usage per session and globally for rate limiting visualization
  3. Vector Search - semantic search for HR policies, issues, and documents using vector.search(embedding.text(...))
  4. Attachments - storing employee signature images on documents
  5. Counters - tracking total prompt and completion tokens used
  6. Document Expiration - automatic cleanup of expired sessions and conversations

Technologies

The following technologies were used to build this application:

  1. RavenDB 7.1 - document database with AI integration
  2. .NET Aspire - cloud-ready stack for distributed applications
  3. .NET 10 / ASP.NET Core 10
  4. Node.js 22 / React 18
  5. SignalR - real-time API usage broadcasting

Architecture

The application consists of:

  • Backend (ASP.NET Core) - REST API with rate limiting middleware, SignalR hub for real-time updates
  • Frontend (React) - chat interface with real-time API usage visualization
  • RavenDB - proivdes AI agents natively, stores employees, policies, documents, conversations, and usage metrics via time series and counters

Rate limiting is implemented at two levels:

  • Session-based - limits requests per user session (30-second window)
  • Global - limits total requests across all users (15-minute window)

Run locally

If you want to run the application locally, please follow the steps:

  1. Check out the GIT repository
  2. Install prerequisites:
    1. .NET 10.x
    2. Node.js 22.x
  3. Set required environment variables:
    # Required
    SAMPLES_HR_OPENAI_API_KEY=<your-openai-api-key>
    
    # Required - developer or enterprise license
    SAMPLES_HR_RAVEN_LICENSE=<your-ravendb-license> 
    
    # Optional (rate limiting - defaults provided)
    SAMPLES_HR_MAX_GLOBAL_REQUESTS_PER_15_MINUTES=100
    SAMPLES_HR_MAX_SESSION_REQUESTS_PER_30_SECONDS=5
  4. Run the .NET Aspire AppHost:
    aspire run
  5. Open the Aspire dashboard and click "Seed data" to populate the database with sample employees, policies, and documents

Community & Support

If you spot a bug, have an idea or a question, please let us know by rasing an issue or creating a pull request.

We do use a Discord server. If you have any doubts, don't hesistate to reach out!

Contributing

We encourage you to contribute! Please read our CONTRIBUTING for details on our code of conduct and the process for submitting pull requests.

License

This project is licensed with the MIT license.

About

No description, website, or topics provided.

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published