Skip to content

EmmanuelIdeho/datagen-agent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

datagen-agent 🛠️

A conversational CLI agent that generates realistic sample user data and saves it to JSON files. Built with LangChain and LangGraph.

Features

  • Natural language interface - just describe what you want
  • Generates realistic user data (names, emails, usernames, ages, registration dates)
  • Save generated data directly to JSON files
  • Model-agnostic: works with OpenAI, Anthropic, Gemini, Groq, Ollama, and more

Example Usage

You: Generate 5 users aged 20-30 and save them to users.json
You: Create 3 users with company.com email addresses
You: Make 10 users with last names Smith, Jones, and Williams

Setup

Prerequisites

  • Python 3.10+
  • uv package manager

Installation

  1. Clone the repo:

    git clone https://github.com/your-username/datagen-agent.git
    cd datagen-agent
  2. Install dependencies:

    uv sync
  3. Create a .env file in the project root and add your API key (see Configuration):

    GROQ_API_KEY=your-key-here
    
  4. Run the agent:

    uv run main.py

Configuration

The agent is model-agnostic. By default it uses Groq (free tier available), but you can swap to any supported provider.

Groq (default — free tier)

from langchain_groq import ChatGroq
llm = ChatGroq(model="llama-3.3-70b-versatile", temperature=0)

Get a free API key at console.groq.com.

Ollama (local — no API key needed)

from langchain_ollama import ChatOllama
llm = ChatOllama(model="llama3.2", temperature=0)

Install Ollama from ollama.com, then run ollama pull llama3.2.

OpenAI

from langchain_openai import ChatOpenAI
llm = ChatOpenAI(model="gpt-4o", temperature=0)
OPENAI_API_KEY=your-key-here

Anthropic

from langchain_anthropic import ChatAnthropic
llm = ChatAnthropic(model="claude-sonnet-4-20250514", temperature=0)
ANTHROPIC_API_KEY=your-key-here

Google Gemini

from langchain_google_genai import ChatGoogleGenerativeAI
llm = ChatGoogleGenerativeAI(model="gemini-2.0-flash", temperature=0)
GOOGLE_API_KEY=your-key-here

Available Tools

Tool Description
generate_sample_users Generates user objects with id, name, email, username, age, and registration date
write_json Writes a dictionary to a JSON file
read_json Reads and returns the contents of a JSON file

Project Structure

datagen-agent/
├── main.py          # Agent definition, tools, and CLI loop
├── pyproject.toml   # Dependencies managed by uv
├── .env             # API keys (not committed)
└── .gitignore

Commands

Command Description
uv run main.py Start the agent
uv sync Install/reinstall all dependencies
uv add <package> Add a new dependency
uv remove <package> Remove a dependency
quit / exit Exit the agent

License

MIT

About

A conversational CLI agent that generates realistic sample user data and saves it to JSON files. Built with LangChain and LangGraph.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages