The Swarm Intelligence Engine is a high-fidelity sociological simulation tool designed to model public opinion and societal reactions in Georgia. By leveraging custom-crafted, culturally authentic AI personas and Google's Gemini models, it simulates how different demographic cohorts react to political news, policy updates, or social events.
This is a local, self-hostable version with no payment restrictions or web3 dependencies. You only need to provide your own Google Gemini API key to run simulations and generate personas.
- Swarm Simulation: Select from a diverse library of pre-seeded Georgian personas (representing different ages, locations, employment statuses, and political views) and see their realistic reactions.
- Semantic & Strategic Analysis: Generate an advanced strategic intelligence report detailing narrative clusters, demographic intersections, and sentiment analyses of the swarm's reactions.
- Persona Generator: Describe a cohort of people (e.g., "Tech students in Kutaisi" or "Pensioners in Kakheti") and generate highly customized, culturally authentic personas dynamically to expand your library.
- Local-First & Secure: Built using SvelteKit, Drizzle ORM, and SQLite. Your Gemini API key is stored locally in your browser cookies (or your server
.envfile) and sent directly to Google's API endpoints.
You will need Bun installed on your machine.
Clone the repository and install the dependencies:
# Clone the repository
git clone https://github.com/your-username/SWARM.git
cd SWARM
# Install dependencies using Bun
bun installThe repository comes pre-packaged with a pre-seeded sqlite.db file in the root directory, which contains a rich set of initial Georgian personas.
If you ever need to recreate or reset the database schema, you can run Drizzle migrations:
bun x drizzle-kit pushYou can configure your API key in one of two ways:
- Start the application (see below).
- Click the Settings (gear) icon in the top-right corner of the header.
- Paste your Gemini API Key (
AIzaSy...) and click Save Changes. - The key is securely saved in a browser cookie (
gemini_api_key) and used for SvelteKit server-side API calls.
- Copy
.env.exampleto.env:cp .env.example .env
- Open
.envand paste your API key:GEMINI_API_KEY="your-gemini-api-key-here"
To run the engine in development mode:
bun run devOpen your browser and navigate to http://localhost:5173.
To create a production-optimized build:
bun run buildPreview the production build locally:
bun run preview- Framework: SvelteKit (Svelte 5)
- Styling: Vanilla CSS with Tailwind CSS v4
- Database: SQLite with Drizzle ORM
- LLM Integration: Google GenAI SDK (
@google/genai) using Gemini 3.1 models - Icons: Lucide Svelte
This project is open-source and free to use. Set up your API key, run it locally, and start exploring collective intelligence simulations!