The idea validator is a AI application for evaluating early-stage business or product ideas. The app takes a user submitted idea, runs it through a LangGraph/Ollama validation pipeline, and returns a structured business analysis including a refined value proposition, pros, cons, competitors, validation score, and execution difficulty score.
The project is built as a two-service local development app:
- Frontend: React, TypeScript, Vite, Tailwind CSS
- Backend: FastAPI, LangGraph, LangChain Ollama, SQLite
- LLM runtime: Ollama running locally
- Database: Local SQLite file for saved validation history
This README is written for a clean local setup from zero to running application.
- What the Application Does
- Architecture
- Project Structure
- Prerequisites
- Install and Configure Ollama
- Backend Setup
- Frontend Setup
- Run the Full Application Locally
- Environment Variables
- SQLite Validation History
- API Reference
- Development Workflow
- Troubleshooting
- Production/Deployment Notes
The Validation Engine helps a user reason about whether a business idea is worth pursuing.
The user enters an idea, for example:
A platform where users can review books from authors and swipe left or right on recommended books.
The backend sends the idea through an LLM-powered graph pipeline and returns:
- Refined value proposition
- Pros
- Cons
- Competitor context
- Validation score
- Difficulty score
- Reasoning for the score
Each completed validation is saved locally to SQLite so the frontend sidebar can show previous ideas.
+-------------------+ HTTP +------------------------+
| | /api/validate | |
| React + Vite UI | ----------------> | FastAPI Backend |
| | | |
| - Idea input | | - REST API |
| - Loading states | | - LangGraph workflow |
| - Saved history | | - SQLite persistence |
| | | |
+-------------------+ +-----------+------------+
|
| LangChain Ollama
v
+------------------------+
| Local Ollama Runtime |
| llama3.2:1b |
+------------------------+
The frontend calls the backend using relative API paths such as /api/validate. In local development, Vite should proxy these requests to the FastAPI backend, or the app can be served in an environment where both services are reachable under the same host.
The core AI workflow lives in:
Backend/app/graph.py
The backend compiles a LangGraph StateGraph named validation_app. FastAPI calls this graph from the /api/validate endpoint with the user's original idea as the initial state.
The graph is a sequential pipeline:
START
|
v
validate_idea_node
|
v
define_pros_node
|
v
define_cons_node
|
v
get_difficulty_score_node
|
v
define_competitors_list_node
|
v
get_validation_score_node
|
v
define_validation_score_reasoning_node
|
v
END
Each node receives the current ValidationEngineState, calls the local Ollama model through LangChain's ChatOllama, and returns a partial state update. LangGraph merges each node output into the shared state before moving to the next node.
The graph state contains:
| State Field | Purpose |
|---|---|
user_idea |
Original idea submitted by the user |
narrowed_down_idea |
More specific business concept generated by the first LLM node |
pros |
List-style output describing positive signals |
cons |
List-style output describing risks or weaknesses |
difficulty_score |
Execution difficulty score from 1 to 10 |
competitors_list |
Real companies competing in or near the market |
validation_score |
Overall idea strength score from 1 to 10 |
validation_score_reasoning |
Short explanation for the assigned validation score |
Node responsibilities:
| Node | Responsibility |
|---|---|
validate_idea_node |
Narrows the raw user idea into a clearer and more specific value proposition |
define_pros_node |
Generates exactly five concise pros for the refined idea |
define_cons_node |
Generates exactly five concise cons for the refined idea |
get_difficulty_score_node |
Scores execution difficulty using the idea, pros, and cons |
define_competitors_list_node |
Lists real competitors based on the original and refined idea |
get_validation_score_node |
Assigns the overall validation score using all previous graph context |
define_validation_score_reasoning_node |
Produces the final short explanation shown in the UI |
Once the graph finishes, Backend/app/main.py converts the final graph state into a ValidationResponse and saves it through Backend/app/storage.py into SQLite.
ValidationEngine/
├── Backend/
│ ├── app/
│ │ ├── config.py # Ollama base URL and model configuration
│ │ ├── graph.py # LangGraph validation pipeline
│ │ ├── main.py # FastAPI app and API routes
│ │ ├── schemas.py # Pydantic request/response models
│ │ └── storage.py # SQLite persistence helpers
│ ├── requirements.txt # Backend Python dependencies
│ └── validation_history.db # Local SQLite DB, created at runtime
│
├── Frontend/
│ ├── src/
│ │ ├── App.tsx # Main React application
│ │ └── styles.css # Tailwind and global styles
│ ├── package.json # Frontend scripts and dependencies
│ ├── tailwind.config.js
│ └── vite.config.ts
│
└── README.md
Install the following before running the app:
- macOS or another Unix-like development environment
- Python 3.10+ recommended
- Node.js 18+ recommended
- npm
- Ollama
- Git optional, but recommended
Check versions:
python3 --version
node --version
npm --versionThe backend uses Ollama as the local LLM runtime.
Download and install Ollama from:
https://ollama.com/download
On macOS, open the Ollama application after installation. Ollama normally runs a local server at:
http://127.0.0.1:11434
Run:
ollama listIf Ollama is running, this prints the models installed locally.
You can also verify the local API:
curl http://127.0.0.1:11434/api/tagsThe backend default model is:
llama3.2:1b
Install it with:
ollama pull llama3.2:1bThen verify:
ollama listYou should see something similar to:
NAME ID SIZE MODIFIED
llama3.2:1b ... ... ...
ollama run llama3.2:1bThen type a simple prompt. If the model responds, Ollama is working.
Open a terminal at the project root:
cd /path/to/ValidationEngineThen go into the backend folder:
cd Backendpython3 -m venv .venvOn macOS/Linux:
source .venv/bin/activateYour terminal should show that the virtual environment is active.
pip install -r requirements.txtFrom the Backend directory:
uvicorn app.main:api --reload --host 127.0.0.1 --port 8000The backend should now be running at:
http://127.0.0.1:8000
In a separate terminal:
curl http://127.0.0.1:8000/healthExpected successful response:
{
"status": "ok",
"model": "llama3.2:1b"
}If you see ollama_unreachable, make sure the Ollama app is open and running.
If you see model_missing, run:
ollama pull llama3.2:1bOpen a second terminal at the project root:
cd /path/to/ValidationEngineThen go into the frontend folder:
cd Frontendnpm installnpm run devThe frontend dev server runs Vite and should print a local URL similar to:
http://127.0.0.1:5173
Open that URL in your browser.
You need three things running or installed:
- Ollama app running
- Backend running on port 8000
- Frontend running with Vite
Usually on macOS, just open the Ollama app.
Verify:
ollama listcd Backend
source .venv/bin/activate
uvicorn app.main:api --reload --host 127.0.0.1 --port 8000cd Frontend
npm run devThen open:
http://127.0.0.1:5173
The backend supports these environment variables:
| Variable | Default | Description |
|---|---|---|
OLLAMA_BASE_URL |
http://127.0.0.1:11434 |
Base URL for local Ollama server |
OLLAMA_MODEL |
llama3.2:1b |
Ollama model used by the validation pipeline |
Example override:
OLLAMA_MODEL=llama3.2:1b uvicorn app.main:api --reload --host 127.0.0.1 --port 8000If you want to use a different installed model, first pull it:
ollama pull llama3.2Then run:
OLLAMA_MODEL=llama3.2 uvicorn app.main:api --reload --host 127.0.0.1 --port 8000The backend also attempts to resolve the configured model against installed Ollama models.
Saved validation runs are stored locally in SQLite.
The database file is created automatically at runtime:
Backend/validation_history.db
The saved history supports:
- Listing previous validations
- Loading one previous validation
- Deleting a previous validation
No external database server is required.
If you want to reset local history, stop the backend and remove the database file:
rm Backend/validation_history.dbThen restart the backend. A new database will be created automatically.
Base URL for local backend:
http://127.0.0.1:8000
GET /healthExample:
curl http://127.0.0.1:8000/healthSuccessful response:
{
"status": "ok",
"model": "llama3.2:1b"
}POST /api/validateRequest body:
{
"user_idea": "A marketplace for local fitness coaches to sell personalized training plans."
}Example:
curl -X POST http://127.0.0.1:8000/api/validate \
-H "Content-Type: application/json" \
-d '{"user_idea":"A marketplace for local fitness coaches to sell personalized training plans."}'Response shape:
{
"id": "...",
"title": "...",
"user_idea": "...",
"narrowed_down_idea": "...",
"pros": "...",
"cons": "...",
"difficulty_score": "...",
"competitors_list": "...",
"validation_score": "...",
"validation_score_reasoning": "...",
"created_at": "..."
}GET /api/validationsExample:
curl http://127.0.0.1:8000/api/validationsGET /api/validations/{validation_id}Example:
curl http://127.0.0.1:8000/api/validations/YOUR_VALIDATION_IDDELETE /api/validations/{validation_id}Example:
curl -X DELETE http://127.0.0.1:8000/api/validations/YOUR_VALIDATION_IDSuccessful deletion returns:
204 No Content
If the validation does not exist, the backend returns:
404 Not Found
Recommended local workflow:
- Start Ollama.
- Start the backend.
- Start the frontend.
- Open the frontend in the browser.
- Submit an idea.
- Watch the loading states while the LLM runs.
- Review generated output.
- Reload previous validations from the sidebar.
- Delete previous validations if needed.
From Backend:
source .venv/bin/activate
uvicorn app.main:api --reload --host 127.0.0.1 --port 8000Compile-check backend Python files:
python3 -m compileall appFrom Frontend:
npm run devBuild frontend:
npm run buildPreview production build locally:
npm run previewExample message:
Ollama is not reachable at http://127.0.0.1:11434
Fix:
- Open the Ollama app.
- Verify it is running:
curl http://127.0.0.1:11434/api/tags- Restart the backend.
Example message:
Model 'llama3.2:1b' is not installed.
Fix:
ollama pull llama3.2:1bThen restart the backend.
If deleting a saved idea returns:
Method Not Allowed
The backend process likely has not reloaded the latest DELETE /api/validations/{validation_id} route.
Fix:
- Stop the backend server.
- Start it again:
uvicorn app.main:api --reload --host 127.0.0.1 --port 8000- Try deleting again.
The frontend calls API paths like:
/api/validate
Make sure the backend is running on the expected local port and that the frontend dev setup is configured to reach it.
If needed, call the backend directly to confirm it works:
curl http://127.0.0.1:8000/healthIf code changes do not seem to apply:
- Stop the backend server.
- Restart it.
- Confirm the file you edited is under
Backend/app/.
Try:
- Refresh the browser.
- Stop and restart Vite.
- Clear browser cache if necessary.
This project is currently documented for local development only.
Before deploying, consider:
- Replacing local Ollama with a production-grade hosted model or GPU-backed inference service.
- Moving SQLite to a managed database if multiple users need persistent shared history.
- Restricting CORS instead of allowing all origins.
- Adding authentication if saved validations are user-specific.
- Adding request timeouts and background job handling for long LLM runs.
- Adding structured logging and monitoring.
- Adding automated tests for API routes and frontend behavior.
Deployment is intentionally out of scope for now.
Install Ollama model:
ollama pull llama3.2:1bRun backend:
cd Backend
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
uvicorn app.main:api --reload --host 127.0.0.1 --port 8000Run frontend in another terminal:
cd Frontend
npm install
npm run devOpen:
http://127.0.0.1:5173