Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

88 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

GenAlima - Enterprise AI Search Platform

πŸ€– Build Your Enterprise AI Search Agent in Minutes

Unify your scattered business knowledge into a single, intelligent interface

🌟 Overview

GenAlima is an enterprise-grade AI search platform that enables businesses to create intelligent AI agents capable of searching and answering questions from all their business data sources. Built with cutting-edge AI technologies and a modern tech stack, GenAlima transforms how organizations access and utilize their knowledge.

✨ Key Features

πŸ” Intelligent Search & Retrieval

  • Vector Search: Semantic search across all your documents using pgvector
  • RAG (Retrieval Augmented Generation): Combines search results with LLM responses for accurate answers
  • Multi-format Support: Process PDFs, Word documents, text files, and more
  • Real-time Streaming: Get AI responses as they're generated

πŸ”Œ Data Source Connectors

  • Google Workspace: Gmail integration with OAuth2
  • Azure DevOps: Project management and collaboration
  • Notion: Workspace and documentation (coming soon)
  • Custom APIs: Flexible connector architecture for any data source

πŸ€– Advanced AI Capabilities

  • Multiple LLM Support: OpenAI, Google Gemini, Anthropic Claude
  • LangGraph Agent: Sophisticated multi-step reasoning and tool chaining
  • Context-Aware Responses: Maintains conversation history and context
  • Dynamic Tool Selection: Automatically chooses the right tools for each query

πŸ” Enterprise Security

  • JWT Authentication: Secure token-based authentication
  • Role-Based Access Control: Manage user permissions
  • Encrypted Credentials: Secure storage of API keys and tokens
  • Read-Only Data Access: Ensures data integrity

πŸ’¬ Chat & Collaboration

  • Template-Based Chats: Pre-configured templates for common use cases
  • Persistent History: Save and retrieve conversation history
  • Markdown Support: Rich text formatting in messages
  • Session Management: Maintain state across conversations

πŸš€ Quick Start

Prerequisites

  • Python 3.11+
  • Node.js 18+
  • PostgreSQL 14+ with pgvector extension
  • OpenAI API key (or other LLM provider keys)

Installation

  1. Clone the repository

    git clone https://github.com/yourusername/GenAlima.git
    cd GenAlima
  2. Set up the backend

    # Create virtual environment
    python -m venv venv
    source venv/bin/activate  # On Windows: venv\Scripts\activate
    
    # Install dependencies
    pip install -r requirements.txt
    
    # Set up environment variables
    cp .example.env .env
    # Edit .env with your configuration
  3. Set up the database

    # Create PostgreSQL database with pgvector
    createdb alima
    psql -d alima -c "CREATE EXTENSION vector;"
    
    # Run migrations
    alembic upgrade head
  4. Set up the frontend

    cd frontend
    npm install
  5. Configure environment variables

    Edit .env file with your settings:

    # Database
    POSTGRES_SERVER=localhost
    POSTGRES_PORT=5432
    POSTGRES_DB=alima
    POSTGRES_USER=postgres
    POSTGRES_PASSWORD=your_password
    
    # OpenAI (or other LLM provider)
    OPENAI_API_KEY=your_openai_api_key
    
    # Frontend
    FRONTEND_HOST=http://localhost:5173
    BACKEND_CORS_ORIGINS=http://localhost:5173
    
    # Google OAuth (for Gmail integration)
    GOOGLE_CLIENT_ID=your_client_id
    GOOGLE_CLIENT_SECRET=your_client_secret

Running the Application

  1. Start the backend server

    # From project root
    python main.py
    # Server runs on http://localhost:8000
  2. Start the frontend development server

    # From frontend directory
    npm run dev
    # Frontend runs on http://localhost:5173
  3. Access the application Open your browser and navigate to http://localhost:5173

πŸ—οΈ Project Structure

GenAlima/
β”œβ”€β”€ app/                    # Backend FastAPI application
β”‚   β”œβ”€β”€ api/               # API routes and endpoints
β”‚   β”‚   β”œβ”€β”€ routes/        # Route definitions
β”‚   β”‚   └── deps.py        # Dependencies
β”‚   β”œβ”€β”€ core/              # Core configuration
β”‚   β”‚   β”œβ”€β”€ config.py      # Settings management
β”‚   β”‚   └── security.py    # Authentication
β”‚   β”œβ”€β”€ models.py          # Database models
β”‚   β”œβ”€β”€ schemas.py         # Pydantic schemas
β”‚   └── alembic/           # Database migrations
β”œβ”€β”€ frontend/              # React TypeScript frontend
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ components/    # Reusable UI components
β”‚   β”‚   β”œβ”€β”€ routes/        # Page components
β”‚   β”‚   β”œβ”€β”€ hooks/         # Custom React hooks
β”‚   β”‚   └── client/        # API client
β”‚   └── package.json       # Frontend dependencies
β”œβ”€β”€ graphs/                # LangGraph AI agent
β”‚   β”œβ”€β”€ tools/            # AI tool implementations
β”‚   β”œβ”€β”€ prompts/          # System prompts
β”‚   └── main.py           # Agent orchestration
β”œβ”€β”€ connectors/           # External service integrations
β”œβ”€β”€ gen_model/            # LLM utilities
└── requirements.txt      # Python dependencies

πŸ”§ Configuration

Database Setup

GenAlima uses PostgreSQL with the pgvector extension for vector similarity search:

-- Enable pgvector extension
CREATE EXTENSION IF NOT EXISTS vector;

-- The application will create necessary tables via Alembic migrations

LLM Configuration

Configure your preferred LLM provider in .env:

# OpenAI
OPENAI_API_KEY=sk-...
OPENAI_MODEL=gpt-4-turbo-preview

# Google Gemini
GOOGLE_API_KEY=...
GOOGLE_MODEL=gemini-pro

# Anthropic Claude
ANTHROPIC_API_KEY=...
ANTHROPIC_MODEL=claude-3-opus

🐳 Docker Deployment

Build and run with Docker:

# Build the image
docker build -t genalima .

# Run the container
docker run -p 8080:8080 \
  -e POSTGRES_SERVER=host.docker.internal \
  -e OPENAI_API_KEY=your_key \
  genalima

πŸ“š API Documentation

Once the backend is running, access the interactive API documentation:

  • Swagger UI: http://localhost:8000/docs
  • ReDoc: http://localhost:8000/redoc

Key Endpoints

  • POST /api/v1/login/access-token - User authentication
  • GET /api/v1/users/me - Get current user
  • POST /api/v1/chats/ - Create new chat
  • POST /api/v1/messages/ - Send message
  • POST /api/v1/knowledge/upload - Upload documents
  • GET /api/v1/knowledge/search - Search knowledge base

πŸ§ͺ Development

Code Quality Tools

# Format code
black .
isort .

# Lint code
pylint app/
ruff check .

# Type checking
mypy app/

Testing

# Run backend tests
pytest

# Run frontend tests
cd frontend && npm test

Database Migrations

# Create new migration
alembic revision --autogenerate -m "Description"

# Apply migrations
alembic upgrade head

# Rollback
alembic downgrade -1

🀝 Contributing

We welcome contributions! Please see our Contributing Guidelines for details.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

πŸ“ˆ Roadmap

Current Development

  • File upload and vector search
  • Gmail integration
  • Notion integration
  • GitHub integration
  • LangGraph agent implementation
  • Template-based chats with pre-defined templates and workflows
    • Draft letter to send to court
    • Create task list from meeting notes in given format
  • Database connector (Text-to-SQL)
  • API data source configuration
  • MCP (Model Context Protocol) integration
  • n8n workflow integration
  • Advanced analytics dashboard
  • Team collaboration features
  • Desktop application for meeting notes and real-time help from Internal Knowledge Base and Internet

Future Plans

  • Multi-tenant architecture
  • Advanced permission system
  • Real-time collaboration
  • Mobile applications
  • Self-hosted enterprise edition

πŸ›‘οΈ Security

  • All credentials are encrypted at rest
  • CORS protection enabled
  • SQL injection prevention via SQLModel ORM
  • Rate limiting on API endpoints
  • Regular security audits

πŸ“„ License

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

πŸ™ Acknowledgments

πŸ“ž Support


Built with ❀️ by the GenAlima Team

⭐ Star us on GitHub!

About

Build your AI agent in few clicks

Resources

Stars

13 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages