{"id":22289109,"url":"https://github.com/fmpwizard/go-cortex","last_synced_at":"2025-07-28T22:33:02.116Z","repository":{"id":16004309,"uuid":"18747674","full_name":"fmpwizard/go-cortex","owner":"fmpwizard","description":"Adding intelligence to your world https://blog.fmpwizard.com","archived":false,"fork":false,"pushed_at":"2019-07-12T05:10:54.000Z","size":41,"stargazers_count":53,"open_issues_count":1,"forks_count":5,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-06-20T02:03:15.356Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fmpwizard.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-04-14T03:52:57.000Z","updated_at":"2023-09-25T21:29:23.000Z","dependencies_parsed_at":"2022-09-14T11:51:00.074Z","dependency_job_id":null,"html_url":"https://github.com/fmpwizard/go-cortex","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fmpwizard%2Fgo-cortex","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fmpwizard%2Fgo-cortex/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fmpwizard%2Fgo-cortex/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fmpwizard%2Fgo-cortex/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fmpwizard","download_url":"https://codeload.github.com/fmpwizard/go-cortex/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227962306,"owners_count":17847912,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-03T17:08:19.520Z","updated_at":"2024-12-03T17:08:20.209Z","avatar_url":"https://github.com/fmpwizard.png","language":"Go","readme":"# Go Cortex\n\n`go-cortex` is a service that listens for sentences and tries to understand what you meant and goes off\nto do what you asked for.\n\nIn the background it uses [Wit.ai](https://wit.ai/) to process the text and get back an `intent` with some parameters extracted from the sentence.\n\n## Announcement\n\nI wrote a post explaining `go-cortex`: [Go Cortex - using Wit.ai on a raspberry pi connected to an arduino and written in go](http://goo.gl/4yy9bI)\n\nAnd on [this post](http://blog.fmpwizard.com/blog/using-voice-recognition-and-an-ultrasonic-sensor) I added voice recognition for commands.\n\n[Here](http://blog.fmpwizard.com/blog/voice-command-for-arduino-and-raspberry-pi-using-sms) I'm using Google Now to send an SMS to Cortex and have it turn lights on or off.\n\n\n## Example\n\nAt home I have a raspberrypi connected to an Arduino board with 6 LEDs. I can go on my browser to [http://fmpwizard.no-ip.org:8080/wit?q=turn+light+6+on](http://fmpwizard.no-ip.org:8080/wit?q=turn+light+6+on) and cortex will send the text `turn light 6 on` to wit and get back the intent `light`, with two parameters, one is the number `6` and the other is `on`.\n\nThe beauty here is that I can write different kinds of sentences that mean the same, and wit will do the heavy work of trying to understand them.\n\nI can say `The light 5 should really be on`, and wit will know what I meant, and in return cortext will process the command and turn the LED number 5 on.\n\n## Setup\n\nTo allow your user to send data to the usb connected Arduino, you will have to add your current\nuser to the group `dialout`.\n\nOn debian this is: (I'm using a raspberry pi here)\n\n```\nsudo usermod -a -G dialout pi\n```\n\nOnce you do that, you can either logout and login again, or you can start a new session with the new group by doing:\n\n```\nsu - pi\n```\n\nYou will also need a wit account, please refer to their [site](https://wit.ai/) for moree information. For now, access to their service is free as long as you are ok sharing your intents/data with them.\n\nOnce your wit account is activated, take your time to follow their tour and create some intentions.\n\n### Optional\n\nIf you want to control an Arduino, then you will need to set on up, I'll post diagrams for the simple one I have running at home.\n\nThere is an arduino folder in this repo that has two files you need to compile and send to the arduino board.\n\n## Running cortex\n\nAssuming you already have `go` installed and have `$GOPATH` setup, then type:\n\n```\ngo get github.com/fmpwizard/go-cortex\ngo install\ngo-cortex --config=cortex.config.json\n```\n\nA sample cortex.config.json is:\n\n```\n{\n  \"httpPort\": \"7070\",\n  \"flowdockAccessToken\": \"token here\", \n  \"witAccessToken\" : \"token here\",\n  \"flows\": \"fmpwizard/mission-control,fmpwizard/another-flow-here\",\n  \"flowsTicketsUrls\" : [\n    {\"mission-control\":  \"https://github.com/fmpwizard/go-cortex/issues/\"}\n  ]\n}\n```\n\nand you are ready, if you are running this locally, go to `http://127.0.0.1:8080/wit?q=\u003csome command here\u003e` and see the magic\n\n## SMS\n\nI'm using [Nexmo](https://dashboard.nexmo.com) as an SMS gateway. They gave me an US number that I can send a text to, and as soon as they get it, they send data to a callback url that Cortex listens to, `/sms`.\n\nYou can see the details of having Cortex listen on that path by looking at `services/nexmo.go`\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffmpwizard%2Fgo-cortex","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffmpwizard%2Fgo-cortex","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffmpwizard%2Fgo-cortex/lists"}